/* ============================================
   GEOTOPIA - River Systems Explorer Styles
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #0077b6;
    --primary-dark: #023e8a;
    --primary-light: #48cae4;
    --secondary-color: #00b4d8;
    --accent-color: #90e0ef;
    --success-color: #06d6a0;
    --warning-color: #ffd166;
    --danger-color: #ef476f;
    
    --bg-primary: #0a1628;
    --bg-secondary: #0d1f3c;
    --bg-card: rgba(13, 31, 60, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    --river-color: #3498db;
    --tributary-color: #2ecc71;
    --distributary-color: #e74c3c;
    
    --font-primary: 'Poppins', sans-serif;
    --font-display: 'Playfair Display', serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
    --border-radius-full: 50%;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.water-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

.wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: wave 2s ease-out infinite;
}

.wave:nth-child(2) {
    animation-delay: 0.3s;
}

.wave:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes wave {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.preloader h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 30px;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition-normal);
}

.navbar.scrolled {
    padding: 10px 30px;
    background: rgba(10, 22, 40, 0.98);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-logo i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.nav-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.nav-search input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.nav-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 119, 182, 0.3);
}

.nav-search input::placeholder {
    color: var(--text-muted);
}

.nav-search i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.nav-stats {
    display: flex;
    gap: 15px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-badge i {
    color: var(--primary-color);
}

/* Profile Navigation */
.navbar-profile {
    background: rgba(10, 22, 40, 0.8);
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    transition: var(--transition-fast);
}

.nav-back:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(10, 22, 40, 0.7) 0%,
        rgba(10, 22, 40, 0.5) 50%,
        rgba(10, 22, 40, 0.95) 100%
    );
}

.hero-content {
    text-align: center;
    padding: 100px 30px;
    max-width: 900px;
}

.hero-title {
    margin-bottom: 30px;
}

.title-line {
    display: block;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: var(--primary-light);
    margin-bottom: 10px;
}

.title-main {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-color) 50%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 10px;
}

.title-sub {
    display: block;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 50px;
}

.hero-stat {
    text-align: center;
}

.hero-stat .stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-light);
    line-height: 1;
}

.hero-stat .stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius-xl);
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition-normal);
    box-shadow: 0 10px 40px rgba(0, 119, 182, 0.4);
}

.hero-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 119, 182, 0.5);
}

.hero-cta i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(5px); }
    60% { transform: translateY(3px); }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 15px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { opacity: 1; top: 8px; }
    100% { opacity: 0; top: 20px; }
}

/* ============================================
   FILTER SECTION
   ============================================ */
.filter-section {
    padding: 30px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filter-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    color: white;
}

.filter-group select {
    padding: 10px 35px 10px 15px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0aec0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.view-buttons {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ============================================
   RIVERS SECTION
   ============================================ */
.rivers-section {
    padding: 60px 30px;
    max-width: 1500px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header h2 i {
    margin-right: 15px;
    -webkit-text-fill-color: var(--primary-color);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Rivers Grid */
.rivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.rivers-grid.list-view {
    grid-template-columns: 1fr;
    gap: 15px;
}

/* River Card */
.river-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
}

.river-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 119, 182, 0.3);
    border-color: var(--primary-color);
}

.river-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.river-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.river-card:hover .river-card-image img {
    transform: scale(1.1);
}

.river-rank {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.4);
}

.river-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.river-card-content {
    padding: 20px;
}

.river-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.river-card-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.country-flag {
    font-size: 1.2rem;
    cursor: default;
}

.river-card-length {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.river-card-length i {
    color: var(--primary-color);
}

/* List View Card */
.rivers-grid.list-view .river-card {
    display: flex;
    align-items: center;
}

.rivers-grid.list-view .river-card-image {
    width: 100px;
    min-width: 100px;
    padding-top: 0;
    height: 100px;
    border-radius: var(--border-radius-md);
}

.rivers-grid.list-view .river-card-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.rivers-grid.list-view .river-card-overlay {
    display: none;
}

.rivers-grid.list-view .river-card-name {
    margin-bottom: 0;
}

/* Loading More */
.loading-more {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-more.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   WORLD MAP SECTION
   ============================================ */
.world-map-section {
    padding: 60px 30px;
    background: var(--bg-secondary);
}

.map-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#worldMap {
    height: 500px;
    background: var(--bg-primary);
}

.map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.map-legend h4 {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 30px;
    height: 4px;
    border-radius: 2px;
}

/* ============================================
   PROFILE PAGE STYLES
   ============================================ */
.profile-page {
    background: var(--bg-primary);
}

.profile-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(10, 22, 40, 0.85) 0%,
        rgba(10, 22, 40, 0.7) 30%,
        rgba(10, 22, 40, 0.95) 100%
    );
}

.profile-main {
    padding-top: 100px;
}

/* Profile Hero */
.profile-hero {
    padding: 60px 30px;
    text-align: center;
}

.river-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius-xl);
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 119, 182, 0.4);
}

.rank-number {
    font-size: 2rem;
    font-weight: 800;
}

.rank-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.river-name {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.river-countries {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.river-countries .country-flag {
    font-size: 2rem;
    padding: 8px 15px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.river-countries .country-flag:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.river-quick-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--border-color);
}

.quick-stat i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* ============================================
   FLY ALONG SECTION
   ============================================ */
.fly-section {
    padding: 0 30px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.fly-button {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: var(--border-radius-xl);
    color: white;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 10px 40px rgba(0, 119, 182, 0.4);
}

.fly-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 119, 182, 0.5);
}

.fly-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    animation: fly-pulse 2s infinite;
}

@keyframes fly-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.fly-text {
    text-align: left;
}

.fly-title {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
}

.fly-subtitle {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
}

.fly-arrow {
    font-size: 1.5rem;
    animation: arrow-move 1s infinite;
}

@keyframes arrow-move {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.fly-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--border-color);
}

.control-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.speed-control input[type="range"] {
    width: 100px;
    accent-color: var(--primary-color);
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: var(--bg-glass);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
}

/* ============================================
   MAP SECTION
   ============================================ */
.map-section {
    padding: 40px 30px;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.map-header h2 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.map-header h2 i {
    color: var(--primary-color);
}

.map-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.map-control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.map-control-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.map-control-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.map-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#riverMap {
    height: 600px;
    background: var(--bg-secondary);
}

.map-legend-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    z-index: 1000;
    max-width: 220px;
}

.map-legend-panel h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-line {
    width: 30px;
    height: 4px;
    border-radius: 2px;
}

.legend-line.main-river {
    background: var(--river-color);
}

.legend-line.tributary {
    background: var(--tributary-color);
}

.legend-line.distributary {
    background: var(--distributary-color);
}

.legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.legend-marker.source {
    background: var(--success-color);
}

.legend-marker.mouth {
    background: var(--danger-color);
}

.legend-marker.city {
    background: var(--warning-color);
}

.legend-marker.dam {
    background: #9b59b6;
}

/* Flight Info Panel */
.flight-info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--primary-color);
    backdrop-filter: blur(10px);
    z-index: 1000;
    min-width: 250px;
    box-shadow: 0 10px 40px rgba(0, 119, 182, 0.3);
}

.flight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    color: var(--primary-light);
    font-weight: 600;
}

.flight-header i {
    animation: fly-icon 1s infinite;
}

@keyframes fly-icon {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.flight-location h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.flight-location p {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.flight-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.flight-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.flight-stat .label {
    color: var(--text-muted);
}

.flight-stat .value {
    color: var(--primary-light);
    font-weight: 600;
}

/* ============================================
   MIND MAP SECTION
   ============================================ */
.mindmap-section {
    padding: 60px 30px;
    background: var(--bg-secondary);
}

.mindmap-container {
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
    padding: 40px 0;
}

.mindmap-wrapper {
    position: relative;
    min-width: 1200px;
    min-height: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mindmap-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--border-radius-full);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-shadow: 0 15px 50px rgba(0, 119, 182, 0.5);
    z-index: 10;
}

.center-image {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-full);
    background-size: cover;
    background-position: center;
    margin-bottom: 10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.mindmap-center h3 {
    font-size: 1rem;
    font-weight: 600;
}

.mindmap-branches {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.mindmap-branch {
    position: absolute;
    cursor: pointer;
    transition: var(--transition-normal);
}

.branch-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transition: var(--transition-normal);
}

.branch-node:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 119, 182, 0.3);
}

.branch-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: var(--border-radius-full);
    color: white;
    font-size: 1.1rem;
}

.branch-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.branch-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.branch-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform-origin: left center;
}

/* Branch Expanded Content */
.branch-expanded {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    min-width: 250px;
    max-width: 350px;
    z-index: 100;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.branch-expanded.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.branch-expanded ul {
    list-style: none;
    padding: 0;
}

.branch-expanded li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.branch-expanded li:last-child {
    border-bottom: none;
}

/* ============================================
   DETAILS SECTION
   ============================================ */
.details-section {
    padding: 60px 30px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.detail-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition-normal);
}

.detail-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px rgba(0, 119, 182, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.card-header i {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.card-header h3 {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
}

.arrow-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--border-radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
}

.arrow-indicator.inflow {
    background: rgba(46, 204, 113, 0.2);
    color: var(--tributary-color);
}

.arrow-indicator.outflow {
    background: rgba(231, 76, 60, 0.2);
    color: var(--distributary-color);
}

.card-content {
    padding: 25px;
}

/* Source & Mouth Card */
.info-row {
    display: flex;
    align-items: center;
    gap: 30px;
}

.info-item {
    flex: 1;
    text-align: center;
}

.info-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.info-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.info-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.info-arrow {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Countries List */
.countries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.country-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    font-size: 0.9rem;
}

.country-tag .flag {
    font-size: 1.2rem;
}

.states-section h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.states-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.state-tag {
    padding: 6px 12px;
    background: var(--primary-color);
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.2), rgba(0, 180, 216, 0.2));
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    color: var(--primary-light);
}

/* Tributaries Card */
.tributaries-grid {
    display: flex;
    gap: 20px;
}

.tributary-bank {
    flex: 1;
}

.tributary-bank h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--tributary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tributary-color);
}

.tributary-list {
    list-style: none;
}

.tributary-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.tributary-list li:hover {
    color: var(--tributary-color);
}

.tributary-list li::before {
    content: '→';
    color: var(--tributary-color);
    font-size: 0.8rem;
}

.tributary-divider {
    width: 3px;
    background: var(--river-color);
    border-radius: 2px;
    position: relative;
}

.river-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--river-color), var(--secondary-color));
    animation: flow 2s infinite;
}

@keyframes flow {
    0% { background-position: 0 0; }
    100% { background-position: 0 20px; }
}

/* Distributaries Card */
.distributaries-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.main-channel {
    padding: 15px 30px;
    background: var(--river-color);
    border-radius: var(--border-radius-md);
    font-weight: 600;
}

.delta-branches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.delta-branches::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 2px;
    height: 20px;
    background: var(--river-color);
}

.distributary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--distributary-color);
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    color: var(--distributary-color);
}

.distributary-item i {
    font-size: 0.8rem;
}

/* Cities Grid */
.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.city-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-md);
    transition: var(--transition-fast);
    cursor: pointer;
}

.city-item:hover {
    background: var(--primary-color);
}

.city-item i {
    color: var(--warning-color);
}

/* Dams List */
.dams-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dam-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-md);
    border-left: 3px solid #9b59b6;
}

.dam-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(155, 89, 182, 0.2);
    border-radius: var(--border-radius-full);
    color: #9b59b6;
}

.dam-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.dam-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Stats Card */
.stats-card .card-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-md);
}

.stat-icon {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius-full);
    font-size: 1.3rem;
}

.stat-info .stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Importance List */
.importance-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.importance-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
}

.importance-item i {
    color: var(--success-color);
}

/* Issues List */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.issue-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(239, 71, 111, 0.1);
    border-radius: var(--border-radius-md);
    border-left: 3px solid var(--danger-color);
}

.issue-item i {
    color: var(--danger-color);
    margin-top: 3px;
}

.issue-item span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Disputes Content */
.disputes-content {
    padding: 15px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-md);
}

.dispute-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.dispute-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dispute-item h4 {
    font-size: 0.95rem;
    color: var(--warning-color);
    margin-bottom: 8px;
}

.dispute-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* History Content */
.history-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-md);
}

.history-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 209, 102, 0.2);
    border-radius: var(--border-radius-full);
    color: var(--warning-color);
    flex-shrink: 0;
}

.history-text h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.history-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================
   RELATED RIVERS
   ============================================ */
.related-section {
    padding: 60px 30px;
    background: var(--bg-secondary);
}

.related-rivers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.related-card {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
}

.related-card:hover {
    transform: translateY(-5px);
}

.related-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.related-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.related-card h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.related-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================
   FLIGHT SUMMARY MODAL
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: none;
    border-radius: var(--border-radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.flight-summary {
    text-align: center;
    padding: 40px;
}

.summary-header {
    margin-bottom: 20px;
}

.summary-header i {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 15px;
}

.summary-header h2 {
    font-size: 1.8rem;
}

.summary-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: var(--border-radius-full);
    background-size: cover;
    background-position: center;
    border: 4px solid var(--primary-color);
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 30px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.summary-stat {
    padding: 20px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-md);
}

.summary-stat .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 5px;
}

.summary-stat .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.summary-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border: none;
    border-radius: var(--border-radius-xl);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 119, 182, 0.4);
}

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

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

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 50px 30px 30px;
    text-align: center;
}

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

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-logo i {
    color: var(--primary-color);
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: var(--border-radius-full);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 119, 182, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* ============================================
   LEAFLET CUSTOMIZATIONS
   ============================================ */
.leaflet-container {
    background: var(--bg-secondary) !important;
    font-family: var(--font-primary) !important;
}

.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    border-radius: var(--border-radius-md) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
}

.leaflet-popup-content {
    margin: 15px !important;
}

.custom-popup {
    text-align: center;
}

.custom-popup h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-light);
}

.custom-popup p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.source-marker {
    background: var(--success-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.mouth-marker {
    background: var(--danger-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.city-marker {
    background: var(--warning-color);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.dam-marker {
    background: #9b59b6;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Arrow markers for tributaries and distributaries */
.arrow-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--tributary-color);
    border-radius: 50%;
    color: white;
    font-size: 0.8rem;
}

.arrow-marker.outflow {
    background: var(--distributary-color);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .details-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (max-width: 992px) {
    .nav-links,
    .nav-stats {
        display: none;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .rivers-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .mindmap-wrapper {
        min-width: 100%;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 12px 20px;
    }
    
    .nav-search {
        max-width: 200px;
    }
    
    .hero-content {
        padding: 80px 20px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .rivers-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
    
    #worldMap,
    #riverMap {
        height: 400px;
    }
    
    .map-legend,
    .map-legend-panel {
        display: none;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .tributaries-grid {
        flex-direction: column;
    }
    
    .tributary-divider {
        width: 100%;
        height: 3px;
    }
    
    .fly-button {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }
    
    .fly-text {
        text-align: center;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .summary-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .title-main {
        font-size: 2.5rem;
    }
    
    .rivers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .river-card-content {
        padding: 15px;
    }
    
    .river-card-name {
        font-size: 0.95rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .river-name {
        font-size: 2rem;
    }
    
    .river-quick-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-up {
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.river-card {
    opacity: 0;
    animation: cardFadeIn 0.5s ease forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stagger animation for cards */
.river-card:nth-child(1) { animation-delay: 0.05s; }
.river-card:nth-child(2) { animation-delay: 0.1s; }
.river-card:nth-child(3) { animation-delay: 0.15s; }
.river-card:nth-child(4) { animation-delay: 0.2s; }
.river-card:nth-child(5) { animation-delay: 0.25s; }
.river-card:nth-child(6) { animation-delay: 0.3s; }
.river-card:nth-child(7) { animation-delay: 0.35s; }
.river-card:nth-child(8) { animation-delay: 0.4s; }
.river-card:nth-child(9) { animation-delay: 0.45s; }
.river-card:nth-child(10) { animation-delay: 0.5s; }

/* River flow animation on map */
.river-flow-animation {
    stroke-dasharray: 10, 5;
    animation: riverFlow 1s linear infinite;
}

@keyframes riverFlow {
    to {
        stroke-dashoffset: -15;
    }
}

/* Glow effect */
.glow {
    filter: drop-shadow(0 0 10px var(--primary-color));
}

/* Pulse animation for markers */
.pulse-marker {
    animation: pulseMarker 2s infinite;
}

@keyframes pulseMarker {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}
