:root {
    /* Modern Dark Theme Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #1a1a24;
    --bg-accent: #232333;
    
    /* Neon Accents */
    --neon-primary: #00d4ff;
    --neon-secondary: #ff0080;
    --neon-tertiary: #00ff88;
    --neon-warm: #ff6b35;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --text-muted: #8888a0;
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 400;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#globe-container {
    width: calc(100% - 320px);
    height: 100%;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    position: relative;
    transition: var(--transition-normal);
}

/* Sidebar Styles */
#sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 24px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: -10px 0 40px var(--glass-shadow);
    transition: var(--transition-normal);
}

#sidebar h2 {
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--neon-primary);
    text-align: center;
    font-size: 1.8em;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-bottom: 2px solid var(--neon-primary);
    padding-bottom: 15px;
    text-shadow: 0 0 20px var(--neon-primary);
    letter-spacing: -0.5px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px var(--neon-primary); }
    to { text-shadow: 0 0 30px var(--neon-primary), 0 0 40px var(--neon-primary); }
}

#countries-list {
    margin-bottom: 30px;
}

/* Controls Section */
#controls {
    margin-bottom: 20px;
    text-align: center;
}

.play-button {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
    background: linear-gradient(135deg, var(--neon-secondary), var(--neon-primary));
}

.play-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.play-button:hover::before {
    left: 100%;
}

.country-item {
    background: var(--glass-bg);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-left: 3px solid var(--neon-primary);
    border: 1px solid var(--glass-border);
    transition: var(--transition-normal);
    cursor: pointer;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.country-item.highlighted {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 255, 136, 0.2));
    border-left: 3px solid var(--neon-tertiary);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    transform: scale(1.02);
    animation: journey-highlight 1.5s ease-in-out infinite alternate;
}

@keyframes journey-highlight {
    0% { 
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
        transform: scale(1.05);
    }
}

.country-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s;
}

.country-item:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
    border-color: var(--neon-primary);
}

.country-item:hover::before {
    left: 100%;
}

.country-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 8px;
}

.flag {
    font-size: 1.2em;
    margin-right: 8px;
    flex-shrink: 0;
}

.country-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.country-name {
    color: #ffce54;
    font-size: 1em;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.2px;
    line-height: 1.2;
    flex-shrink: 0;
}

.continent {
    color: var(--text-muted);
    font-size: 0.7em;
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
    opacity: 0.8;
    flex-shrink: 0;
}

.visit-dates {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.75em;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
    text-align: right;
}

.country-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    font-family: 'Poppins', sans-serif;
    margin-left: 32px; /* Align with country name (flag width + margin) */
}

.visits {
    color: var(--text-secondary);
    font-weight: 500;
}

.days {
    color: var(--neon-warm);
    font-weight: 500;
}

#dynamic-header {
    font-weight: bold;
    margin-bottom: 8px;
    color: #4CAF50;
}

.visit-date {
    font-size: 0.9em;
    color: #bbb;
    margin: 3px 0;
    padding-left: 10px;
}

.visit-date:before {
    content: "📅 ";
    margin-right: 5px;
}

#dynamic-header {
    background: var(--glass-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

#dynamic-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary), var(--neon-tertiary));
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

#dynamic-header p {
    margin: 12px 0;
    font-size: 1.1em;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.2px;
    text-align: center;
    line-height: 1.4;
}

#travel-summary {
    color: var(--neon-primary);
    text-shadow: 0 0 15px var(--neon-primary);
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    background: var(--glass-bg);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    pointer-events: none;
    z-index: 1001;
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 40px var(--glass-shadow);
    opacity: 0;
    transition: var(--transition-normal);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.tooltip.show {
    opacity: 1;
}

.tooltip .country-name {
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--neon-primary);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.tooltip .last-visit {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Add floating particles background effect */
#globe-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* Animations for dynamic header text changes */
@keyframes dropOut {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(25px) scale(0.95);
        opacity: 0;
    }
}

@keyframes dropIn {
    0% {
        transform: translateY(-25px) scale(0.95);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.drop-out {
    animation: dropOut 0.5s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

.drop-in {
    animation: dropIn 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

/* Responsive design */
@media (max-width: 768px) {
    body, html {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
    
    body {
        display: flex;
        flex-direction: column;
    }
    
    #globe-container {
        width: 100%;
        height: 50vh;
        min-height: 300px;
        position: relative;
        order: 1;
    }
    
    #sidebar {
        position: relative;
        width: 100%;
        min-height: 50vh;
        background: linear-gradient(180deg, #1e1e3f 0%, #2a2a4a 100%);
        border-left: none;
        border-top: 2px solid rgba(255, 159, 67, 0.3);
        padding: 20px;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.3);
        order: 2;
        box-sizing: border-box;
    }
    
    #sidebar h2 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }
    
    #dynamic-header {
        margin-bottom: 20px;
    }
    
    #dynamic-header p {
        font-size: 1em;
        line-height: 1.3;
    }
    
    .country-item {
        padding: 10px;
        margin-bottom: 6px;
    }
    
    .country-header {
        margin-bottom: 3px;
        gap: 6px;
    }
    
    .country-info {
        gap: 4px;
    }
    
    .country-name {
        font-size: 0.95em;
    }
    
    .continent {
        font-size: 0.65em;
    }
    
    .visit-dates {
        font-size: 0.7em;
    }
    
    .country-stats {
        font-size: 0.75em;
        margin-left: 28px;
    }
    
    .flag {
        font-size: 1.1em;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #globe-container {
        height: 45vh;
        min-height: 280px;
    }
    
    #sidebar {
        padding: 15px;
        min-height: 55vh;
    }
    
    #sidebar h2 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }
    
    #dynamic-header p {
        font-size: 0.9em;
        margin: 8px 0;
    }
    
    .country-item {
        padding: 8px;
        margin-bottom: 5px;
        border-radius: 6px;
    }
    
    .country-header {
        margin-bottom: 2px;
        gap: 4px;
    }
    
    .country-info {
        gap: 3px;
    }
    
    .country-name {
        font-size: 0.9em;
    }
    
    .continent {
        font-size: 0.6em;
    }
    
    .visit-dates {
        font-size: 0.65em;
    }
    
    .country-stats {
        font-size: 0.7em;
        margin-left: 24px;
    }
    
    .flag {
        font-size: 1em;
        margin-right: 6px;
    }
}

/* Desktop styles reset */
@media (min-width: 769px) {
    body, html {
        overflow: hidden;
        height: 100vh;
    }
    
    body {
        display: block;
    }
    
    #globe-container {
        position: relative;
        width: calc(100% - 320px);
        height: 100vh;
    }
    
    #sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 320px;
        height: 100vh;
        overflow-y: auto;
        z-index: 1000;
    }
}
