/*
 * Single Station Page CSS
 * Pixel-perfect from تفاصيل محطة.htm
 * Standalone – no theme dependency
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.station-detail-page {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: #2c3e50;
    direction: rtl;
}

/* ─── Header Navigation ─── */
.nav-header {
    background: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #1e3c72;
    text-decoration: none;
}

.nav-brand i {
    font-size: 28px;
    color: #1e3c72;
}

.nav-brand h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3c72;
    margin: 0;
}

.nav-back {
    background: #f0f4f8;
    color: #1e3c72;
    border: 2px solid #e0e0e0;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
}

.nav-back:hover {
    background: #1e3c72;
    color: white;
    border-color: #1e3c72;
    transform: translateX(-5px);
}

/* ─── Hero Section ─── */
.hero-section {
    padding: 60px 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #1e3c72;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.75) 0%, rgba(42, 82, 152, 0.65) 100%);
    z-index: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

.station-icon {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 50px;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.hero-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.hero-section .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #27ae60;
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    margin-top: 20px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ─── Main Container ─── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* ─── Stats Grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--accent, linear-gradient(135deg, #1e3c72 0%, #2a5298 100%));
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent, #1e3c72);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--accent, #1e3c72);
    margin-bottom: 20px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e3c72;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
    font-weight: 600;
}

/* ─── Content Grid ─── */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Cards ─── */
.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.card-header i {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.card-header h3 {
    font-size: 1.4rem;
    color: #1e3c72;
    font-weight: 700;
    margin: 0;
}

/* ─── Info Table ─── */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table td {
    padding: 15px 10px;
}

.info-table td:first-child {
    color: #666;
    font-weight: 600;
    width: 40%;
}

.info-table td:last-child {
    color: #1e3c72;
    font-weight: 700;
    font-size: 1.05rem;
}

/* ─── Specs Grid ─── */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.spec-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.spec-item:hover {
    border-color: #1e3c72;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.spec-icon {
    font-size: 32px;
    color: #1e3c72;
    margin-bottom: 10px;
}

.spec-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e3c72;
    margin-bottom: 5px;
}

.spec-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

/* ─── Performance Chart ─── */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

/* ─── Map Section ─── */
.map-container {
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
    position: relative;
}

#stationMap {
    height: 100%;
    width: 100%;
}

/* ─── Gallery ─── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
}

.gallery-item {
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 4 / 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item::after {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ─── Timeline ─── */
.timeline {
    position: relative;
    padding-right: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 8px;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding-right: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -26px;
    top: 5px;
    width: 16px;
    height: 16px;
    background: #1e3c72;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #1e3c72;
}

.timeline-date {
    font-size: 0.85rem;
    color: #1e3c72;
    font-weight: 700;
    margin-bottom: 5px;
}

.timeline-content {
    align-items: center;
    justify-content: center;
}

.map-placeholder i {
    font-size: 3rem;
    color: #a0aec0;
    margin-bottom: 10px;
}

/* ─── Buttons ─── */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 25px;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(30, 60, 114, 0.3);
}

.btn-secondary {
    background: white;
    color: #1e3c72;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    border-color: #1e3c72;
    color: #1e3c72;
    transform: translateY(-3px);
}

/* ─── Footer ─── */
.footer {
    background: #1e3c72;
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 60px;
}

.footer p {
    opacity: 0.8;
    margin: 0;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .nav-header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
    }

    .nav-brand h1 {
        font-size: 1rem;
    }

    .hero-section {
        padding: 40px 20px;
    }

    .hero-section h2 {
        font-size: 1.6rem;
    }

    .station-icon {
        width: 70px;
        height: 70px;
        font-size: 35px;
    }

    .container {
        padding: 20px 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Scoped gallery refinement for the single project page only */
body.station-detail-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

body.station-detail-page .gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: #f3f4f6;
}

body.station-detail-page .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

body.station-detail-page .gallery-item:hover img {
    transform: scale(1.05);
}

/* Fix hero title color */
.hero-section h2 {
    color: #ffffff !important;
}

.hero-section .subtitle {
    color: #ffffff !important;
}

/* ─── Enhancements ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.stat-card {
    padding: 15px 10px;
    min-height: 100px;
}

.stat-value {
    font-size: 18px;
}

.stat-label {
    font-size: 12px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.video-wrapper iframe,
.video-wrapper video {
    width: 100%;
    height: 100%;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.similar-item {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease;
}

.similar-item:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow);
}

.similar-image {
    width: 100%;
    height: 100px;
    overflow: hidden;
}

.similar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-title {
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}