/* ========================================
   기본 스타일
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 스크린 리더 전용 텍스트 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 포커스 스타일 개선 - 가시성 향상 */
*:focus {
    outline: 3px solid #FFD700;
    outline-offset: 3px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(180deg, #4A90E2 0%, #357ABD 50%, #1E5F99 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    position: relative;
    font-size: 18px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
}

/* 화면 크기별 최대 너비 제한 */
@media (min-width: 768px) {
    .container {
        max-width: 480px;
    }
}

/* ========================================
   헤더 영역
   ======================================== */

.header {
    text-align: center;
    padding: 100px 20px 24px;
    position: relative;
}

@media (min-width: 375px) {
    .header {
        padding: 100px 24px 24px;
    }
}

@media (min-width: 768px) {
    .header {
        padding: 100px 40px 32px;
    }
}

.location-name {
    font-size: 28px;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
    margin-top: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.weather-condition {
    font-size: 20px;
    color: rgba(255,255,255,0.95);
    margin-bottom: 40px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.weather-icon {
    font-size: 140px;
    margin: 30px 0;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

.current-temp {
    font-size: 108px;
    font-weight: 200;
    margin: 30px 0 15px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.2);
    letter-spacing: -2px;
}

.feels-like {
    font-size: 22px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
    font-weight: 500;
}

.temp-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 50px;
}

.temp-min, .temp-max {
    font-size: 26px;
    font-weight: 500;
}

.temp-bar {
    width: 140px;
    height: 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.temp-bar::after {
    content: '';
    position: absolute;
    left: 30%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 3px;
}

/* ========================================
   날씨 상세 정보
   ======================================== */

.weather-details {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    margin: 24px 16px;
    padding: 0;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

@media (min-width: 375px) {
    .weather-details {
        margin: 24px 20px;
    }
}

@media (min-width: 768px) {
    .weather-details {
        margin: 24px 40px;
    }
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid rgba(255,255,255,0.15);
    transition: background-color 0.2s ease;
    cursor: pointer;
    min-height: 80px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row:hover,
.detail-row:focus {
    background-color: rgba(255,255,255,0.15);
    transform: scale(1.01);
}

.detail-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-icon {
    font-size: 32px;
    width: 40px;
    text-align: center;
}

.detail-label {
    font-size: 20px;
    color: rgba(255,255,255,0.95);
    font-weight: 500;
}

.detail-value {
    font-size: 24px;
    font-weight: 600;
    color: white;
}

/* ========================================
   시간별 예보
   ======================================== */

.hourly-forecast {
    padding: 24px 16px;
}

@media (min-width: 375px) {
    .hourly-forecast {
        padding: 24px 20px;
    }
}

@media (min-width: 768px) {
    .hourly-forecast {
        padding: 24px 40px;
    }
}

.forecast-title {
    font-size: 22px;
    color: rgba(255,255,255,0.95);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.hourly-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.hourly-container::-webkit-scrollbar {
    display: none;
}

.hourly-item {
    min-width: 90px;
    max-width: 90px;
    text-align: center;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 16px 8px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.hourly-item:hover,
.hourly-item:focus {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.5);
}

.hourly-time {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1px;
    font-weight: 500;
    white-space: nowrap;
}

.hourly-icon {
    font-size: 22px;
    margin: 8px 0;
    line-height: 1;
}

.hourly-temp {
    font-size: 19px;
    font-weight: 600;
    color: white;
    margin: 4px 0;
}

.hourly-rain {
    font-size: 13px;
    color: rgba(135,206,250,0.95);
    margin-top: 4px;
    font-weight: 500;
    white-space: nowrap;
}

/* ========================================
   일별 예보
   ======================================== */

.daily-forecast {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    margin: 24px 16px 0;
    padding: 24px 0 0;
    border: 2px solid rgba(255,255,255,0.3);
    border-bottom: none;
}

@media (min-width: 375px) {
    .daily-forecast {
        margin: 24px 20px 0;
    }
}

@media (min-width: 768px) {
    .daily-forecast {
        margin: 24px 40px 0;
    }
}

.daily-item-wrapper {
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.daily-item-wrapper:last-child {
    border-bottom: none;
}

.daily-item-wrapper:last-child .daily-row {
    padding-bottom: 24px;
}

.daily-row {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 90px;
}

.daily-row:hover,
.daily-row:focus {
    background: rgba(255,255,255,0.15);
    transform: scale(1.01);
}

.daily-day {
    flex: 1;
    font-size: 20px;
    color: white;
    font-weight: 600;
}

.daily-date {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
    font-weight: 400;
}

.daily-icon {
    font-size: 40px;
    margin: 0 24px;
}

.daily-rain {
    font-size: 16px;
    color: rgba(135,206,250,0.95);
    margin-right: 20px;
    min-width: 50px;
    text-align: right;
    font-weight: 500;
}

.daily-temps {
    display: flex;
    gap: 12px;
    min-width: 100px;
    justify-content: flex-end;
    align-items: center;
}

.daily-high {
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.daily-low {
    font-size: 22px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.temp-range-bar {
    width: 70px;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    margin: 0 12px;
    position: relative;
    overflow: hidden;
}

.temp-range-bar::after {
    content: '';
    position: absolute;
    left: 30%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #4FC3F7, #FFD54F);
    border-radius: 3px;
}

.expand-arrow {
    margin-left: 12px;
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    transition: transform 0.3s ease;
}

.daily-row.expanded .expand-arrow {
    transform: rotate(180deg);
}

/* ========================================
   시간별 상세 정보 스타일
   ======================================== */

.hourly-details {
    display: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border-top: 2px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.hourly-details.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.time-toggle {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    justify-content: flex-end;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.time-toggle-btn {
    padding: 8px 20px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.time-toggle-btn.active {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.time-toggle-btn:active {
    transform: scale(0.95);
}

.hourly-details-container {
    padding: 8px 0;
}

.hourly-detail-item {
    display: grid;
    grid-template-columns: 90px 60px 1fr 75px;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.hourly-detail-item:active {
    background: rgba(255,255,255,0.05);
}

.hourly-detail-time {
    font-size: 16px;
    color: rgba(255,255,255,0.95);
    font-weight: 500;
    white-space: nowrap;
}

.hourly-detail-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hourly-detail-icon {
    font-size: 32px;
    line-height: 1;
}

.hourly-detail-rain {
    font-size: 13px;
    color: #87CEEB;
    font-weight: 600;
}

.temp-bar-container {
    position: relative;
    height: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
}

.temp-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
}

.temp-value {
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-align: center;
    padding: 6px 12px;
    border-radius: 20px;
    min-width: 65px;
    white-space: nowrap;
}

/* 온도별 색상 - 온도 값 배경 */
.temp-cold {
    background: linear-gradient(135deg, #4FC3F7 0%, #2196F3 100%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

.temp-cool {
    background: linear-gradient(135deg, #81D4FA 0%, #64B5F6 100%);
    box-shadow: 0 2px 8px rgba(100, 181, 246, 0.4);
}

.temp-mild {
    background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.temp-warm {
    background: linear-gradient(135deg, #FFA726 0%, #FF9800 100%);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

.temp-hot {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
    box-shadow: 0 2px 8px rgba(239, 83, 80, 0.4);
}

/* 온도별 색상 - 막대 그래프 */
.temp-bar-fill.temp-cold {
    background: linear-gradient(90deg, rgba(79, 195, 247, 0.7) 0%, rgba(33, 150, 243, 0.9) 100%);
}

.temp-bar-fill.temp-cool {
    background: linear-gradient(90deg, rgba(129, 212, 250, 0.7) 0%, rgba(100, 181, 246, 0.9) 100%);
}

.temp-bar-fill.temp-mild {
    background: linear-gradient(90deg, rgba(255, 213, 79, 0.7) 0%, rgba(255, 193, 7, 0.9) 100%);
}

.temp-bar-fill.temp-warm {
    background: linear-gradient(90deg, rgba(255, 167, 38, 0.7) 0%, rgba(255, 152, 0, 0.9) 100%);
}

.temp-bar-fill.temp-hot {
    background: linear-gradient(90deg, rgba(239, 83, 80, 0.7) 0%, rgba(229, 57, 53, 0.9) 100%);
}

/* ========================================
   메뉴 버튼
   ======================================== */

.menu-btn {
    position: absolute;
    top: 50px;
    left: 16px;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.4);
    color: white;
    border-radius: 16px;
    font-size: 32px;
    cursor: pointer;
    padding: 14px;
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

body:has(.location-selector.show) .menu-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) translateY(-10px);
}

@media (min-width: 375px) {
    .menu-btn {
        left: 20px;
    }
}

@media (min-width: 768px) {
    .menu-btn {
        left: 40px;
    }
}

.menu-btn:hover,
.menu-btn:focus {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.6);
}

/* ========================================
   헤더 컨트롤 - 가로 배치
   ======================================== */

.header-controls {
    position: absolute;
    top: 50px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (min-width: 375px) {
    .header-controls {
        right: 20px;
    }
}

@media (min-width: 768px) {
    .header-controls {
        right: 40px;
        gap: 12px;
    }
}

/* 메뉴가 열리면 위치/언어 버튼 숨김 */
.location-selector.show ~ .container .header-controls,
body:has(.location-selector.show) .header-controls {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* ========================================
   위치 및 언어 버튼
   ======================================== */

.location-btn-header, .language-btn, .share-btn {
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
    min-width: 52px;
    min-height: 52px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    font-weight: 600;
    white-space: nowrap;
    position: relative;
}

#locationIcon,
#languageIcon {
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.location-btn-header:hover,
.location-btn-header:focus,
.language-btn:hover,
.language-btn:focus,
.share-btn:hover,
.share-btn:focus {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.6);
}

.location-btn-header.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 텍스트 숨기기 */
#locationText,
#languageText {
    display: none;
}

/* 로딩 중 회전 애니메이션 */
.location-btn-header.loading #locationIcon {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   공유 버튼
   ======================================== */

.share-btn {
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
    min-width: 52px;
    min-height: 52px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.share-btn:hover,
.share-btn:focus {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.6);
}

/* ========================================
   위치 선택기
   ======================================== */

.location-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    padding: 80px 16px 24px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    color: #333;
    overflow-y: auto;
}

.selector-top-buttons {
    position: absolute;
    top: 24px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10002;
    height: 52px;
}

@media (min-width: 375px) {
    .selector-top-buttons {
        left: 20px;
        right: 20px;
    }
}

@media (min-width: 768px) {
    .selector-top-buttons {
        left: 40px;
        right: 40px;
    }
}

.selector-actions {
    display: flex;
    gap: 12px;
}

.selector-icon-btn {
    background: rgba(74, 144, 226, 0.1);
    border: 3px solid rgba(74, 144, 226, 0.3);
    color: #1E5F99;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
    min-width: 52px;
    min-height: 52px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selector-icon-btn:hover,
.selector-icon-btn:focus {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.5);
    transform: scale(1.05);
}

.selector-icon-btn:active {
    transform: scale(0.95);
}

.selector-icon-btn span {
    font-size: 24px;
    line-height: 1;
}

@media (min-width: 375px) {
    .location-selector {
        padding: 80px 20px 24px;
    }
}

@media (min-width: 768px) {
    .location-selector {
        padding: 80px 40px 40px;
    }
}

.location-selector.show {
    transform: translateY(0);
}

.close-btn {
    color: #666;
    background: rgba(255,255,255,0.9);
    border: 3px solid rgba(0,0,0,0.2);
    border-radius: 16px;
    font-size: 32px;
    cursor: pointer;
    padding: 10px;
    min-width: 52px;
    min-height: 52px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    z-index: 10001;
}

.close-btn:hover,
.close-btn:focus {
    background: white;
    transform: scale(1.05);
}

.location-selector h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1E5F99;
    margin-top: 70px;
    margin-bottom: 24px;
    padding-left: 0;
}

.search-container {
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 18px 24px;
    border: 3px solid #ddd;
    border-radius: 16px;
    font-size: 20px;
    background: white;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.city-btn {
    padding: 16px;
    border: 2px solid #ddd;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    text-align: left;
    min-height: 80px;
}

.city-btn:hover,
.city-btn:focus {
    border-color: #4A90E2;
    background: #f0f8ff;
    transform: scale(1.02);
}

.city-btn .city-name {
    font-size: 18px;
    font-weight: 600;
    color: #1E5F99;
    margin-bottom: 4px;
}

.city-btn .city-country {
    font-size: 14px;
    color: #666;
}

select {
    width: 100%;
    padding: 20px 24px;
    border: 3px solid #ddd;
    border-radius: 16px;
    font-size: 20px;
    background: white;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 20px;
    padding-right: 60px;
    min-height: 64px;
    font-weight: 500;
}

select:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

.select-wrapper {
    margin-top: 24px;
}

/* ========================================
   즐겨찾기 섹션
   ======================================== */

.favorites-section {
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 16px;
}

.favorites-section h3 {
    font-size: 20px;
    color: #1E5F99;
    margin-bottom: 12px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.favorite-item {
    position: relative;
}

.remove-favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.remove-favorite:hover {
    background: rgba(244, 67, 54, 1);
    transform: scale(1.1);
}

/* ========================================
   로딩 오버레이
   ======================================== */

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

#loadingMessage {
    font-size: 22px;
    font-weight: 600;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   상태 메시지
   ======================================== */

.status-message {
    position: fixed;
    top: 24px;
    left: 16px;
    right: 16px;
    text-align: center;
    padding: 20px;
    border-radius: 16px;
    background: rgba(74, 144, 226, 0.95);
    color: white;
    font-size: 18px;
    font-weight: 600;
    z-index: 1500;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@media (min-width: 375px) {
    .status-message {
        left: 20px;
        right: 20px;
    }
}

@media (min-width: 768px) {
    .status-message {
        left: auto;
        right: 40px;
        max-width: 400px;
    }
}

/* ========================================
   PWA 설치 버튼
   ======================================== */

.install-pwa {
    position: fixed;
    bottom: 24px;
    right: 16px;
    left: 16px;
    max-width: 200px;
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(20px);
    border: 3px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 14px 18px;
    border-radius: 30px;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@media (min-width: 375px) {
    .install-pwa {
        left: auto;
        right: 20px;
    }
}

@media (min-width: 768px) {
    .install-pwa {
        right: 40px;
    }
}

.install-pwa.show {
    display: flex;
}

.install-pwa:hover,
.install-pwa:focus {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* ========================================
   오프라인 표시
   ======================================== */

.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(244, 67, 54, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.offline-indicator::before {
    content: '📡';
    font-size: 16px;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* ========================================
   PWA 업데이트 배너
   ======================================== */

.pwa-update-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(74, 144, 226, 0.98);
    color: white;
    padding: 20px 24px;
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 1500;
    backdrop-filter: blur(10px);
    font-size: 18px;
    font-weight: 600;
}

.pwa-update-banner.show {
    display: flex;
}

.update-btn {
    background: rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.update-btn:hover,
.update-btn:focus {
    background: rgba(255,255,255,0.4);
    transform: scale(1.05);
}

/* ========================================
   Skip to content 링크
   ======================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4A90E2;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   성능 최적화
   ======================================== */

.hourly-item,
.daily-row,
.city-btn,
.menu-btn,
.location-btn-header,
.language-btn,
.share-btn {
    will-change: transform, opacity;
}

/* ========================================
   Safe Area 지원
   ======================================== */

@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(120px + env(safe-area-inset-top));
    }
    
    .location-selector {
        padding-top: calc(24px + env(safe-area-inset-top));
    }
    
    .selector-top-buttons {
        top: calc(24px + env(safe-area-inset-top));
    }

    .menu-btn {
        top: calc(50px + env(safe-area-inset-top));
    }
    
    .close-btn {
        top: calc(50px + env(safe-area-inset-top));
    }

    .header-controls {
        top: calc(50px + env(safe-area-inset-top));
    }
}

/* ========================================
   반응형 디자인
   ======================================== */

/* 작은 화면 (iPhone SE 등 - 320px ~ 374px) */
@media (max-width: 374px) {
    body {
        font-size: 16px;
    }
    
    .location-name {
        font-size: 24px;
        margin-top: 15px;
    }
    
    .weather-condition {
        font-size: 18px;
    }
    
    .weather-icon {
        font-size: 100px;
    }
    
    .current-temp {
        font-size: 80px;
    }
    
    .feels-like {
        font-size: 18px;
    }
    
    .temp-min, .temp-max {
        font-size: 22px;
    }

    .temp-value {
        font-size: 18px;
        padding: 5px 10px;
        min-width: 55px;
    }    
    
    .detail-label, .hourly-time {
        font-size: 16px;
    }
    
    .detail-value {
        font-size: 20px;
    }
    
    .hourly-item {
        min-width: 70px;
        max-width: 70px;
        padding: 12px 6px;
    }

    .hourly-detail-item {
        grid-template-columns: 75px 55px 1fr 60px;
        gap: 8px;
        padding: 14px 12px;
    }

    .hourly-icon {
        font-size: 30px;
        margin: 6px 0;
    }

    .hourly-detail-icon {
        font-size: 28px;
    }

    .hourly-temp {
        font-size: 17px;
    }

    .hourly-time {
        font-size: 14px;
    }
    
    .hourly-detail-time {
        font-size: 14px;
    }    

    .daily-day {
        font-size: 18px;
    }
    
    .daily-icon {
        font-size: 32px;
    }
    
    .daily-high, .daily-low {
        font-size: 20px;
    }
    
    .city-btn {
        min-height: 70px;
        padding: 14px;
    }
    
    .city-btn .city-name {
        font-size: 16px;
    }
    
    .location-btn-header, .language-btn, .share-btn {
        font-size: 20px;
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }
    
    #locationIcon,
    #languageIcon {
        font-size: 20px;
    }
    
    .header-controls {
        top: 45px;
        gap: 8px;
    }
    
    .menu-btn {
        top: 45px;
        min-width: 50px;
        min-height: 50px;
        font-size: 28px;
        padding: 12px;
    }

    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    .selector-top-buttons {
        top: 20px;
    }
    
    .selector-icon-btn,
    .close-btn {
        min-width: 48px;
        min-height: 48px;
        width: 48px;
        height: 48px;
    }
    
    .selector-icon-btn span {
        font-size: 22px;
    }
    
    .close-btn {
        font-size: 28px;
    }
    
    .location-selector h2 {
        font-size: 28px;
        margin-top: 65px;
    }
}

/* 표준 화면 (iPhone 12/13/14 등 - 375px ~ 430px) */
@media (min-width: 375px) and (max-width: 430px) {
    .container {
        max-width: 100%;
    }

    .hourly-detail-item {
        grid-template-columns: 85px 58px 1fr 70px;
        gap: 10px;
        padding: 16px 14px;
    }
}

/* 대형 화면 (iPhone Pro Max 등 - 431px+) */
@media (min-width: 431px) and (max-width: 767px) {
    .container {
        max-width: 100%;
    }
    
    .city-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 태블릿 및 데스크톱 (768px+) */
@media (min-width: 768px) {
    .city-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hourly-container {
        justify-content: center;
    }
    
    .hourly-item {
        min-width: 100px;
    }
    
    .location-btn-header, .language-btn, .share-btn {
        border-radius: 24px;
        padding: 10px 16px;
        width: auto;
        height: auto;
        min-height: 48px;
    }
    
    #locationText,
    #languageText {
        display: inline;
        margin-left: 6px;
        font-size: 16px;
    }

    .favorites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* PWA 디스플레이 모드별 스타일 */
@media (display-mode: standalone) {
    .install-pwa {
        display: none !important;
    }
    
    body {
        padding-top: env(safe-area-inset-top);
    }
}

@media (display-mode: fullscreen) {
    .header {
        padding-top: calc(120px + env(safe-area-inset-top));
    }
}

/* 가로 방향 최적화 */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 60px 20px 16px;
    }
    
    .weather-icon {
        font-size: 80px;
        margin: 15px 0;
    }
    
    .current-temp {
        font-size: 64px;
        margin: 15px 0 10px;
    }
    
    .feels-like {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .temp-range {
        margin-bottom: 20px;
    }
    
    .menu-btn, .close-btn {
        top: 20px;
        min-width: 50px;
        min-height: 50px;
        font-size: 24px;
        padding: 10px;
    }
    
    .header-controls {
        top: 25px;
    }
    
    .location-btn-header, .language-btn, .share-btn {
        min-height: 44px;
        min-width: 44px;
        width: 44px;
        height: 44px;
        font-size: 20px;
        padding: 10px;
    }
}

/* ========================================
   접근성 개선
   ======================================== */

/* 접근성: 텍스트 확대 시 레이아웃 안정성 */
@media (min-resolution: 2dppx) {
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* 확대 시에도 가독성 유지 */
* {
    max-width: 100%;
}

.container {
    overflow-x: hidden;
}

/* 터치 타겟 최소 크기 (접근성) */
button,
a,
input,
select,
.hourly-item,
.daily-row,
.detail-row,
.city-btn {
    min-height: 44px;
    min-width: 44px;
}

/* 다크 모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(180deg, #1a365d 0%, #153e75 50%, #0f2f5c 100%);
    }
}

/* 고대비 모드 지원 (접근성) */
@media (prefers-contrast: high) {
    .menu-btn,
    .location-btn-header,
    .language-btn,
    .share-btn {
        border-width: 4px;
    }
    
    *:focus {
        outline-width: 4px;
    }
}

/* 애니메이션 감소 모드 (접근성) */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* styles.css 맨 끝에 추가 */

/* ========================================
   유틸리티 클래스 (인라인 스타일 대체)
   ======================================== */

.display-none {
    display: none !important;
}

.display-block {
    display: block !important;
}

.display-flex {
    display: flex !important;
}