/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent),
        radial-gradient(1px 1px at 20px 120px, #fff, transparent),
        radial-gradient(1px 1px at 200px 90px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 250px 50px, #eee, transparent),
        radial-gradient(1px 1px at 300px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 350px 40px, #fff, transparent),
        radial-gradient(2px 2px at 400px 80px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 450px 110px, #ddd, transparent),
        radial-gradient(1px 1px at 500px 30px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 550px 70px, #fff, transparent),
        radial-gradient(1px 1px at 600px 100px, rgba(255,255,255,0.7), transparent);
    background-repeat: repeat;
    background-size: 650px 200px;
    animation: sparkle 3s linear infinite;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

@keyframes sparkle {
    0% {
        opacity: 0.4;
        transform: translateY(0px) scale(0.8);
    }
    20% {
        opacity: 0.8;
        transform: translateY(-2px) scale(1);
    }
    40% {
        opacity: 0.3;
        transform: translateY(-4px) scale(0.9);
    }
    60% {
        opacity: 0.9;
        transform: translateY(-2px) scale(1.1);
    }
    80% {
        opacity: 0.5;
        transform: translateY(-1px) scale(0.95);
    }
    100% {
        opacity: 0.4;
        transform: translateY(0px) scale(0.8);
    }
}

/* Additional individual stars */
.star {
    position: fixed;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.star-1 {
    width: 2px;
    height: 2px;
    top: 10%;
    left: 15%;
    animation: twinkle1 2s infinite;
}

.star-2 {
    width: 1px;
    height: 1px;
    top: 20%;
    right: 25%;
    animation: twinkle2 1.5s infinite;
}

.star-3 {
    width: 3px;
    height: 3px;
    top: 30%;
    left: 70%;
    animation: twinkle3 2.5s infinite;
}

.star-4 {
    width: 1px;
    height: 1px;
    top: 45%;
    left: 20%;
    animation: twinkle1 1.8s infinite;
}

.star-5 {
    width: 2px;
    height: 2px;
    top: 60%;
    right: 15%;
    animation: twinkle2 2.2s infinite;
}

.star-6 {
    width: 1px;
    height: 1px;
    top: 75%;
    left: 60%;
    animation: twinkle3 1.3s infinite;
}

.star-7 {
    width: 2px;
    height: 2px;
    top: 85%;
    left: 25%;
    animation: twinkle1 2.7s infinite;
}

.star-8 {
    width: 1px;
    height: 1px;
    top: 15%;
    left: 50%;
    animation: twinkle2 1.9s infinite;
}

@keyframes twinkle1 {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

@keyframes twinkle2 {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    25% {
        opacity: 0.1;
        transform: scale(1);
    }
    75% {
        opacity: 1;
        transform: scale(1.3);
    }
}

@keyframes twinkle3 {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1) rotate(0deg);
    }
    33% {
        opacity: 0.7;
        transform: scale(1.2) rotate(120deg);
    }
    66% {
        opacity: 0.4;
        transform: scale(0.9) rotate(240deg);
    }
}

/* Shooting Stars */
.shooting-star {
    position: fixed;
    height: 2px;
    background: linear-gradient(90deg, #fff, transparent);
    border-radius: 1px;
    pointer-events: none;
    z-index: -1;
}

.shooting-star-1 {
    width: 100px;
    top: 20%;
    right: -100px;
    animation: shoot1 8s linear infinite;
}

.shooting-star-2 {
    width: 80px;
    top: 60%;
    right: -80px;
    animation: shoot2 12s linear infinite;
}

.shooting-star-3 {
    width: 120px;
    top: 40%;
    right: -120px;
    animation: shoot3 15s linear infinite;
}

@keyframes shoot1 {
    0% {
        right: -100px;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        right: 100%;
        opacity: 0;
    }
}

@keyframes shoot2 {
    0% {
        right: -80px;
        opacity: 0;
    }
    3% {
        opacity: 1;
    }
    97% {
        opacity: 1;
    }
    100% {
        right: 100%;
        opacity: 0;
    }
}

@keyframes shoot3 {
    0% {
        right: -120px;
        opacity: 0;
    }
    2% {
        opacity: 1;
    }
    98% {
        opacity: 1;
    }
    100% {
        right: 100%;
        opacity: 0;
    }
}

/* Constellation Lines */
.constellation {
    position: fixed;
    pointer-events: none;
    z-index: -1;
}

.constellation-1 {
    top: 15%;
    left: 10%;
    width: 150px;
    height: 100px;
}

.constellation-1::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 30px;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: constellation-glow 4s ease-in-out infinite;
}

.constellation-1::after {
    content: '';
    position: absolute;
    top: 50px;
    left: 20px;
    width: 80px;
    height: 1px;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(30deg);
    animation: constellation-glow 4s ease-in-out infinite 1s;
}

.constellation-2 {
    top: 70%;
    right: 15%;
    width: 120px;
    height: 80px;
}

.constellation-2::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 40px;
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: constellation-glow 5s ease-in-out infinite;
}

.constellation-2::after {
    content: '';
    position: absolute;
    top: 40px;
    left: 10px;
    width: 70px;
    height: 1px;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(-20deg);
    animation: constellation-glow 5s ease-in-out infinite 2s;
}

@keyframes constellation-glow {
    0%, 100% {
        opacity: 0.1;
        transform: scaleX(0.8);
    }
    50% {
        opacity: 0.6;
        transform: scaleX(1.1);
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #121212;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-in-out;
}

.loader {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 5px solid #3498db;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Header */
header {
    /* Constrain header width so it doesn't span the full viewport */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.95) 0%, rgba(26, 26, 46, 0.9) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    z-index: 10;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 1100px; /* limit width */
    width: calc(100% - 120px); /* give some side breathing room */
    margin: 20px auto 0; /* center the header horizontally and add top spacing */
    border-radius: 14px; /* rounded corners to look neat when narrower */
}

.logo {
    display: flex;
    align-items: center;
}

.logo i {
    font-size: 24px;
    color: #3498db;
    margin-right: 10px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
}

.search-container {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 25px;
    padding: 8px 20px;
    width: 300px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 
        0 4px 20px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

#search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    width: 100%;
    outline: none;
}

#search-button {
    background: transparent;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 16px;
}

/* Main Content */
main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#globe-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Controls */
.controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.95) 0%, rgba(26, 26, 46, 0.9) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 25px;
    padding: 12px;
    z-index: 5;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.controls button {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.controls button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.drag-mode-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-right: 15px;
    min-width: 120px;
    justify-content: center;
}

.drag-mode-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.drag-mode-btn.active {
    background-color: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
    color: #667eea;
}

.drag-mode-btn i {
    font-size: 16px;
}

.drag-mode-text {
    font-weight: 600;
    white-space: nowrap;
}

/* GPS and Control Buttons */
.gps-btn, .control-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 16px;
}

.gps-btn {
    width: auto;
    padding: 8px 15px;
    border-radius: 20px;
    gap: 8px;
}

.gps-btn span {
    font-size: 14px;
    font-weight: 600;
}

.control-btn:hover, .gps-btn:hover {
    background-color: rgba(102, 126, 234, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:disabled, .gps-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Light Theme */
body.light-theme {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 50%, #667eea 100%);
    color: #333;
}

body.light-theme::before {
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.05) 0%, transparent 50%);
}

body.light-theme header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 247, 250, 0.8) 100%);
    color: #333;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

body.light-theme .info-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 247, 250, 0.8) 100%);
    color: #333;
}

body.light-theme .controls {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 247, 250, 0.8) 100%);
    border: 1px solid rgba(135, 206, 235, 0.3);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .controls button {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-theme .controls button:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .drag-mode-btn {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-theme #search-input {
    color: #333;
}

body.light-theme .close-modal {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-theme .close-modal:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Advanced Weather Styles */
.advanced-weather {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.forecast-section, .air-quality-section, .clothing-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.forecast-section h4, .air-quality-section h4, .clothing-section h4 {
    margin: 0 0 15px 0;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.clothing-category {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.clothing-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.clothing-category strong {
    color: #667eea;
    margin-right: 8px;
}

.forecast-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.forecast-day {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.forecast-day:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.day-name {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.forecast-icon {
    font-size: 24px;
    color: #667eea;
    margin: 8px 0;
}

.temp-range {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.humidity {
    font-size: 11px;
    color: #999;
}

.air-quality-grid {
    display: grid;
    /* force two columns on wider screens for a balanced layout */
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
}

.aqi-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.aqi-label {
    display: block;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.aqi-value {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

/* Astronomical Data Styles */
.astronomy-grid {
    display: grid;
    /* two-column layout by default */
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 20px;
}

/* Generic two-column fallback for other info sections */
.info-section .info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 16px;
}

.astro-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.astro-section h5 {
    margin: 0 0 12px 0;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.astro-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.astro-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.astro-label {
    font-size: 12px;
    color: #999;
}

.astro-value {
    font-size: 12px;
    font-weight: 600;
    color: white;
    font-family: 'Courier New', monospace;
}

.moon-phase {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.moon-emoji {
    font-size: 24px;
}

.moon-name {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.toggle-container span {
    font-size: 14px;
    margin: 0 8px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2c3e50;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #3498db;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    .search-container {
        width: 100%;
    }
    
    .info-panel {
        width: 100%;
        top: auto;
        right: 0;
        bottom: 0;
        transform: translateY(100%);
        border-radius: 20px 20px 0 0;
        max-height: 70vh;
    }
    
    .info-panel.active {
        transform: translateY(0);
    }
    
    .controls {
        bottom: 70px;
        flex-wrap: wrap;
        padding: 8px;
    }
    
    .controls button {
        width: 35px;
        height: 35px;
        margin: 2px;
        font-size: 14px;
    }
    
    .toggle-container {
        margin-left: 5px;
    }
    
    .drag-mode-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 100px;
        margin-right: 10px;
    }
    
    .details-button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .button-content span {
        display: none;
    }
    
    .modal-content {
        width: 95vw;
        height: 90vh;
        border-radius: 15px;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 20px;
    }
    
    .modal-right {
        padding: 20px;
        max-height: none;
    }
    
    #mini-globe {
        width: 150px;
        height: 150px;
    }
    
    .weather-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .time-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .toggle-container {
        margin-left: 0;
    }
    
    .drag-mode-btn {
        margin-right: 0;
        margin-bottom: 10px;
        min-width: 80px;
        padding: 6px 10px;
    }
    
    .drag-mode-text {
        font-size: 11px;
    }
    
    .weather-details-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .temperature {
        font-size: 28px;
    }
    
    .weather-main .weather-icon {
        font-size: 36px;
    }
}

/* Details Button Styling */
.details-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 30px;
    padding: 14px 24px;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    backdrop-filter: blur(20px) saturate(180%);
    position: relative;
    overflow: hidden;
}

.details-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;
}

.details-button:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

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

.details-button:active {
    transform: translateY(0) scale(0.98);
}

.button-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.button-content i {
    font-size: 16px;
}

.button-content span {
    white-space: nowrap;
}

/* Detailed Modal Styling */
.detailed-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: linear-gradient(145deg, #1e1e1e 0%, #2d2d2d 100%);
    border-radius: 20px;
    width: 88vw;
    max-width: 860px;
    height: 80vh;
    max-height: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    display: flex;
    height: calc(100% - 80px);
    overflow: hidden;
}

.modal-left {
    width: 280px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-right {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.5) transparent;
}

.modal-right::-webkit-scrollbar {
    width: 6px;
}

.modal-right::-webkit-scrollbar-track {
    background: transparent;
}

.modal-right::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.mini-globe-container {
    text-align: center;
    margin-bottom: 20px;
}

#mini-globe {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.coordinates-display {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.coordinates-display p {
    margin: 0;
    color: #667eea;
    font-weight: 600;
    font-size: 16px;
}

.coordinates-display i {
    margin-right: 8px;
    color: #ff3333;
}

.info-section {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-section h3 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section h3 i {
    font-size: 20px;
}

.loading {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #999;
    padding: 20px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.current-weather {
    color: white;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.weather-main .weather-icon {
    font-size: 48px;
    color: #667eea;
}

.temp-info {
    display: flex;
    flex-direction: column;
}

.temperature {
    font-size: 36px;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.feels-like {
    font-size: 14px;
    color: #999;
    margin-top: 5px;
}

.weather-description {
    font-size: 18px;
    color: #ccc;
    text-transform: capitalize;
    margin-bottom: 20px;
    font-style: italic;
}

.weather-details-grid {
    display: grid;
    /* Default to two columns for clearer layout on desktop */
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 18px;
    align-items: start;
}

.detail-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.detail-item i {
    font-size: 20px;
    color: #667eea;
    margin-bottom: 8px;
}

.detail-item .label {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

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

.local-time, .utc-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 120px;
}

.time-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.time-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    font-family: 'Courier New', monospace;
    margin-bottom: 5px;
}

.timezone-info {
    font-size: 11px;
    color: #999;
    background: rgba(102, 126, 234, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.date-info {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.current-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 25px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.date-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.date-value {
    font-size: 16px;
    font-weight: 600;
    color: #ccc;
    text-align: center;
    line-height: 1.3;
}

/* Countries modal and sidebar */
.countries-modal .modal-content {
    max-width: 1100px;
    width: 92vw;
    height: 84vh;
}

.countries-modal .modal-body {
    display: flex;
    gap: 16px;
}

.countries-sidebar {
    width: 360px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.country-search {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 10px;
    background: transparent;
    color: inherit;
    outline: none;
}

.countries-list {
    overflow-y: auto;
    padding-right: 6px;
}

.countries-list::-webkit-scrollbar { width: 8px; }
.countries-list::-webkit-scrollbar-thumb { background: rgba(102,126,234,0.4); border-radius: 4px; }

.country-item {
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
}

.country-head { display:flex; align-items:center; gap:10px; cursor:pointer; }
.country-flag { width: 34px; height: 22px; object-fit: cover; border-radius:3px; }
.country-name { font-weight:600; }
.expand-btn { margin-left:auto; background:transparent; border:none; color:inherit; cursor:pointer; }
.country-details { margin-top:8px; font-size:13px; color:#ccc; }
.country-details p { margin:6px 0; }
.countries-main { flex:1; overflow:auto; padding: 14px; background: rgba(255,255,255,0.01); border-radius:8px; border:1px solid rgba(255,255,255,0.03); }

/* Responsive: sidebar collapses on small screens */
@media (max-width: 900px) {
    .countries-sidebar { width: 44%; }
    .countries-modal .modal-content { width: 96vw; max-width: 920px; }
}

@media (max-width: 600px) {
    .countries-modal .modal-body { flex-direction: column; }
    .countries-sidebar { width: 100%; }
}

/* Floating 'View All Countries' button */
.view-countries-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.view-countries-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.45); }

.view-countries-btn i { font-size: 18px; }

.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

/* Animation for markers and UI elements */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

.marker {
    animation: pulse 2s infinite;
}

/* Weather Icons */
.weather-icon {
    font-size: 36px;
    margin-right: 10px;
    vertical-align: middle;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.4));
}

/* Day/Night Mode Transition */
.day-mode {
    transition: background-color 1s ease;
}

.night-mode {
    transition: background-color 1s ease;
}

/* Weather Prediction Panel */
.prediction-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: none;
    max-height: 90vh;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.prediction-header h3 {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-prediction-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-prediction-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.prediction-content {
    padding: 25px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.prediction-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.prediction-controls select {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 0.9rem;
    min-width: 120px;
}

.prediction-controls select option {
    background: #1a1a2e;
    color: #ffffff;
    padding: 8px;
}

.prediction-controls select:focus {
    outline: none;
    border-color: #8a2be2;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.generate-prediction-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #8a2be2, #1e90ff);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.generate-prediction-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
}

.generate-prediction-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.prediction-placeholder {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px 20px;
}

.loading {
    text-align: center;
    color: #8a2be2;
    font-weight: 500;
}

.error {
    text-align: center;
    color: #ef4444;
    font-weight: 500;
}

.prediction-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.prediction-summary h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
}

.weather-distribution {
    margin-bottom: 25px;
}

.weather-distribution h5 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.weather-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weather-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.weather-label {
    min-width: 120px;
    font-size: 0.9rem;
    color: #ffffff;
}

.bar-container {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, #1e90ff);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.percentage {
    min-width: 45px;
    text-align: right;
    font-size: 0.8rem;
    color: #888;
}

.daily-forecast {
    margin-bottom: 20px;
}

.daily-forecast h5 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.forecast-day {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.forecast-day:hover {
    background: rgba(255, 255, 255, 0.08);
}

.day-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
}

.weather {
    color: #888;
    font-size: 0.8rem;
}

.temp-info {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: right;
}

.temp-max {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 0.9rem;
}

.temp-min {
    color: #4ecdc4;
    font-weight: 600;
    font-size: 0.9rem;
}

.precip {
    color: #74b9ff;
    font-size: 0.8rem;
}

/* Charts Section */
.charts-section {
    margin-bottom: 25px;
}

.charts-section h5 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

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

.chart-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    min-height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .prediction-panel {
        width: 95%;
        max-height: 95vh;
        top: 45%;
        transform: translate(-50%, -45%);
    }
    
    .prediction-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .prediction-controls select {
        width: 100%;
        min-width: unset;
    }
    
    .generate-prediction-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .forecast-day {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .temp-info {
        align-self: flex-end;
    }
    
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .chart-container {
        min-height: 250px !important;
    }
}

@media (max-width: 480px) {
    .prediction-panel {
        width: 98%;
        max-height: 98vh;
        top: 40%;
        transform: translate(-50%, -40%);
        border-radius: 15px;
    }
    
    .prediction-header h3 {
        font-size: 1.2rem;
    }
    
    .prediction-content {
        padding: 20px 15px;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        min-height: 200px !important;
        padding: 10px;
    }
}