/**
 * Opening Hours for HivePress - Frontend Styles
 */

/* Opening Hours Block */
.hp-opening-hours-block {
	margin-bottom: 2rem;
	background: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 1.5rem;
}

.hp-opening-hours-block__title {
	margin: 0 0 1rem 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: #333;
}

/* Opening Hours Display */
.hp-opening-hours {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.hp-opening-hours__day {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem 0;
	border-bottom: 1px solid #eee;
	transition: background-color 0.2s ease;
}

.hp-opening-hours__day:last-child {
	border-bottom: none;
}

.hp-opening-hours__day--current {
	background-color: #fff3cd;
	border-radius: 4px;
	padding: 0.5rem 0.75rem;
	font-weight: 600;
}

.hp-opening-hours__day-name {
	font-weight: 500;
	color: #333;
	min-width: 100px;
}

.hp-opening-hours__day-time {
	color: #666;
	text-align: right;
}

.hp-opening-hours__day-time--closed {
	color: #999;
	font-style: italic;
}

/* Status Display */
.hp-opening-hours-status {
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	text-align: center;
	font-weight: 600;
}

.hp-opening-hours-status--open {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.hp-opening-hours-status--closed {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.hp-opening-hours-status__text {
	display: block;
	font-size: 1rem;
}

.hp-opening-hours-status__next {
	display: block;
	font-size: 0.875rem;
	font-weight: 400;
	margin-top: 0.25rem;
	opacity: 0.8;
}

/* Widget Styles */
.hp-opening-hours-widget {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.hp-opening-hours-widget__title {
	margin: 0 0 1rem 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
	.hp-opening-hours-block {
		padding: 1rem;
	}
	
	.hp-opening-hours__day {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}
	
	.hp-opening-hours__day-time {
		text-align: left;
		font-size: 0.875rem;
	}
	
	.hp-opening-hours__day--current {
		padding: 0.75rem;
	}
}

/* Integration with HivePress Themes */
.hp-listing .hp-opening-hours-block {
	margin: 1.5rem 0;
}

.hp-listing__sidebar .hp-opening-hours-block {
	margin-bottom: 1rem;
}

/* Card Styles for Theme Integration */
.card .hp-opening-hours-block {
	background: transparent;
	border: none;
	padding: 0;
}

.card-body .hp-opening-hours-block {
	margin-bottom: 0;
}

/* Compact Display */
.hp-opening-hours--compact .hp-opening-hours__day {
	padding: 0.25rem 0;
	font-size: 0.875rem;
}

.hp-opening-hours--compact .hp-opening-hours__day-name {
	min-width: 80px;
}

/* Status Indicators */
.hp-opening-hours-status--open::before {
	content: "●";
	margin-right: 0.5rem;
	color: #28a745;
}

.hp-opening-hours-status--closed::before {
	content: "●";
	margin-right: 0.5rem;
	color: #dc3545;
}

/* Animation */
.hp-opening-hours-status {
	animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.7;
	}
}

/* Archive Page Status Overlays */
.hp-listing-image-container,
.hp-listing__image.hp-listing-image-container {
	position: relative !important;
	display: inline-block !important;
	width: 100%;
}

/* OHFH Status Overlays (JavaScript-generated) */
.ohfh-status-overlay {
	position: absolute !important;
	top: 8px !important;
	right: 8px !important;
	z-index: 10 !important;
	border-radius: 4px;
	padding: 4px 8px;
	font-size: 12px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: white !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	pointer-events: none;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	transition: all 0.2s ease;
}

/* Background colors are set via JavaScript with customizable opacity */
/* Fallback colors only - JavaScript will override these with RGBA */
.ohfh-status-overlay.ohfh-status-open {
	background: rgba(76, 175, 80, 0.85);
}

.ohfh-status-overlay.ohfh-status-closed {
	background: rgba(244, 67, 54, 0.85);
}

.ohfh-status-overlay.ohfh-status-closed-today {
	background: rgba(255, 152, 0, 0.85);
}

.ohfh-status-overlay.ohfh-status-unavailable {
	background: rgba(158, 158, 158, 0.85);
}

.hp-opening-hours-overlay {
	position: absolute !important;
	top: 10px !important;
	left: 10px !important;
	z-index: 100 !important;
	border-radius: 4px;
	padding: 6px 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: white !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	transition: all 0.2s ease;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.hp-opening-hours-overlay--open {
	background: linear-gradient(135deg, #28a745, #20c997);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.hp-opening-hours-overlay--closed {
	background: linear-gradient(135deg, #dc3545, #e74c3c);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.hp-opening-hours-overlay--hours-not-available {
	background: linear-gradient(135deg, #6c757d, #495057);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.hp-opening-hours-overlay--loading {
	background: linear-gradient(135deg, #007cba, #0073aa);
	border: 1px solid rgba(255, 255, 255, 0.2);
	animation: pulse 1.5s ease-in-out infinite;
}

.hp-opening-hours-overlay::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: inherit;
	border-radius: inherit;
	opacity: 0.9;
	z-index: -1;
}

/* Hover effect */
.hp-listing-image-container:hover .hp-opening-hours-overlay {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.hp-opening-hours-overlay {
		top: 8px;
		left: 8px;
		padding: 4px 8px;
		font-size: 10px;
	}
}

@media (max-width: 480px) {
	.hp-opening-hours-overlay {
		top: 6px;
		left: 6px;
		padding: 3px 6px;
		font-size: 9px;
		letter-spacing: 0.3px;
	}
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
	.hp-opening-hours-block {
		background: #2d2d2d;
		border-color: #444;
		color: #fff;
	}
	
	.hp-opening-hours-block__title {
		color: #fff;
	}
	
	.hp-opening-hours__day {
		border-bottom-color: #444;
	}
	
	.hp-opening-hours__day--current {
		background-color: #3d3d00;
		color: #fff;
	}
	
	.hp-opening-hours__day-name {
		color: #fff;
	}
	
	.hp-opening-hours__day-time {
		color: #ccc;
	}
	
	.hp-opening-hours__day-time--closed {
		color: #999;
	}
	
	.hp-opening-hours-widget {
		background: #2d2d2d;
		border-color: #444;
		color: #fff;
	}
	
	.hp-opening-hours-widget__title {
		color: #fff;
	}
	
	/* Dark theme for editor */
	.ohfh-opening-hours-container {
		background: #2d2d2d;
		border-color: #444;
		color: #fff;
	}
	
	.ohfh-opening-hours-container .hp-field__label {
		color: #fff;
	}
	
	.hp-opening-hours-editor__day,
	.ohfh-day {
		background: #3d3d3d;
		border-color: #555;
	}
	
	.hp-opening-hours-editor__day-header {
		background: #2d2d2d;
		border-bottom-color: #555;
	}
	
	.hp-opening-hours-editor__day-name {
		color: #fff;
	}
	
	.hp-opening-hours-editor__time,
	.ohfh-time-input {
		background: #3d3d3d;
		border-color: #555;
		color: #fff;
	}
	
	.hp-opening-hours-editor__separator,
	.ohfh-time-separator {
		color: #ccc;
	}
}

/* Opening Hours Editor (Frontend Forms) */
.ohfh-opening-hours-container {
	margin: 1.5rem 0;
	padding: 1.5rem;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 8px;
}

.ohfh-opening-hours-container .hp-field__label {
	display: block;
	margin-bottom: 1rem;
	font-weight: 600;
	font-size: 1.125rem;
	color: #333;
}

.hp-opening-hours-editor {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.hp-opening-hours-editor__day,
.ohfh-day {
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
	margin-bottom: 1rem;
}

.hp-opening-hours-editor__day-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem;
	background: #f8f9fa;
	border-bottom: 1px solid #ddd;
}

.hp-opening-hours-editor__day-name {
	font-weight: 600;
	color: #333;
	margin-left: 0.5rem;
}

.hp-opening-hours-editor__day-checkbox,
.ohfh-day-checkbox {
	margin: 0 !important;
	cursor: pointer;
}

.hp-opening-hours-editor__add-period,
.ohfh-add-period {
	padding: 0.25rem 0.75rem;
	font-size: 0.875rem;
	line-height: 1.4;
	border-radius: 4px;
	border: 1px solid #007cba;
	background: #007cba;
	color: #fff;
	cursor: pointer;
	transition: all 0.2s ease;
}

.hp-opening-hours-editor__add-period:hover,
.ohfh-add-period:hover {
	background: #005a87;
	border-color: #005a87;
}

.hp-opening-hours-editor__day-periods,
.hp-opening-hours-editor__periods,
.ohfh-periods {
	padding: 1rem;
	background: #fff;
}

.hp-opening-hours-editor__period,
.ohfh-period {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
	flex-wrap: wrap;
}

.hp-opening-hours-editor__period:last-child,
.ohfh-period:last-child {
	margin-bottom: 0;
}

.hp-opening-hours-editor__time,
.ohfh-time-input {
	padding: 0.5rem 0.75rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-family: inherit;
	font-size: 0.875rem;
	min-width: 120px;
	transition: border-color 0.2s ease;
}

.hp-opening-hours-editor__time:focus,
.ohfh-time-input:focus {
	outline: none;
	border-color: #007cba;
	box-shadow: 0 0 0 1px #007cba;
}

.hp-opening-hours-editor__separator,
.ohfh-time-separator {
	color: #666;
	font-weight: 500;
	margin: 0 0.25rem;
}

.hp-opening-hours-editor__remove-period,
.ohfh-remove-period {
	padding: 0.25rem 0.75rem;
	font-size: 0.875rem;
	line-height: 1.4;
	border-radius: 4px;
	border: 1px solid #dc3545;
	background: #dc3545;
	color: #fff;
	cursor: pointer;
	transition: all 0.2s ease;
}

.hp-opening-hours-editor__remove-period:hover,
.ohfh-remove-period:hover {
	background: #c82333;
	border-color: #c82333;
}

/* Responsive Design for Editor */
@media (max-width: 768px) {
	.ohfh-opening-hours-container {
		padding: 1rem;
	}
	
	.hp-opening-hours-editor__day-header {
		flex-direction: column;
		gap: 0.75rem;
		align-items: center;
	}
	
	.hp-opening-hours-editor__period,
	.ohfh-period {
		flex-direction: column;
		align-items: stretch;
		gap: 0.5rem;
	}
	
	.hp-opening-hours-editor__time,
	.ohfh-time-input {
		min-width: 100%;
	}
	
	.hp-opening-hours-editor__separator,
	.ohfh-time-separator {
		text-align: center;
		margin: 0;
	}
}

/* ===== NEW BLOCK STYLES ===== */

/* Main Opening Hours Block - Updated Schedule Display */
.hp-opening-hours-schedule {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.hp-opening-hours-schedule__day {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.75rem 0;
	border-bottom: 1px solid #eee;
	transition: all 0.2s ease;
}

.hp-opening-hours-schedule__day:last-child {
	border-bottom: none;
}

.hp-opening-hours-schedule__day--current {
	background-color: #fff3cd;
	border-radius: 6px;
	padding: 0.75rem 1rem;
	font-weight: 600;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hp-opening-hours-schedule__day-name {
	font-weight: 500;
	color: #333;
	min-width: 100px;
}

.hp-opening-hours-schedule__day-times {
	color: #666;
	text-align: right;
}

.hp-opening-hours-schedule__closed {
	color: #999;
	font-style: italic;
}

.hp-opening-hours-schedule__time-range {
	display: inline-block;
}

.hp-opening-hours-schedule__separator {
	margin: 0 0.25rem;
}

/* Status Display - Enhanced */
.hp-opening-hours-status {
	margin-bottom: 1.5rem;
	padding: 1rem;
	border-radius: 8px;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-weight: 500;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hp-opening-hours-status--open {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.hp-opening-hours-status--closed {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.hp-opening-hours-status__indicator {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex-shrink: 0;
}

.hp-opening-hours-status--open .hp-opening-hours-status__indicator {
	background-color: #28a745;
	animation: pulse 2s infinite;
}

.hp-opening-hours-status--closed .hp-opening-hours-status__indicator {
	background-color: #dc3545;
}

.hp-opening-hours-status__text {
	font-size: 1rem;
	flex-grow: 1;
}

.hp-opening-hours-status__next {
	font-size: 0.875rem;
	font-weight: 400;
	opacity: 0.8;
	text-align: right;
}

/* Compact Block Styles */
.hp-opening-hours-compact {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 1rem;
	margin-bottom: 1rem;
}

.hp-opening-hours-compact__title {
	margin: 0 0 0.75rem 0;
	font-size: 1rem;
	font-weight: 600;
	color: #333;
}

.hp-opening-hours-compact__content {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.hp-opening-hours-compact__status {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
}

.hp-opening-hours-compact__status--open {
	background-color: #d4edda;
	color: #155724;
}

.hp-opening-hours-compact__status--closed {
	background-color: #f8d7da;
	color: #721c24;
}

.hp-opening-hours-compact__status-indicator {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.hp-opening-hours-compact__status--open .hp-opening-hours-compact__status-indicator {
	background-color: #28a745;
}

.hp-opening-hours-compact__status--closed .hp-opening-hours-compact__status-indicator {
	background-color: #dc3545;
}

.hp-opening-hours-compact__status-text {
	flex-grow: 1;
}

.hp-opening-hours-compact__next {
	font-size: 0.75rem;
	font-weight: 400;
	opacity: 0.8;
	padding: 0.25rem 0.75rem;
	background-color: #f8f9fa;
	border-radius: 4px;
	text-align: center;
}

.hp-opening-hours-compact__today {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem 0.75rem;
	background-color: #f8f9fa;
	border-radius: 6px;
	font-size: 0.875rem;
}

.hp-opening-hours-compact__today-label {
	font-weight: 500;
	color: #333;
}

.hp-opening-hours-compact__today-times {
	color: #666;
}

/* Status-Only Block Override */
.hp-opening-hours-status.hp-opening-hours-status {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	margin: 0;
	box-shadow: none;
}

.hp-opening-hours-status__main {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.hp-opening-hours-status__main .hp-opening-hours-status__indicator {
	width: 8px;
	height: 8px;
}

.hp-opening-hours-status__main + .hp-opening-hours-status__next {
	font-size: 0.75rem;
	font-weight: 400;
	opacity: 0.8;
	margin-left: 0.5rem;
	padding-left: 0.5rem;
	border-left: 1px solid rgba(0,0,0,0.2);
	text-align: left;
}

/* Widget Integration */
.hp-widget .hp-opening-hours-compact {
	border: none;
	background: transparent;
	padding: 0;
	margin: 0;
}

.hp-widget .hp-opening-hours-compact__title {
	border-bottom: 1px solid #eee;
	padding-bottom: 0.5rem;
	margin-bottom: 0.75rem;
}

/* Sidebar Integration */
.hp-listing__sidebar .hp-opening-hours-compact {
	margin-bottom: 1.5rem;
}

.hp-listing__sidebar .hp-opening-hours-status {
	width: 100%;
	justify-content: center;
}

/* Responsive Design - New Blocks */
@media (max-width: 768px) {
	.hp-opening-hours-compact {
		padding: 0.75rem;
	}
	
	.hp-opening-hours-compact__today {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}
	
	.hp-opening-hours-status__main + .hp-opening-hours-status__next {
		display: block;
		margin-left: 0;
		margin-top: 0.25rem;
		padding-left: 0;
		border-left: none;
		border-top: 1px solid rgba(0,0,0,0.2);
		padding-top: 0.25rem;
	}
	
	.hp-opening-hours-schedule__day {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}
	
	.hp-opening-hours-schedule__day-times {
		text-align: left;
	}
}

/* High Contrast Support */
@media (prefers-contrast: high) {
	.hp-opening-hours-status--open {
		background-color: #ffffff;
		color: #000000;
		border: 2px solid #28a745;
	}
	
	.hp-opening-hours-status--closed {
		background-color: #ffffff;
		color: #000000;
		border: 2px solid #dc3545;
	}
	
	.hp-opening-hours-compact__status--open {
		background-color: #ffffff;
		color: #000000;
		border: 1px solid #28a745;
	}
	
	.hp-opening-hours-compact__status--closed {
		background-color: #ffffff;
		color: #000000;
		border: 1px solid #dc3545;
	}
}

/* Dark Theme Support for New Blocks */
@media (prefers-color-scheme: dark) {
	.hp-opening-hours-schedule__day {
		border-color: #555;
	}
	
	.hp-opening-hours-schedule__day-name {
		color: #fff;
	}
	
	.hp-opening-hours-schedule__day-times {
		color: #ccc;
	}
	
	.hp-opening-hours-schedule__day--current {
		background-color: #3d4e00;
		color: #fff;
	}
	
	.hp-opening-hours-compact {
		background: #2d2d2d;
		border-color: #555;
	}
	
	.hp-opening-hours-compact__title {
		color: #fff;
	}
	
	.hp-opening-hours-compact__today {
		background-color: #3d3d3d;
	}
	
	.hp-opening-hours-compact__today-label {
		color: #fff;
	}
	
	.hp-opening-hours-compact__today-times,
	.hp-opening-hours-compact__next {
		color: #ccc;
	}
} 