/* ================================
   탐험 애니메이션 효과
================================ */

/* 탐험 상태 컨테이너 */
.exploration-status {
    position: relative;
    overflow: hidden;
}

.explore-active {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    min-height: 400px;
    /* 중앙 정렬 추가 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 배경 레이어 */
.exploration-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

/* 배경 스크롤 효과 */
.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    /* 기본 배경은 JS에서 테마별로 덮어씌워짐, 여기선 그라디언트만 */
    animation: scrollBackground 20s linear infinite;
}

@keyframes scrollBackground {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* 구름 효과 */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    animation: floatCloud linear infinite;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
}

.cloud-1 {
    width: 100px;
    height: 40px;
    top: 20%;
    left: -100px;
    animation-duration: 25s;
}

.cloud-2 {
    width: 80px;
    height: 35px;
    top: 40%;
    left: -80px;
    animation-duration: 30s;
    animation-delay: 5s;
}

.cloud-3 {
    width: 120px;
    height: 45px;
    top: 60%;
    left: -120px;
    animation-duration: 35s;
    animation-delay: 10s;
}

@keyframes floatCloud {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(100vw + 200px));
    }
}

/* 파티클 효과 */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: particleFloat linear infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(50px) scale(0);
        opacity: 0;
    }
}

/* 탐험 콘텐츠 */
.exploration-content {
    position: relative;
    z-index: 3;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

/* 트레이너 애니메이션 관련 스타일 제거됨 */

/* 포켓몬 발견 효과 */
.pokemon-encounter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    animation: encounterAppear 3s ease-in-out infinite;
}

.pokemon-silhouette {
    width: 100px;
    height: 100px;
    font-size: 70px;
    filter: brightness(0) drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes encounterAppear {

    0%,
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* 탐험 정보 */
.exploration-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 300px;
}

.exploration-info h3 {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.exploration-info p {
    font-size: 16px;
    color: #2d3436;
    margin: 8px 0;
}

.explore-time {
    font-size: 14px;
    color: #636e72;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

/* 진행 표시 애니메이션 */
.exploring-indicator {
    display: inline-block;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* 버튼 컨테이너 */
.explore-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.explore-actions button {
    flex: 1;
    min-width: 130px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.explore-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.explore-actions button:active {
    transform: translateY(0);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .explore-active {
        min-height: 350px;
    }

    .trainer-walking {
        width: 80px;
        height: 80px;
    }

    .trainer-sprite {
        font-size: 60px;
    }

    .pokemon-silhouette {
        width: 70px;
        height: 70px;
        font-size: 50px;
    }

    .exploration-info {
        min-width: 250px;
        padding: 16px 20px;
    }

    .exploration-info h3 {
        font-size: 20px;
    }

    .exploration-info p {
        font-size: 14px;
    }

    .explore-actions {
        flex-direction: column;
    }

    .explore-actions button {
        width: 100%;
    }
}

/* 지역별 테마 */
.exploration-theme-forest .background-layer {
    background-image: url('../images/backgrounds/forest.png');
    background-size: auto 100%;
    background-repeat: repeat-x;
}

.exploration-theme-mountain .background-layer {
    background-image: url('../images/backgrounds/forest.png');
    /* 산 이미지가 없으면 숲으로 대체하거나 추후 추가 */
    background-size: auto 100%;
    background-repeat: repeat-x;
    filter: hue-rotate(180deg) brightness(0.8);
    /* 색상 변형으로 산 느낌 */
}

.exploration-theme-water .background-layer {
    background-image: url('../images/backgrounds/ocean.png');
    background-size: auto 100%;
    background-repeat: repeat-x;
}

.exploration-theme-cave .background-layer {
    background-image: url('../images/backgrounds/cave.png');
    background-size: auto 100%;
    background-repeat: repeat-x;
}

.exploration-theme-city .background-layer {
    background-image: url('../images/backgrounds/forest.png');
    background-size: auto 100%;
    background-repeat: repeat-x;
    filter: grayscale(0.8) sepia(0.2);
    /* 도시 느낌 */
}

/* 트레이너 애니메이션 수정 (깜빡임 해결) */
.trainer-walking {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 20px 0;
    /* mix-blend-mode 제거하고 깔끔한 원형 디자인 적용 */
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.trainer-sprite {
    width: 100%;
    height: 100%;
    display: block;
    background-image: url('../images/trainer_walk.png');
    background-size: 400% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    animation: walk-sprite 0.8s steps(4) infinite;
    /* mix-blend-mode 삭제 */
}

/* 로딩 스피너 */
.exploration-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}