:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #fff;
    --text-dim: #a0a0a0;
    --accent: #4bc0c0;
    --input-bg: #333;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overscroll-behavior: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 15px;

    /* 手機版邊距稍微縮小 */
    box-sizing: border-box;
}

/* --- 新增：搜尋區塊樣式 --- */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    position: relative;
    z-index: 100;
}

#gps-btn {
    background: var(--card-bg);
    border: 1px solid #444;
    color: var(--accent);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

.input-wrapper {
    flex: 1;
    display: flex;
    background: var(--input-bg);
    border-radius: 8px;
    padding: 0 10px;
    align-items: center;
}

#city-search {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 12px 0;
    font-size: 1rem;
    outline: none;
}

#search-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
}

/* 搜尋結果下拉清單 */
#search-results {
    position: absolute;
    top: 50px;

    /* 搜尋框高度下方 */
    left: 0;
    right: 0;
    background: var(--card-bg);
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgb(0 0 0 / 50%);
    z-index: 101;
    max-height: 50vh;
    overflow-y: auto;
}

#search-results.hidden {
    display: none;
}

#search-results li {
    padding: 15px;
    border-bottom: 1px solid #333;
    cursor: pointer;
}

#search-results li:last-child {
    border-bottom: none;
}

#search-results li small {
    display: block;
    color: var(--text-dim);
    font-size: 0.8em;
}

/* --- 原有樣式 --- */
header {
    margin-bottom: 10px;
    text-align: center;
}

h1 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
}

#current-weather {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-top: 5px;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chart-wrapper {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 10px;
    position: relative;
    height: 55vh;
    width: 100%;
}

.info-card {
    margin-top: auto;
    text-align: center;
    font-size: 0.8rem;
    color: #555;
    padding-bottom: 10px;
}

/* --- Weekly Forecast Styles --- */
.weekly-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;

    /* Spacing before footer */
}

.weekly-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.day-col {
    display: flex;
    flex-direction: column;
    width: 60px;
}

.day-name {
    font-weight: 600;
}

.date-label {
    font-size: 0.75em;
    color: var(--text-dim);
}

.icon-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    color: #ffd700;


    /* Sunny yellow default, can override */
}

.icon-col .fa-sun {
    color: #ffd700;
}

.icon-col .fa-cloud-sun {
    color: #f0c330;
}

.icon-col .fa-cloud {
    color: #aaa;
}

.icon-col .fa-cloud-rain,
.icon-col .fa-umbrella {
    color: #4bc0c0;
}

.icon-col .fa-bolt {
    color: #ff6b6b;
}

.icon-col .fa-snowflake {
    color: #a0e6ff;
}

.status-text {
    font-size: 0.7em;
    color: var(--text-dim);
    margin-top: 2px;
}

.temp-col {
    width: 80px;
    text-align: center;
    font-weight: 500;
}

.max-temp {
    color: var(--text-main);
}

.min-temp {
    color: var(--text-dim);
    margin-left: 5px;
}

.rain-col {
    width: 60px;
    text-align: right;
    font-size: 0.85em;
    color: var(--accent);
}

/* --- Toast Notification Styles --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background-color: var(--card-bg);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
    font-size: 0.9rem;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    border-left: 4px solid var(--accent);
}

.toast-error {
    border-left-color: #ff6b6b;
}

.toast-warning {
    border-left-color: #ffd700;
}

.toast.fade-out {
    opacity: 0;
}

.icon-col .fa-smog {
    color: #aaa;
}
