:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #121214;
    --bg-tertiary: #1a1a1d;
    --accent-primary: #00d9ff;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #06b6d4;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;
    --border: rgba(255, 255, 255, 0.1);
    --grid: rgba(0, 217, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    scroll-behavior: smooth; /* Already smooth for anchor links, helps with JS scroll too */
}

/* Background Layers */
.bg-layers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 217, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    transition: all 0.3s ease;
}

.language-switcher {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 25px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.lang-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 217, 255, 0.1);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: var(--bg-primary);
}

.lang-btn.active:hover {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: var(--bg-primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--success);
    margin-bottom: 1.5rem;
    width: fit-content;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-title .line {
    display: block;
    /* Animation handled by JS or .fade-element */
}

.highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
    /* Animation handled by JS or .fade-element */
}

.hero-actions {
   /* Animation handled by JS or .fade-element */
}


.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.btn-primary .icon {
    width: 16px;
    height: 16px;
}

/* Map Container (Hero Section) */
.map-container {
    position: relative;
    height: 500px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    /* Parallax is handled by JS, initial anim was:
    opacity: 0;
    transform: translateX(50px); 
    animation: slideInLeft 1s ease 0.8s forwards; */
}

/* @keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
} */

.map-layers {
    position: relative;
    width: 100%;
    height: 100%;
}

.layer {
    position: absolute;
    border-radius: 15px;
    animation: mapLayerFloat 6s ease-in-out infinite;
}

.layer-1 {
    width: 80%;
    height: 70%;
    top: 10%;
    left: 10%;
    background: linear-gradient(45deg, rgba(0, 217, 255, 0.1), rgba(124, 58, 237, 0.1));
    border: 2px solid rgba(0, 217, 255, 0.2);
    animation-delay: 0s;
}

.layer-2 {
    width: 60%;
    height: 50%;
    top: 25%;
    left: 20%;
    background: linear-gradient(45deg, rgba(124, 58, 237, 0.1), rgba(6, 182, 212, 0.1));
    border: 2px solid rgba(124, 58, 237, 0.2);
    animation-delay: 1s;
}

.layer-3 {
    width: 40%;
    height: 30%;
    top: 35%;
    left: 30%;
    background: linear-gradient(45deg, rgba(6, 182, 212, 0.1), rgba(0, 217, 255, 0.1));
    border: 2px solid rgba(6, 182, 212, 0.2);
    animation-delay: 2s;
}

@keyframes mapLayerFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    33% { transform: translateY(-10px) scale(1.02); }
    66% { transform: translateY(5px) scale(0.98); }
}

.coordinates {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    border: 1px solid var(--border);
}

.coord-lat, .coord-lng {
    display: block;
    color: var(--accent-primary);
}

/* GIS Game Section */
.gis-game {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    /* Animation for game-container itself is handled by initGameAnimation */
}

.game-header {
    text-align: center;
    margin-bottom: 3rem;
}

.game-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-content {
    background: var(--bg-tertiary);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 2rem; /* Padding for question area */
    position: relative;
}

.game-question {
    text-align: center;
    margin-bottom: 2rem;
}

.game-question h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.question-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.question-info span {
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.game-map {
    width: 100%;
    height: 700px; 
    background: linear-gradient(135deg, #2a3f5a, #1e2d42);
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-radius: 15px 15px 0 0; /* Rounded top corners only */
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    box-shadow: inset 0 0 30px rgba(0, 217, 255, 0.1);
    /* No margin-bottom here, interaction area follows directly */
}

.map-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.landmass-block {
    position: absolute;
    background: linear-gradient(145deg, rgba(0, 217, 255, 0.25), rgba(124, 58, 237, 0.2)); 
    border: 1px solid rgba(0, 217, 255, 0.4); 
    pointer-events: none; 
    opacity: 0.9; 
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2), inset 0 0 8px rgba(0,0,0,0.15); 
}


.map-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 217, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.15) 1px, transparent 1px);
    background-size: 30px 30px; 
    opacity: 0.5; 
    z-index: 2;
    pointer-events: none;
}

.user-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 3;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
}

.correct-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--success);
    border: 3px solid var(--text-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 2;
    animation: pulse-marker 2s infinite;
}

@keyframes pulse-marker {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.distance-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    transform-origin: left center;
    display: none;
    z-index: 1;
    opacity: 0.8;
}

.game-interaction-area {
    background: linear-gradient(135deg, #1a2332, #141820); 
    padding: 1.5rem;
    border: 2px solid rgba(0, 217, 255, 0.3); /* Match map border */
    border-top: none; /* Remove top border as it's connected to map */
    border-radius: 0 0 15px 15px; 
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    /* margin-top: -1px; Remove this, border-top: none handles it */
}

.game-feedback {
    text-align: center;
    min-height: 30px; 
    margin-bottom: 1rem; 
    font-size: 1rem;
    font-weight: 500;
}

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


.game-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    min-width: 120px;
}

.start-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: var(--bg-primary);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 217, 255, 0.3);
}

.next-btn {
    background: linear-gradient(135deg, var(--success), #059669);
    color: var(--text-primary);
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.reset-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.reset-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.feedback-success {
    color: var(--success);
}

.feedback-error {
    color: var(--warning);
}

.feedback-info {
    color: var(--accent-primary);
}

/* Connect Section */
.connect {
    padding: 6rem 2rem;
    text-align: center;
    background: var(--bg-primary);
}

.connect-content {
    max-width: 600px;
    margin: 0 auto;
}

.connect-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.connect-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    transition: left 0.3s ease;
    z-index: -1;
}

.social-link:hover::before {
    left: 0;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
    color: var(--bg-primary);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.linkedin:hover {
    border-color: #0077b5; 
}

/* Responsive Design */
@media (max-width: 992px) { 
    .game-map {
        height: 600px; 
    }
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .hero-content > div:first-child { 
        margin: 0 auto; /* Center the text block */
    }
    
    .nav {
        padding: 1rem;
    }
        
    .gis-game {
        padding: 4rem 1rem;
    }

    .game-stats {
        gap: 1.5rem;
        flex-wrap: wrap; 
    }
    
    .game-content { 
        padding: 1.5rem; /* Adjusted padding for game content area */
    }

    .game-map {
        height: 500px; 
    }
    
    .question-info {
        gap: 1rem;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .map-container { 
        height: 350px; /* Adjusted hero map height */
        margin-top: 2rem; /* Add some space if hero text is long */
    }
    .game-interaction-area {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 6rem 1rem 2rem;
    }
    
    .hero-subtitle, 
    .game-subtitle, 
    .connect-subtitle { 
        font-size: 1rem;
    }
        
    .gis-game {
        padding: 3rem 1rem;
    }

    .connect {
        padding: 4rem 1rem;
    }
    .game-map {
        height: 400px; 
    }
    .stat-value {
        font-size: 1.5rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }
    .game-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
        min-width: 100px; /* Allow buttons to be a bit smaller */
    }
    .game-interaction-area {
        padding: 0.75rem;
    }
    .game-feedback {
        font-size: 0.9rem;
        min-height: 25px;
        margin-bottom: 0.75rem;
    }
    .game-question h3 {
        font-size: 1.2rem;
    }
    .question-info span {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
     .map-container { 
        height: 300px; /* Further adjust hero map height */
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a2332, #0f1419);
    border-top: 2px solid var(--accent-primary);
    padding: 1.5rem;
    z-index: 1000;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.cookie-content h3 {
    color: var(--accent-primary);
    font-size: 1.2rem;
    margin: 0;
}

.cookie-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.cookie-buttons button {
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookie-buttons .btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
}

.cookie-buttons .btn-primary:hover {
    background: var(--accent-tertiary);
    transform: translateY(-2px);
}

.cookie-buttons .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.cookie-buttons .btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

@media (max-width: 768px) {
    .cookie-content {
        text-align: left;
    }
    
    .cookie-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-buttons button {
        width: 100%;
    }
}