* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: system-ui, sans-serif; 
    -webkit-tap-highlight-color: transparent;
}

body { 
    background-color: #E8ECEC; 
    display: block; 
    min-height: 100vh; 
}

body.dark-theme {
    background-color: #18181b;
}

.hidden { 
    display: none !important; 
}

.app {
    width: 100%; 
    max-width: 100%; 
    min-height: 100vh;
    height: auto;
    background-color: #F4F5F6; 
    border-radius: 0; 
    border: none; 
    box-shadow: none; 
    position: relative; 
    padding: 24px 32px 90px 32px;
    display: flex; 
    flex-direction: column; 
}

body.dark-theme .app {
    background-color: #0f0f11;
}

.screen { 
    flex-grow: 1; 
    overflow-y: auto; 
    scrollbar-width: none; 
}

.screen::-webkit-scrollbar { 
    display: none; 
}

.screen:not(.hidden) {
    animation: slideInFade 0.3s ease-out forwards;
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff4757;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    z-index: 9999;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.top-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    flex-shrink: 0; 
}

.top-bar h1 { 
    color: #1DA1B5; 
    font-size: 22px; 
}

body.dark-theme .top-bar h1 {
    color: #22d3ee;
}

.menu-container { 
    position: relative; 
}

.settings-btn { 
    background-color: #E8ECEC; 
    border: none; 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    color: #333333; 
}

body.dark-theme .settings-btn {
    background-color: #27272a;
    color: #f4f4f5;
}

.popup-menu { 
    position: absolute; 
    top: 100%; 
    margin-top: 6px; 
    background-color: #F9FBFB; 
    border: 1px solid #D1E6E1; 
    border-radius: 12px; 
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.15); 
    width: 165px; 
    z-index: 200; 
    overflow: hidden; 
}

body.dark-theme .popup-menu {
    background-color: #18181b;
    border-color: #27272a;
}

#settings-menu {
    right: 0;
    left: auto;
}

#forecast-dropdown {
    left: 0;
    right: auto;
}

.popup-item, .drop-item { 
    width: 100%; 
    padding: 10px 14px; 
    background: none; 
    border: none; 
    text-align: left; 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    color: #333333; 
}

body.dark-theme .popup-item,
body.dark-theme .drop-item {
    color: #f4f4f5;
}

.popup-item:hover, .drop-item:hover, .drop-item.active { 
    background-color: #E8ECEC; 
    color: #1DA1B5; 
}

body.dark-theme .popup-item:hover,
body.dark-theme .drop-item:hover,
body.dark-theme .drop-item.active {
    background-color: #27272a;
    color: #22d3ee;
}

.search { 
    display: flex; 
    background-color: #E8ECEC; 
    border-radius: 16px; 
    padding: 10px 16px; 
    margin-bottom: 20px; 
    align-items: center; 
    flex-shrink: 0; 
}

body.dark-theme .search {
    background-color: #27272a;
}

.search input { 
    border: none; 
    background: transparent; 
    outline: none; 
    width: 100%; 
    font-size: 14px; 
    color: #333333; 
    font-weight: 600; 
}

body.dark-theme .search input {
    color: #f4f4f5;
}

.search input::placeholder { 
    color: #777777; 
}

body.dark-theme .search input::placeholder {
    color: #a1a1aa;
}

.search button { 
    background: none; 
    border: none; 
    color: #1DA1B5; 
    cursor: pointer; 
    padding-left: 8px; 
}

body.dark-theme .search button {
    color: #22d3ee;
}

.main-weather { 
    background-color: #5BA6F5; 
    border-radius: 20px; 
    padding: 16px; 
    margin-bottom: 16px; 
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    user-select: none;
}

body.dark-theme .main-weather {
    background-color: #1E40AF;
}

.location-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px; 
}

.location-row p { 
    font-size: 12px; 
    font-weight: 700; 
    text-transform: uppercase; 
    color: #333333; 
}

body.dark-theme .location-row p {
    color: #f4f4f5;
}

.star { 
    background: none; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
    color: #777777; 
    line-height: 1; 
}

body.dark-theme .star {
    color: #a1a1aa;
}

.star.active { 
    color: #EFC319; 
}

body.dark-theme .star.active {
    color: #facc15;
}

.temp-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

#temp { 
    font-size: 64px; 
    font-weight: 900; 
    letter-spacing: -2px; 
    line-height: 1; 
    color: #333333; 
}

body.dark-theme #temp {
    color: #f4f4f5;
}

#desc { 
    font-size: 15px; 
    color: #555555; 
    margin-top: 6px; 
    text-transform: capitalize; 
    font-weight: 500; 
}

body.dark-theme #desc {
    color: #a1a1aa;
}

.big-icon { 
    width: 70px; 
    height: 70px; 
}

.expand-hint {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #333333;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

body.dark-theme .expand-hint {
    color: #93C5FD;
}

.extra-metrics {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    animation: fadeInMetrics 0.3s ease;
}

body.dark-theme .extra-metrics {
    border-top-color: rgba(255, 255, 255, 0.15);
}

.extra-metric-item {
    display: flex;
    flex-direction: column;
}

.extra-metric-item small {
    font-size: 10px;
    font-weight: 600;
    color: #333333;
    text-transform: uppercase;
}

body.dark-theme .extra-metric-item small {
    color: #93C5FD;
}

.extra-metric-item .metric-val {
    font-size: 14px;
    font-weight: 700;
    color: #111111;
    margin-top: 2px;
}

body.dark-theme .extra-metric-item .metric-val {
    color: #FFFFFF;
}

.forecast { 
    margin-bottom: 15px; 
    position: relative; 
    z-index: 10;
}

.menu-box { 
    margin-bottom: 12px; 
    position: relative; 
    display: inline-block; 
}

#forecast-dropdown-btn { 
    background-color: #E8ECEC; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: bold; 
    color: #1DA1B5; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    cursor: pointer; 
}

body.dark-theme #forecast-dropdown-btn {
    background-color: #27272a;
    color: #22d3ee;
}

.forecast-nav-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.forecast-data { 
    flex-grow: 1;
    min-width: 0;
    margin-top: 6px;
    min-height: 110px; 
    position: relative;
    z-index: 1;
}

.scroll-arrow {
    background-color: #FFFFFF;
    border: 1px solid #D1E6E1;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #1DA1B5;
    box-shadow: 0px 2px 6px rgba(0,0,0,0.06);
    flex-shrink: 0;
    transition: background-color 0.2s;
}

body.dark-theme .scroll-arrow {
    background-color: #27272a;
    border-color: #27272a;
    color: #22d3ee;
}

.scroll-arrow:hover {
    background-color: #F4F6F6;
}

body.dark-theme .scroll-arrow:hover {
    background-color: #3f3f46;
}

.hour-scroll { 
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    scrollbar-width: none; 
}

.hour-scroll::-webkit-scrollbar { 
    display: none; 
}

.hour-item { 
    flex-shrink: 0;
    background-color: #F9FBFB; 
    min-width: 65px; 
    height: 82px; 
    border-radius: 12px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: space-between; 
    padding: 8px 6px; 
    border: 1px solid #E2E8F0;
    transition: background-color 0.2s, border-color 0.2s;
}

body.dark-theme .hour-item {
    background-color: #18181b;
    border-color: #27272a;
}

.hour-item.active { 
    background-color: #5BA6F5; 
    border-color: #3B82F6;
}

body.dark-theme .hour-item.active {
    background-color: #1e293b;
    border-color: #22d3ee;
}

.hour-item p { 
    font-size: 13px; 
    font-weight: 600; 
    color: #333333; 
}

body.dark-theme .hour-item p {
    color: #f4f4f5;
}

.hour-item .hour-temp { 
    font-size: 15px; 
    font-weight: 700; 
    color: #333333; 
}

body.dark-theme .hour-item .hour-temp {
    color: #f4f4f5;
}

.day-item { 
    background-color: #F9FBFB; 
    padding: 10px 14px; 
    border-radius: 10px; 
    display: flex; 
    justify-content: space-between; 
    font-size: 13px; 
    font-weight: 600; 
    color: #333333; 
    margin-bottom: 6px; 
}

body.dark-theme .day-item {
    background-color: #18181b;
    color: #f4f4f5;
}

.details { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}

.detail-box { 
    background-color: #F9FBFB; 
    border-radius: 14px; 
    padding: 12px; 
}

body.dark-theme .detail-box {
    background-color: #18181b;
}

.small-icon { 
    background-color: #E8ECEC; 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 8px; 
    color: #1DA1B5; 
}

body.dark-theme .small-icon {
    background-color: #27272a;
    color: #22d3ee;
}

.detail-box small { 
    font-size: 11px; 
    color: #777777; 
    display: block; 
}

body.dark-theme .detail-box small {
    color: #a1a1aa;
}

.detail-box .detail-val { 
    font-size: 18px; 
    font-weight: 900; 
    color: #333333; 
}

body.dark-theme .detail-box .detail-val {
    color: #f4f4f5;
}

.page-title { 
    color: #1DA1B5; 
    font-size: 18px; 
    margin-bottom: 15px; 
}

body.dark-theme .page-title {
    color: #22d3ee;
}

.saved-list { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.saved-item { 
    background-color: #F9FBFB; 
    padding: 14px; 
    border-radius: 12px; 
    font-weight: 600; 
    color: #333333; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
}

body.dark-theme .saved-item {
    background-color: #18181b;
    color: #f4f4f5;
}

.saved-item:hover { 
    background-color: #E8ECEC; 
}

body.dark-theme .saved-item:hover {
    background-color: #27272a;
}

.remove-btn {
    background: none;
    border: none;
    color: #777777;
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    margin-left: 10px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-theme .remove-btn {
    color: #a1a1aa;
}

.remove-btn:hover {
    color: #ff4757 !important;
}

.bottom-nav { 
    position: fixed; 
    bottom: 18px; 
    left: 18px; 
    right: 18px; 
    background-color: #16203D; 
    height: 58px; 
    border-radius: 29px; 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    z-index: 50; 
}

body.dark-theme .bottom-nav {
    background-color: #18181b;
}

.tab { 
    background: none; 
    border: none; 
    color: #7A859E; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 2px; 
    font-size: 9px; 
    font-weight: 700; 
    cursor: pointer; 
}

.tab svg { 
    opacity: 0.5; 
}

.tab.active { 
    color: #EFC319; 
}

body.dark-theme .tab.active {
    color: #facc15;
}

.tab.active svg { 
    opacity: 1; 
}

@keyframes fadeInMetrics {
    from { 
        opacity: 0; 
        transform: translateY(-6px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideInFade {
    from { 
        opacity: 0; 
        transform: translateY(12px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}