:root {
    --bg-light: #ffffff;
    --card-bg: #ffffff;
    --accent: #d32f2f; 
    --accent2: #ffffff ;
    --text: rgba(3, 57, 120, 1);
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
}

body {
    margin: 0; padding: 40px 20px;
    background-color: var(--bg-light);
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text);
}

header h1 {
    text-align: center; font-weight: bold; font-size: 2.2rem;
    margin-bottom: 50px; margin-top: 50px; letter-spacing: 2px;
    color: var(--text);
}

.weather-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 12px 20px;
    margin: -20px auto 40px auto;
    max-width: 800px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.weather-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.weather-label {
    font-weight: 700;
    color: var(--text);
    font-size: 0.75rem;
    opacity: 0.7;
}

.weather-value {
    font-weight: 600;
    color: var(--text);
}

@media (max-width: 768px) {
    .weather-bar {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        left: 50%;
        transform: translateX(-50%);
        position: relative;
        width: auto; 
        max-width: 95%;
        gap: 12px;
        padding: 6px 15px;
        margin-bottom: 20px;
    }

    .weather-item {
        flex: 0 0 auto !important;
        display: flex;
        align-items: center;
        gap: 3px;
        width: auto !important;
    }

    .label-text {
        display: none;
    }

    .weather-value {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .weather-label {
        font-size: 1rem;
    }
}

.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px; width: 100%; max-width: 1200px; margin: 0 auto;
}

.cam-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.03);
}

.cam-card:hover { transform: scale(1.02); }

.cam-thumb-wrapper {
    position: relative;
    width: 100%; aspect-ratio: 16 / 9;
    background: #000;
}

.cam-thumb { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }

.cam-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 40%);
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 15px; box-sizing: border-box;
}

.live-tag {
    background: var(--accent); color: white;
    font-size: 10px; font-weight: bold; padding: 3px 8px;
    border-radius: 2px; align-self: flex-start;
}

.cam-name { 
    background: var(--accent2); color: var(--text);
    font-size: 1rem; font-weight: bold;
    padding: 1px 10px; border-radius: 15px 50px 50px 15px;
    align-self: flex-start;
    opacity: 0.7;
}

.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); align-items: center; justify-content: center;
}

.modal-content {
    width: 90%; 
    max-width: 900px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

video::-webkit-media-controls-timeline { display: none !important; }
video::-webkit-media-controls-current-time-display { display: none !important; }
video::-webkit-media-controls-time-remaining-display { display: none !important; }

.video-container {
    width: 100%;
    aspect-ratio: 16 / 9; 
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.video-container:fullscreen {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

video::-webkit-media-controls {
    display: none !important;
}
video::-moz-media-controls {
    display: none !important;
}

.modal-content {
    width: 90%; 
    max-width: 900px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 8px 15px !important;
    background: rgba(3, 57, 120, 0.6) !important;
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none !important;
}

.modal-header h2 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.close-btn {
    font-size: 24px !important;
    color: rgba(255,255,255,0.7) !important;
    transition: 0.3s;
    line-height: 1;
    cursor: pointer !important;
    position: relative;
    z-index: 110;
    pointer-events: auto !important;
}

.close-btn:hover {
    color: #fff !important;
    transform: scale(1.1);
    
}

video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background: #000;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }
}

.custom-controls {
    position: absolute;
    bottom: 0 !important;
    top: auto !important;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9)); 
    display: flex;
    align-items: center;
    padding: 20px 15px;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 2147483647; 
    pointer-events: auto;
}

.custom-controls.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.video-container:hover .custom-controls {
    opacity: 1;
    visibility: visible;
}

.custom-controls button {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    outline: none;
    font-weight: bold;
}

.custom-controls button:hover {
    color: white;
}

.spacer { flex-grow: 1; }

.navbar {
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding-top: 15px;
    padding-bottom: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@media (max-width: 600px) {
    body {
        padding: 20px 10px;
    }

    header h1 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .camera-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .cam-card {
        border-radius: 12px;
    }

    .cam-name {
        font-size: 0.9rem;
        padding: 4px 12px;
    }
}

@keyframes loading-gradient {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.cam-card.skeleton {
    cursor: default;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}

.skeleton .cam-thumb-wrapper {
    background: #e0e0e0;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.skeleton-thumb, .skeleton-text {
    background: linear-gradient(to right, #e0e0e0 8%, #f2f2f2 18%, #e0e0e0 33%);
    background-size: 200% 100%;
    animation: loading-gradient 1.5s infinite;
}

.skeleton .cam-overlay {
    background: none;
}

.skeleton-text {
    height: 18px;
    margin-bottom: 8px;
    border-radius: 4px;
    width: 70%;
}

.skeleton .live-tag {
    height: 18px;
    width: 50px;
}

.skeleton .cam-name {
    height: 25px;
    width: 80%;
}

.label-text {
    display: inline;
}

@media (max-width: 768px) {
    .weather-bar {
        display: inline-flex;
        justify-content: space-around;
        align-items: center;
        width: 95%;
        margin: 0 auto 20px auto;
        padding: 8px 5px;
        flex-wrap: nowrap;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50px;
    }

    .label-text {
        display: none;
    }

    .weather-item {
        flex-direction: row;
        gap: 5px;
        font-size: 0.85rem;
    }

    .weather-label {
        font-size: 1.1rem;
        opacity: 1;
    }

    .weather-value {
        font-weight: 600;
    }
}

/* --- FOOTER --- */
.site-footer {
    margin-top: 60px;
    padding: 20px 0;
    border-top: 1px solid rgba(0,0,0,0.1);
    text-align: center;
    background-color: #fafafa;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

.site-footer p {
    margin: 0;
    opacity: 0.8;
    font-weight: 500;
    color: #444;
    font-size: 0.85rem;
    line-height: 1.8;
}

.site-footer p a {
    text-decoration: none !important; 
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s ease;
    font-weight: bold;
}

.site-footer p a:hover {
    color: #0056b3;
    text-decoration: none !important;
}