/**
 * UK Motorway Cameras - Custom Styles
 * Modern, clean design for emergency services and public use
 */

/* ============================================
   HEADER CUSTOMIZATION
   ============================================ */

.motorway-cameras-homepage .site-header,
.motorway-viewer-page .site-header {
	background: #ffffff;
	border-bottom: 1px solid #e9ecef;
	padding: 1.5rem 0;
}

.motorway-cameras-homepage .site-header .site-title a,
.motorway-viewer-page .site-header .site-title a {
	color: #1e3c72;
	font-weight: 700;
}

.motorway-cameras-homepage .site-header .site-title a:hover,
.motorway-viewer-page .site-header .site-title a:hover {
	color: #2a5298;
}

/* Hide WooCommerce elements on motorway pages */
.motorway-cameras-homepage .site-header .site-search,
.motorway-cameras-homepage .site-header .site-header-cart,
.motorway-viewer-page .site-header .site-search,
.motorway-viewer-page .site-header .site-header-cart {
	display: none;
}

/* Simplify navigation */
.motorway-cameras-homepage .main-navigation,
.motorway-viewer-page .main-navigation {
	display: none;
}

.motorway-cameras-homepage .secondary-navigation,
.motorway-viewer-page .secondary-navigation {
	display: none;
}

/* ============================================
   HOMEPAGE STYLES
   ============================================ */

.motorway-cameras-homepage {
	background: #f8f9fa;
	min-height: 100vh;
}

/* Hero Section */
.hero-section {
	background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
	color: #ffffff;
	padding: 4rem 0 3rem;
	text-align: center;
	margin-bottom: 3rem;
}

.hero-title {
	font-size: 3.5rem;
	font-weight: 700;
	margin: 0 0 1rem;
	letter-spacing: -1px;
}

.hero-subtitle {
	font-size: 1.5rem;
	margin: 0 0 1rem;
	opacity: 0.95;
	font-weight: 300;
}

.hero-description {
	font-size: 1.1rem;
	margin: 0;
	opacity: 0.9;
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}

/* Region Sections */
.motorway-regions {
	padding: 2rem 0 4rem;
}

.region-section {
	margin-bottom: 4rem;
}

.region-title {
	font-size: 2rem;
	font-weight: 600;
	margin: 0 0 0.5rem;
	color: #2c3e50;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.flag-icon {
	font-size: 1.5rem;
}

.region-update-info {
	color: #6c757d;
	font-size: 0.95rem;
	margin: 0 0 1.5rem;
}

/* Motorway Grid */
.motorway-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.25rem;
	margin-top: 1.5rem;
}

.motorway-card {
	background: #ffffff;
	border: 2px solid #e9ecef;
	border-radius: 8px;
	padding: 1.5rem;
	text-decoration: none;
	color: #2c3e50;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.motorway-card:hover {
	border-color: #2a5298;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(42, 82, 152, 0.15);
	text-decoration: none;
	color: #2a5298;
}

.motorway-name {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	color: #1e3c72;
}

.motorway-card:hover .motorway-name {
	color: #2a5298;
}

.motorway-count {
	font-size: 0.9rem;
	color: #6c757d;
	font-weight: 500;
}

/* Features Section */
.features-section {
	background: #ffffff;
	padding: 4rem 0;
	margin-top: 3rem;
	border-top: 1px solid #e9ecef;
}

.features-title {
	font-size: 2.5rem;
	font-weight: 600;
	text-align: center;
	margin: 0 0 3rem;
	color: #2c3e50;
}

.features-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 2rem;
}

.feature-card {
	text-align: center;
	padding: 2rem;
	background: #f8f9fa;
	border-radius: 8px;
	transition: transform 0.3s ease;
}

.feature-card:hover {
	transform: translateY(-4px);
}

.feature-icon {
	font-size: 3rem;
	margin-bottom: 1rem;
}

.feature-card h3 {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
	color: #2c3e50;
}

.feature-card p {
	margin: 0;
	color: #6c757d;
	line-height: 1.6;
}

/* ============================================
   CAMERA VIEWER PAGE STYLES
   ============================================ */

.motorway-viewer-page {
	background: #f8f9fa;
	min-height: 100vh;
}

.viewer-header {
	background: #ffffff;
	padding: 2rem 0;
	border-bottom: 1px solid #e9ecef;
	margin-bottom: 2rem;
}

.back-link {
	color: #2a5298;
	text-decoration: none;
	font-weight: 500;
	display: inline-block;
	margin-bottom: 1rem;
	transition: color 0.2s ease;
}

.back-link:hover {
	color: #1e3c72;
	text-decoration: underline;
}

.viewer-title {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0 0 0.5rem;
	color: #2c3e50;
}

.viewer-subtitle {
	color: #6c757d;
	margin: 0;
	font-size: 1.1rem;
}

.camera-viewer-container {
	padding: 1rem 0 4rem;
}

.camera-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
}

.camera-card {
	background: #ffffff;
	border: 2px solid #e9ecef;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.camera-card:hover {
	border-color: #2a5298;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(42, 82, 152, 0.15);
}

.camera-card-image {
	width: 100%;
	height: 200px;
	object-fit: cover;
	background: #e9ecef;
	display: block;
}

.camera-card-info {
	padding: 1.25rem;
}

.camera-card-name {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0 0 0.5rem;
	color: #2c3e50;
}

.camera-card-location {
	font-size: 0.9rem;
	color: #6c757d;
	margin: 0;
}

.loading-message {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem;
	color: #6c757d;
}

/* Spinner */
.spinner {
	border: 3px solid #e9ecef;
	border-top: 3px solid #2a5298;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin: 0 auto 1rem;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* ============================================
   CAMERA MODAL STYLES
   ============================================ */

.camera-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
}

.camera-modal.active {
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(4px);
}

.modal-content {
	position: relative;
	background: #ffffff;
	border-radius: 12px;
	max-width: 90vw;
	max-height: 90vh;
	width: 1200px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	z-index: 10001;
}

.modal-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: rgba(0, 0, 0, 0.5);
	color: #ffffff;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 1.5rem;
	cursor: pointer;
	z-index: 10002;
	transition: background 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.modal-close:hover {
	background: rgba(0, 0, 0, 0.7);
}

.modal-header {
	padding: 1.5rem;
	border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
	color: #2c3e50;
}

.camera-info {
	display: flex;
	gap: 1rem;
	align-items: center;
	font-size: 0.9rem;
	color: #6c757d;
}

.update-indicator {
	background: #e7f3ff;
	color: #2a5298;
	padding: 0.25rem 0.75rem;
	border-radius: 12px;
	font-size: 0.85rem;
	font-weight: 500;
}

.modal-body {
	padding: 1.5rem;
	overflow-y: auto;
	flex: 1;
}

.camera-image-container {
	position: relative;
	background: #000000;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 1.5rem;
	min-height: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.camera-image-container img {
	max-width: 100%;
	height: auto;
	display: block;
}

.camera-iframe {
	width: 100%;
	height: 600px;
	border: none;
	background: #000000;
	display: block;
}

@media (max-width: 768px) {
	.camera-iframe {
		height: 400px;
	}
}

.image-loading,
.image-error {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	color: #ffffff;
}

.image-error {
	background: rgba(220, 53, 69, 0.9);
	padding: 1rem 2rem;
	border-radius: 8px;
}

.camera-controls {
	display: flex;
	gap: 1rem;
	justify-content: center;
}

.button {
	background: #2a5298;
	color: #ffffff;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s ease;
}

.button:hover {
	background: #1e3c72;
}

.button:active {
	transform: scale(0.98);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
	.hero-title {
		font-size: 2.5rem;
	}
	
	.hero-subtitle {
		font-size: 1.25rem;
	}
	
	.motorway-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 1rem;
	}
	
	.motorway-card {
		padding: 1.25rem;
	}
	
	.motorway-name {
		font-size: 1.25rem;
	}
	
	.features-grid {
		grid-template-columns: 1fr;
	}
	
	.camera-grid {
		grid-template-columns: 1fr;
	}
	
	.modal-content {
		max-width: 95vw;
		width: 100%;
		max-height: 95vh;
	}
	
	.camera-image-container {
		min-height: 300px;
	}
}

@media (max-width: 480px) {
	.hero-section {
		padding: 2.5rem 0 2rem;
	}
	
	.hero-title {
		font-size: 2rem;
	}
	
	.region-title {
		font-size: 1.5rem;
	}
	
	.viewer-title {
		font-size: 1.75rem;
	}
}

/* ============================================
   FOOTER CUSTOMIZATION
   ============================================ */

.motorway-cameras-homepage .site-footer,
.motorway-viewer-page .site-footer {
	background: #f8f9fa;
	border-top: 1px solid #e9ecef;
	padding: 2rem 0;
	margin-top: 4rem;
}

.motorway-cameras-homepage .site-footer .site-info,
.motorway-viewer-page .site-footer .site-info {
	text-align: center;
	color: #6c757d;
	font-size: 0.9rem;
}

.motorway-cameras-homepage .site-footer a,
.motorway-viewer-page .site-footer a {
	color: #2a5298;
	text-decoration: none;
}

.motorway-cameras-homepage .site-footer a:hover,
.motorway-viewer-page .site-footer a:hover {
	text-decoration: underline;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.col-full {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

@media (min-width: 768px) {
	.col-full {
		padding: 0 2rem;
	}
}
