/**
 * 날씨 효과 CSS 애니메이션
 * - 비 효과 (rain)
 * - 눈 효과 (snow)
 * - pointer-events: none으로 클릭 방해 없음
 */

/* ===========================
   날씨 효과 컨테이너
   =========================== */
#weatherEffectContainer,
#weatherEffectContainer * {
    pointer-events: none !important;  /* 클릭 이벤트 통과 - 모든 자식 포함 */
}

#weatherEffectContainer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    z-index: 50 !important;  /* 지도 위, 마커/인포윈도우 아래 */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#weatherEffectContainer.active {
    opacity: 1;
}

/* ===========================
   비 효과 (Rain Effect)
   =========================== */
.rain-container {
    background: linear-gradient(to bottom, 
        rgba(100, 100, 100, 0.1) 0%, 
        rgba(100, 100, 100, 0.05) 100%);
}

.raindrop {
    position: absolute;
    width: 3px;
    height: 20px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(100, 149, 237, 0.7) 50%, 
        rgba(65, 105, 225, 0.9) 100%);
    border-radius: 0 0 3px 3px;
    animation: rainFall linear infinite;
    opacity: 0.8;
    box-shadow: 0 0 2px rgba(100, 149, 237, 0.5);
}

@keyframes rainFall {
    0% {
        transform: translateY(-20px) rotate(15deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(15deg);
        opacity: 0;
    }
}

/* 빗방울 스플래시 효과 */
.rain-splash {
    position: absolute;
    bottom: 0;
    width: 4px;
    height: 4px;
    background: rgba(174, 194, 224, 0.5);
    border-radius: 50%;
    animation: splash 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes splash {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* ===========================
   눈 효과 (Snow Effect)
   =========================== */
.snow-container {
    background: linear-gradient(to bottom, 
        rgba(200, 200, 220, 0.05) 0%, 
        transparent 100%);
}

.snowflake {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0.8) 40%, 
        rgba(255, 255, 255, 0) 100%);
    border-radius: 50%;
    animation: snowFall linear infinite;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* 눈송이 크기 변형 */
.snowflake.small {
    width: 4px;
    height: 4px;
}

.snowflake.medium {
    width: 8px;
    height: 8px;
}

.snowflake.large {
    width: 12px;
    height: 12px;
}

@keyframes snowFall {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    90% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* 눈송이 흔들림 효과 */
@keyframes snowSway {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(20px);
    }
}

/* ===========================
   소나기 효과 (Shower)
   =========================== */
.shower-container .raindrop {
    height: 25px;
    width: 3px;
    animation-duration: 0.3s;
    opacity: 0.8;
}

/* ===========================
   비/눈 혼합 효과
   =========================== */
.rain-snow-container .raindrop {
    opacity: 0.5;
}

.rain-snow-container .snowflake {
    opacity: 0.7;
}

/* ===========================
   날씨 정보 배지
   =========================== */
.weather-badge {
    position: absolute;
    top: 10px;
    left: 220px;  /* 교통정보 버튼 옆으로 이동 */
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    z-index: 150;
    pointer-events: auto;  /* 배지는 클릭 가능 */
    cursor: pointer;
    transition: all 0.2s ease;
}

.weather-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.weather-badge .weather-icon {
    font-size: 18px;
}

.weather-badge .weather-temp {
    font-weight: 700;
    color: #2c3e50;
}

.weather-badge .weather-text {
    color: #666;
    font-size: 12px;
}

/* 날씨별 배지 색상 */
.weather-badge.rain {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    border: 1px solid #4dd0e1;
}

.weather-badge.snow {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #64b5f6;
}

.weather-badge.clear {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffd54f;
}

/* ===========================
   효과 토글 버튼
   =========================== */
.weather-toggle-btn {
    position: absolute;
    bottom: 80px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 150;
    transition: all 0.2s ease;
}

.weather-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.weather-toggle-btn.disabled {
    opacity: 0.5;
}

/* ===========================
   모바일 반응형
   =========================== */
@media (max-width: 768px) {
    #weatherBadge {
        top: 60px !important;
        left: 10px !important;
        padding: 6px 12px !important;
        font-size: 13px !important;
        border-radius: 20px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        z-index: 200 !important;
    }
    
    .weather-badge .weather-icon {
        font-size: 18px;
    }
    
    .weather-badge .weather-temp {
        font-weight: 600;
        color: #333;
    }
    
    .weather-badge .weather-text {
        color: #666;
    }
    
    #weatherToggleBtn {
        display: none !important;  /* 모바일에서 토글 버튼 숨김 */
    }
    
    /* 모바일에서도 날씨 효과 표시 */
    #weatherEffectContainer {
        display: block !important;
    }
    
    /* 모바일에서 효과 개수 줄이기 */
    .raindrop:nth-child(n+30),
    .snowflake:nth-child(n+25) {
        display: none;
    }
}
