/* ===== 기본 스타일 ===== */
body {
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    overflow-x: hidden;
}

/* ===== 레이아웃 컨테이너 ===== */
.container {
    display: flex;
    height: calc(100vh - 60px); /* 헤더 높이만큼 제외 */
    padding: 10px;
    gap: 10px;
}

.today-section {
    flex: 0 0 65%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.future-section {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
}

/* ===== 헤더 스타일 ===== */
.header {
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== 공통 컨테이너 스타일 ===== */
.weather-container, .news-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 15px;
    overflow: hidden;
}

/* ===== 오늘 날씨 섹션 ===== */
#today-weather {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* ===== 뉴스 컨테이너 ===== */
.news-container {
    height: 40%;
    flex-shrink: 0;
    overflow-y: auto;
}

.news-container h2 {
    margin-top: 0;
    font-size: 1.5em;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

/* ===== 미래 날씨 섹션 ===== */
#future-weather {
    height: 100%;
    overflow-y: auto;
}

/* ===== 날짜 그룹 ===== */
.date-group {
    margin-bottom: 15px;
}

.date-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #1976d2;
}

/* 오늘 날씨 그리드 */
#today-weather .weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding-right: 10px; /* 스크롤바 공간 */
}

/* 미래 날씨 그리드 */
#future-weather .weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.grid-full-width {
    grid-column: 1 / -1;
    margin-bottom: 5px;
}

#today-weather .date-title {
    margin-bottom: 5px;
}

/* ===== 날씨 아이템 ===== */
.weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.weather:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 오늘 날씨 아이템 */
#today-weather .weather {
    padding: 15px;
}

/* ===== 날씨 상태(이모지) ===== */
.sky-status {
    font-family: 'Noto Color Emoji', sans-serif;
}

#today-weather .sky-status {
    font-size: 48px;
    margin: 10px 0;
}

#future-weather .sky-status {
    font-size: 32px;
    margin: 5px 0;
}

/* ===== 온도 ===== */
.temp {
    font-weight: bold;
    font-size: 1.5em;
}

#today-weather .temp {
    font-size: 2em;
}

#future-weather .temp {
    font-size: 1.2em;
}

/* ===== 뉴스 항목 스타일 ===== */
.news-item {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}

.news-item h4 a {
    text-decoration: none;
    color: #333;
}

.news-item h4 a:hover {
    color: #1976d2;
}

.news-item p {
    margin: 0;
    font-size: 0.9em;
    color: #555;
}

/* ===== 기타 정보 ===== */
.rain-chance, .time, .humidity {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
}

#today-weather .rain-chance, #today-weather .time {
    font-size: 0.8em;
}

#future-weather .rain-chance, #future-weather .time {
    font-size: 0.8em;
    color: #777;
}

/* ===== 스크롤바 스타일 ===== */
#today-weather .weather-grid::-webkit-scrollbar, 
#future-weather::-webkit-scrollbar, 
.news-container::-webkit-scrollbar {
    width: 8px;
}

#today-weather .weather-grid::-webkit-scrollbar-track, 
#future-weather::-webkit-scrollbar-track, 
.news-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#today-weather .weather-grid::-webkit-scrollbar-thumb, 
#future-weather::-webkit-scrollbar-thumb, 
.news-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

#today-weather .weather-grid::-webkit-scrollbar-thumb:hover, 
#future-weather::-webkit-scrollbar-thumb:hover, 
.news-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ===== 모달 스타일 (기존과 유사) ===== */
.modal { display: none; position: fixed; z-index: 1; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.3s; }
.modal.show { display: block; opacity: 1; }
.modal-content { background-color: #fff; margin: 15% auto; padding: 25px; border-radius: 10px; width: 90%; max-width: 450px; text-align: center; transform: translateY(-50px); opacity: 0; transition: all 0.3s; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.modal.show .modal-content { transform: translateY(0); opacity: 1; }
.close { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; } 
.close:hover { color: #333; }
.modal button { background-color: #1976d2; color: white; padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; margin-top: 15px; transition: background-color 0.2s; }
.modal button:hover { background-color: #135a9e; }

/* Dark Mode css코드 */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .header,
body.dark-mode .weather-container,
body.dark-mode .news-container {
    background: #1e1e1e;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

body.dark-mode h2,
body.dark-mode h3,
body.dark-mode .news-item h4 a {
    color: #f5f5f5;
}

body.dark-mode .news-item h4 a:hover {
    color: #4dabf7;
}

body.dark-mode .news-container h2 {
    border-bottom-color: #333;
}

body.dark-mode .weather {
    background: #2a2a2a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

body.dark-mode .rain-chance,
body.dark-mode .time,
body.dark-mode .humidity,
body.dark-mode .news-item p,
body.dark-mode .close {
    color: #aaa;
}

body.dark-mode .close:hover {
    color: #f1f1f1;
}

body.dark-mode .news-item {
    border-bottom-color: #333;
}

body.dark-mode .date-title {
    color: #4dabf7;
}

/* 다크 모드 모달 */
body.dark-mode .modal-content {
    background-color: #2a2a2a;
}

/* 다크 모드 스크롤바 */
body.dark-mode #today-weather .weather-grid::-webkit-scrollbar-track,
body.dark-mode #future-weather::-webkit-scrollbar-track,
body.dark-mode .news-container::-webkit-scrollbar-track {
    background: #2a2a2a;
}

body.dark-mode #today-weather .weather-grid::-webkit-scrollbar-thumb,
body.dark-mode #future-weather::-webkit-scrollbar-thumb,
body.dark-mode .news-container::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-mode #today-weather .weather-grid::-webkit-scrollbar-thumb:hover,
body.dark-mode #future-weather::-webkit-scrollbar-thumb:hover,
body.dark-mode .news-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}