/**
 * Frontend CSS for Parvus Opening Hours
 */

/* Short form container */
.parvus-oh-short {
	/* background: #f9f9f9; */
	/* border: 1px solid #ddd; */
	/* border-radius: 4px; */
	/* padding: 12px 15px; */
	/* max-width: 400px; */
	/* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; */
	position: relative;
}

/* Short form current day row (status + next change + button) */
.parvus-oh-current-day {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.parvus-oh-day-content {
	flex: 1;
	min-width: 0;
}

/* Status info container (status text + next change) */
.parvus-oh-status-info {
    display: flex;
    flex-direction: row;
    gap: 6px;
    font-size: 13px;
    align-items: center;
}

/* Status text with colored dot and times */
.parvus-oh-status-text {
	font-weight: 600;
	font-size: 14px;
	color: #333;
	display: flex;
	align-items: center;
	gap: 6px;
	word-break: break-word;
}

/* Next state change text */
.parvus-oh-next-change {
	font-size: 14px;
	/* color: #666; */
	/* word-break: break-word; */
}

/* Status indicator dot */
.parvus-oh-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.parvus-oh-dot.open {
	background-color: #28a745;
	box-shadow: 0 0 6px rgba(40, 167, 69, 0.5);
}

.parvus-oh-dot.closing_soon {
	background-color: #ffc107;
	box-shadow: 0 0 6px rgba(255, 193, 7, 0.5);
}

.parvus-oh-dot.closed {
	background-color: #dc3545;
	box-shadow: 0 0 6px rgba(220, 53, 69, 0.5);
}

/* Toggle popover button */
.parvus-oh-toggle-popover {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	/* height: 28px; */
	padding: 0.125rem 0.25rem;
	background: transparent;
	/* border: 1px solid #ccc; */
	border: none;
    text-decoration: underline;
	border-radius: 0.25rem;
	cursor: pointer;
	transition: all 0.2s;
	/* color: #666; */
	flex-shrink: 0;
}

.parvus-oh-toggle-popover:hover {
	/* background: #f0f0f0; */
	/* color: #333; */
}

.parvus-oh-toggle-popover[aria-expanded="true"] {
	background: #e8f5f9;
	border-color: #81d4fa;
	color: #0073aa;
}

.parvus-oh-toggle-popover-text {
    margin-right: 0.25rem;
}

.parvus-oh-toggle-popover svg {
	width: 1rem;
	height: 1rem;
}

/* Popover dropdown */
.parvus-oh-popover {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 0.25rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 9999;
	margin: 0.25rem;
	display: none;
    min-width: 295px;
    width: max-content;
    max-width: min(95vw, 400px);
}

/* Popover table styles */
.parvus-oh-next-days-table {
	width: 100%;
	border-collapse: collapse;
}

.parvus-oh-next-day-row {
	border-bottom: 1px solid #e8e8e8;
}

.parvus-oh-next-day-row:last-child {
	border-bottom: none;
}

.parvus-oh-next-day-row.parvus-oh-today {
    font-weight: 600;
}

.parvus-oh-next-day-label {
	padding: 0.125rem 0.25rem;
	font-weight: 500;
	font-size: 0.75rem;
	width: auto;
	text-align: left;
}

.parvus-oh-today-badge {
	display: inline-block;
	background: #0073aa;
	color: white;
	padding: 0.125rem 0.375rem;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	font-weight: 600;
}

.parvus-oh-day-name {
	font-weight: 600;
}

.parvus-oh-day-date {
	font-size: 0.75rem;
	color: #666;
	font-weight: normal;
}

.parvus-oh-next-day-times {
	padding: 0.125rem 0.25rem;
	font-size: 0.75rem;
	color: #333;
	text-align: right;
}

/* Long form container */
.parvus-oh-long {
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 0.25rem;
	padding: 1.25rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Tab structure */
.parvus-oh-tabs {
	width: 100%;
}

.parvus-oh-tab-nav {
	display: flex;
	gap: 8px;
	border-bottom: 2px solid #e8e8e8;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.parvus-oh-tab-button {
	padding: 10px 16px;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	color: #666;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	position: relative;
	bottom: -2px;
	margin-bottom: -2px;
}

.parvus-oh-tab-button:hover {
	color: #333;
	background: #f5f5f5;
}

.parvus-oh-tab-button.active {
	color: #0073aa;
	border-bottom-color: #0073aa;
	font-weight: 600;
}

.parvus-oh-tab-content {
	width: 100%;
}

.parvus-oh-week-block {
	display: none;
}

.parvus-oh-week-block.active {
	display: block;
}

.parvus-oh-week-title {
	margin: 0 0 12px 0;
	font-size: 15px;
	font-weight: 600;
	color: #333;
	text-transform: uppercase;
}

/* Hours table */
.parvus-oh-hours-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 0;
}

.parvus-oh-day-row {
	border-bottom: 1px solid #e8e8e8;
}

.parvus-oh-day-row:last-child {
	border-bottom: none;
}

.parvus-oh-day-row.parvus-oh-today {
	background: #f5f9fc;
	font-weight: 600;
}

.parvus-oh-day-label {
	padding: 10px 12px;
	text-align: left;
	width: 30%;
	font-size: 13px;
}

.parvus-oh-day-times {
	padding: 10px 12px;
	font-size: 13px;
	color: #333;
	text-align: right;
}

/* Responsive */
@media (max-width: 600px) {
	.parvus-oh-short {
        position: static;
	}

	.parvus-oh-long {
		padding: 0.75rem;
	}

	.parvus-oh-tab-nav {
		gap: 4px;
		margin-bottom: 15px;
	}

	.parvus-oh-tab-button {
		padding: 8px 12px;
		font-size: 12px;
	}

	.parvus-oh-day-label,
	.parvus-oh-next-day-label {
		width: auto;
	}

	.parvus-oh-next-day-label,
	.parvus-oh-next-day-times {
		padding: 2px 4px;
		font-size: 12px;
	}
}

/* Locations */

.parvus-oh-locations {
    display: flex;
    gap: 1rem;
    position:relative;
    padding: 0.25rem;
}

.parvus-oh-locations .parvus-oh-popover {
    padding: 0.5rem;
}
.parvus-oh-locations .parvus-oh-popover p {
    margin-bottom: 4px;
    margin-top: 0;
}