:root {
    --background: #f7f8fa;
    --surface: #ffffff;

    --text-primary: #202124;
    --text-secondary: #6b7280;

    --border: #e5e7eb;

    --accent: #4a90e2;

    --online: #22c55e;
    --offline: #ef4444;

    --shadow:
        0 4px 18px rgba(0, 0, 0, 0.06);

    --radius: 14px;
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    padding: 0;
}


body {
    background: var(--background);

    color: var(--text-primary);

    font-family:
        "Poppins",
        Arial,
        sans-serif;

    font-weight: 400;
}


.camera-page {
    width: 100%;
}


.page-header {
    min-height: 90px;

    padding:
        20px
        clamp(24px, 5vw, 80px);

    background: var(--surface);

    border-bottom:
        1px solid var(--border);

    display: flex;

    align-items: center;
    justify-content: space-between;
}


.brand {
    font-size:
        clamp(1.35rem, 2vw, 2rem);

    font-weight: 600;

    letter-spacing: -0.5px;
}


.header-info {
    display: flex;

    align-items: center;

    gap: 18px;

    color: var(--text-secondary);

    font-size: 0.95rem;
}


#local-time {
    color: var(--text-primary);

    font-size: 1.15rem;

    font-weight: 500;
}


.camera-section {
    max-width: 1500px;

    margin: 0 auto;

    padding:
        60px
        clamp(20px, 5vw, 80px);
}


.section-header {
    margin-bottom: 38px;

    text-align: center;
}


.section-header h1 {
    margin: 0 0 10px;

    font-size:
        clamp(2rem, 4vw, 3.3rem);

    font-weight: 500;

    letter-spacing: -1px;
}


.section-header p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 1rem;
}


.camera-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 28px;
}


.camera-card {
    overflow: hidden;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}


.camera-video {
    position: relative;

    aspect-ratio: 16 / 9;

    background: #eef0f3;
}


.camera-placeholder {
    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 12px;

    color: var(--text-secondary);

    font-size: 0.9rem;
}


.camera-icon {
    font-size: 2.5rem;

    color: #c4c9d0;
}


.camera-footer {
    min-height: 94px;

    padding: 20px 22px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;
}


.camera-footer h2 {
    margin: 0 0 5px;

    font-size: 1.05rem;

    font-weight: 500;
}


.camera-location {
    color: var(--text-secondary);

    font-size: 0.8rem;
}


.camera-status {
    display: flex;

    align-items: center;

    gap: 8px;

    white-space: nowrap;

    color: var(--text-secondary);

    font-size: 0.78rem;
}


.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--offline);
}


.camera-status.online .status-dot {
    background: var(--online);
}


.weather-bar {
    max-width: 1340px;

    margin:
        0 auto 50px;

    padding:
        28px
        clamp(20px, 4vw, 50px);

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    box-shadow: var(--shadow);
}


.weather-item {
    min-height: 62px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    border-right:
        1px solid var(--border);
}


.weather-item:last-child {
    border-right: 0;
}


.weather-value {
    color: var(--text-primary);

    font-size: 1.25rem;

    font-weight: 500;
}


.weather-label {
    margin-top: 5px;

    color: var(--text-secondary);

    font-size: 0.78rem;
}


.page-footer {
    padding: 28px;

    color: var(--text-secondary);

    text-align: center;

    font-size: 0.8rem;
}


@media (max-width: 1000px) {

    .camera-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 700px) {

    .page-header {
        min-height: 76px;

        padding:
            16px 20px;
    }


    .location {
        display: none;
    }


    .camera-section {
        padding:
            38px 16px;
    }


    .section-header {
        margin-bottom: 28px;
    }


    .camera-grid {
        grid-template-columns: 1fr;

        gap: 20px;
    }


    .weather-bar {
        margin:
            0 16px 30px;

        padding: 12px;

        grid-template-columns:
            repeat(2, 1fr);
    }


    .weather-item {
        padding: 16px 8px;
    }


    .weather-item:nth-child(2) {
        border-right: 0;
    }


    .weather-item:nth-child(-n+2) {
        border-bottom:
            1px solid var(--border);
    }

}

/* =========================================================
   CAMERA FULLSCREEN
   ========================================================= */

.camera-video {
    cursor: zoom-in;
    outline: none;
}

.camera-video:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

.camera-video::after {
    content: "⛶";

    position: absolute;
    top: 14px;
    right: 14px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);

    border-radius: 8px;

    font-size: 1.3rem;

    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        background 0.2s ease;
}

.camera-video:hover::after,
.camera-video:focus-visible::after {
    opacity: 1;
}

.camera-video:fullscreen {
    width: 100vw;
    height: 100vh;

    aspect-ratio: auto;

    background: #000000;

    cursor: zoom-out;
}

.camera-video:fullscreen .camera-placeholder {
    color: #ffffff;
}

.camera-video:fullscreen .camera-icon {
    color: #ffffff;
}

.camera-video:fullscreen::after {
    content: "Échap pour quitter";

    top: auto;
    right: 50%;
    bottom: 30px;

    width: auto;
    height: auto;

    padding: 10px 18px;

    transform: translateX(50%);

    border-radius: 20px;

    font-size: 0.8rem;

    opacity: 1;
}


/* Future real video stream */

.camera-video video {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.camera-video:fullscreen video {
    object-fit: contain;
}

/* =========================================================
   CAMERA STREAM
   ========================================================= */

.camera-stream {
    width: 100%;
    height: 100%;

    display: block;

    border: 0;

    background: #000000;
}

.camera-video:fullscreen .camera-stream {
    width: 100vw;
    height: 100vh;
}

.camera-placeholder[hidden] {
    display: none;
}
