/*
 * 檔案用途：為每日任務簡報 (weather.html) 提供特定的樣式，模擬熱感應印表機的列印效果。
 * This file provides specific styles for the Daily Briefing (weather.html), simulating the printout of a thermal printer.
 */

/* 繼承自 style.css 的變數 */

.weather-container {
    width: 100%;
    max-width: 384px;
    /* 模擬 80mm 熱感應紙寬度 */
    margin: 0 auto 60px auto;
    padding: 20px;
    /* Glassmorphism 效果由 style.css 的 .container 控制 */
    font-family: 'Cutive Mono', 'monospace';
    color: var(--text-color);
    position: relative;
}

#settings-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--accent-color);
    padding: 5px;
    line-height: 1;
    transition: transform 0.3s ease;
}

#settings-btn:hover {
    color: var(--accent-dark);
    transform: rotate(90deg);
}

h1 {
    text-align: center;
    font-size: 1.2em;
    margin: 0 0 15px 0;
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 500;
    color: var(--accent-color);
}

/* --- 日期區塊 --- */
#date-info {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    font-family: 'Noto Sans TC', sans-serif;
}

.calendar-day {
    font-size: 4.5em;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    margin-right: 15px;
}

.calendar-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.4;
}

.calendar-weekday {
    font-size: 1.2em;
    font-weight: 500;
    color: var(--text-color);
}

.calendar-month-year {
    font-size: 1em;
    color: var(--text-color);
    opacity: 0.8;
}

.calendar-lunar {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.9;
    min-height: 1.2em;
}

#print-time {
    text-align: center;
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 5px;
    font-family: 'Noto Sans TC', sans-serif;
}

/* --- 分隔線 --- */
.separator {
    border-top: 1px dashed var(--border-color);
    margin: 15px 0;
}

.section-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--accent-color);
    font-family: 'Noto Sans TC', sans-serif;
}

/* --- 天氣區塊 --- */
.city-weather {
    margin-bottom: 15px;
}

.city-name {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 700;
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 10px;
}

.forecast-container {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.forecast-card {
    flex-basis: 45%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.5;
    background-color: rgba(255, 255, 255, 0.05);
}

.forecast-period {
    font-weight: 500;
    font-size: 0.9em;
}

.weather-icon {
    font-size: 2.2em;
    margin: 5px 0;
}

.temperature {
    font-size: 1.1em;
    font-weight: 700;
}

.rain-chance {
    font-size: 0.85em;
    color: #4facfe;
    /* 代表下雨的淺藍色 */
}

/* --- 農民曆區塊 --- */
#almanac-info {
    font-family: 'Noto Sans TC', sans-serif;
    min-height: 40px;
}

.almanac-item {
    line-height: 1.6;
}

.almanac-item span:first-child {
    display: inline-block;
    width: 2em;
    text-align: center;
    font-weight: 700;
    margin-right: 5px;
}

#almanac-good-for span:first-child {
    color: var(--success-color);
}

#almanac-bad-for span:first-child {
    color: var(--error-color);
}

/* --- 諺語區塊 --- */
#proverb-info {
    min-height: 50px;
}

.proverb {
    margin-bottom: 10px;
}

.explanation {
    font-style: italic;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9em;
}

.proverb-separator {
    border-top: 1px dashed var(--border-color);
    width: 80%;
    margin: 15px auto;
}

/* --- 按鈕區塊 --- */
.button-container {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

/* --- 設定 Modal --- */
#modal-overlay {
    display: none; /* 預設隱藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-color);
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 340px;
    z-index: 1001;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(var(--accent-color), 0.3);
}

#settings-modal h2 {
    margin-top: 0;
    color: var(--accent-color);
}

#locations-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 5px;
}

.location-label {
    display: block;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.location-label:hover {
    background-color: rgba(255,255,255,0.1);
}
.location-label input {
    margin-right: 8px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --- 列印專用樣式 --- */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        padding: 0;
        margin: 0;
    }

    body::before {
        display: none;
    }

    /* 隱藏所有不需要列印的元素 */
    .button-container,
    h1,
    #settings-btn,
    #modal-overlay,
    .footer,
    .menu-btn {
        display: none !important;
    }

    /* 調整列印容器樣式 */
    .weather-container {
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        color: #000;
        background: none;
        backdrop-filter: none;
        border: none;
        margin: 0;
    }

    /* 將所有彩色文字改為黑色 */
    .calendar-day,
    .rain-chance,
    #almanac-good-for span:first-child,
    #almanac-bad-for span:first-child,
    .section-title,
    h1,
    #settings-btn {
        color: #000 !important;
    }

    .calendar-month-year,
    .calendar-lunar,
    .calendar-weekday,
    #print-time,
    .explanation {
        color: #000 !important;
        opacity: 1;
    }
    
    .rain-chance {
        font-weight: bold; /* 讓降雨機率在黑白列印中更明顯 */
    }

    .separator,
    .proverb-separator,
    .forecast-card {
        border-color: #000;
    }

    .forecast-card {
        background: none;
    }
}