@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-color: #f1f5f9;
    --text-color: #1e293b;
    --text-muted: #64748b;

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);

    --input-bg: rgba(255, 255, 255, 0.5);
    --btn-bg: rgba(255, 255, 255, 0.85);
    --btn-hover: #ffffff;

    --blob-1: #ffb6ff;
    --blob-2: #b6ffff;
    --blob-3: #ffd1b6;
}

body.dark {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;

    --glass-bg: rgba(30, 41, 59, 0.55);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);

    --input-bg: rgba(0, 0, 0, 0.25);
    --btn-bg: rgba(51, 65, 85, 0.85);
    --btn-hover: rgba(71, 85, 105, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none
}

body {
    height: 100vh;
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    position: relative;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s ease
}

.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.7;
    animation: float 20s infinite ease-in-out alternate;
    border-radius: 50%
}

.blob-1 {
    width: 45vw;
    height: 45vw;
    background: var(--blob-1);
    top: -10%;
    left: -10%;
    animation-delay: 0s
}

.blob-2 {
    width: 40vw;
    height: 40vw;
    background: var(--blob-2);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s
}

.blob-3 {
    width: 35vw;
    height: 35vw;
    background: var(--blob-3);
    top: 40%;
    left: 40%;
    animation-delay: -10s
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0)
    }

    50% {
        transform: translate(10vw, 5vw) scale(1.1) rotate(180deg)
    }

    100% {
        transform: translate(-5vw, 15vw) scale(0.9) rotate(360deg)
    }
}

.weather-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    pointer-events: none;
    animation: fall-rain linear infinite
}

@keyframes fall-rain {
    0% {
        transform: translateY(-100px)
    }

    100% {
        transform: translateY(110vh)
    }
}

.snow-flake {
    position: absolute;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(1px);
    opacity: 0.8;
    animation: fall-snow linear infinite
}

@keyframes fall-snow {
    0% {
        transform: translateY(-20px) translateX(0)
    }

    100% {
        transform: translateY(110vh) translateX(40px)
    }
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 1
}

.central-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    width: 480px;
    max-width: 95vw;
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1)
}

.central-card.expanded {
    width: 95vw;
    max-width: 1400px
}

header {
    text-align: center
}

.title {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-color), var(--text-muted));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px
}

.search-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto
}

.search-area .row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0.8rem;
    width: 100%;
    flex-wrap: wrap
}

input[type="text"] {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02)
}

input[type="text"]::placeholder {
    color: var(--text-muted)
}

input[type="text"]:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), inset 0 2px 4px rgba(0, 0, 0, 0.02);
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.7)
}

body.dark input[type="text"]:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.4)
}

button {
    padding: 1rem 1.8rem;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border: 1px solid var(--glass-border);
    background: var(--btn-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05)
}

button:hover {
    transform: translateY(-4px);
    background: var(--btn-hover);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1)
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1)
}

.hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.4rem;
    font-weight: 500
}

.input-wrapper {
    position: relative;
    flex: 1;
    min-width: 300px;
    max-width: 500px
}

.input-wrapper::before {
    content: '🔍';
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.6;
    z-index: 1
}

.autocomplete-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100
}

.autocomplete-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-weight: 500
}

body.dark .autocomplete-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03)
}

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.2)
}

body.dark .autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.1)
}

.autocomplete-item:last-child {
    border-bottom: none
}

.disaster-panel .risk-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem
}

.risk-low {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3)
}

.risk-moderate {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3)
}

.risk-high {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3)
}

.safety-btn {
    width: 100%;
    margin-top: 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    text-transform: none;
    letter-spacing: 0.5px;
    padding: 0.8rem 1rem;
    font-size: 0.95rem
}

.safety-btn:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px)
}

.safety-tips {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted)
}

.loading {
    text-align: center;
    padding: 3rem;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--text-color);
    animation: pulse 1.5s infinite alternate
}

@keyframes pulse {
    from {
        opacity: 0.4;
        transform: scale(0.98)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

.hidden {
    display: none !important
}

.result-area {
    display: flex;
    flex-direction: column;
    width: 100%
}

.result-panels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas: "weather country time currency" "weather country travel travel" "weather wiki wiki disaster" "hourly hourly hourly hourly" "chart chart chart chart";
    grid-auto-rows: min-content;
    align-content: start;
    gap: 1.5rem;
    width: 100%;
    margin-top: 0.5rem
}

#countryInfo {
    grid-area: country
}

#weatherInfo {
    grid-area: weather
}

#timePanel {
    grid-area: time
}

#currencyPanel {
    grid-area: currency
}

#wikiPanel {
    grid-area: wiki
}

#travelPanel {
    grid-area: travel
}

#disasterPanel {
    grid-area: disaster
}

#hourlyPanel {
    grid-area: hourly
}

#chartPanel {
    grid-area: chart
}

.hourly-carousel {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 0.5rem;
    scroll-behavior: smooth
}

.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 16px;
    min-width: 90px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border)
}

body.dark .hourly-item {
    background: rgba(0, 0, 0, 0.2)
}

.hourly-item img {
    width: 50px
}

.hourly-item .time {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem
}

.hourly-item .temp {
    font-size: 1.2rem;
    font-weight: 600
}

.chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px
}

.info-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: 180px
}

.info-panel:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15)
}

.info-panel h2 {
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    font-weight: 800;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03)
}

body.dark .info-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03)
}

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

.info-item span.label {
    font-weight: 600;
    color: var(--text-muted)
}

.info-item span.value {
    font-weight: 600;
    text-align: right
}

.bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: -2.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 1.5rem -2.5rem -2.5rem -2.5rem;
    padding: 1.5rem 2.5rem;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 1rem;
    z-index: 20
}

.switch-container {
    display: flex;
    gap: 1.5rem
}

#darkModeSwitch,
#tempUnitSwitch {
    width: 68px;
    height: 36px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 4px;
    transition: all 0.4s ease;
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05)
}

body.dark #darkModeSwitch,
body.dark #tempUnitSwitch {
    background: rgba(255, 255, 255, 0.08)
}

#darkModeSwitch .slider,
#tempUnitSwitch .slider {
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    user-select: none;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15)
}

body.dark #darkModeSwitch .slider,
body.dark #tempUnitSwitch .slider {
    background: #1e293b;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4)
}

body.dark #darkModeSwitch .slider {
    transform: translateX(32px)
}

#tempUnitSwitch.active .slider {
    transform: translateX(32px)
}

.footer {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600
}

@media (max-width:1200px) {
    .result-panels {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas: "weather country" "weather time" "weather currency" "travel travel" "wiki wiki" "disaster disaster" "hourly hourly" "chart chart";
        min-width: 100%
    }
}

@media (max-width:768px) {
    .result-panels {
        grid-template-columns: 1fr;
        grid-template-areas: "weather" "country" "time" "currency" "travel" "wiki" "disaster" "hourly" "chart"
    }

    body {
        overflow: auto
    }

    .central-card {
        max-height: none
    }

    .info-panel {
        height: auto;
        max-height: 50vh
    }

    .blob {
        filter: blur(50px)
    }

    .blob-1,
    .blob-2,
    .blob-3 {
        width: 70vw;
        height: 70vw
    }

    .central-card {
        padding: 2rem 1.5rem
    }

    .title {
        font-size: 2rem
    }
}