:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Dynamic Background Blobs */
.background-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4338ca;
    top: -100px;
    left: -100px;
    animation: float 10s ease-in-out infinite alternate;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #0284c7;
    bottom: -200px;
    right: -100px;
    animation: float 12s ease-in-out infinite alternate-reverse;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #059669;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 15s ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(50px) scale(1.1); }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 2rem 4rem;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero h1 span {
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.hero p {
    font-size: 1.25rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
}

/* Container & Grid */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.webcam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Webcam Card - Glassmorphism */
.webcam-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.webcam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-image-wrapper {
    width: 100%;
    height: 200px;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.webcam-card:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn {
    display: inline-block;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #0f172a;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: #cbd5e1;
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 2rem;
    border-top: 1px solid var(--card-border);
}

/* Map Section */
.map-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

#map {
    width: 100%;
    height: 600px;
    border-radius: 1rem;
    border: 1px solid var(--card-border);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Leaflet Popup Dark Mode Styling */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
}

.leaflet-popup-content {
    margin: 10px;
    text-align: center;
}

.popup-img {
    width: 200px;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.popup-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.popup-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.popup-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }
    .webcam-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}
