/* ========================================================
   FunTools - Study with Me Immersive Pomodoro Timer
   (첨부파일 1, 2, 3 스타일: 100% 배경 노출 & 네온 링 & 감성 뷰)
   ======================================================== */

body.immersive-body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #0f172a;
    font-family: 'Pretendard', sans-serif;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    user-select: none;
}

/* 1. 배경 이미지 (100% 완전히 선명하게 표시) */
.bg-wallpaper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, background-image 0.6s ease-in-out;
}

.bg-wallpaper.active {
    opacity: 1;
}

/* 2. 감성 비네트 오버레이 (배경을 가리지 않고 텍스트 대비만 극대화) */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
}

/* 3. 미니멀 탑바 */
.immersive-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.top-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    transition: all 0.2s;
}

.top-nav-btn:hover {
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.header-center-mode {
    display: flex;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.25rem;
    border-radius: 9999px;
    gap: 0.25rem;
}

.mode-pill {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.4rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-pill:hover {
    color: #ffffff;
}

.mode-pill.active {
    background: #22d3ee;
    color: #0f172a;
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.6);
}

.top-tool-btn {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.top-tool-btn:hover {
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* 4. 메인 타이머 디스플레이 (Study with Me 중심부) */
.immersive-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding-bottom: 4.5rem;
}

.scroll-down-hint {
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s;
}

.scroll-down-hint:hover {
    color: #22d3ee;
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(15, 23, 42, 0.75);
}

.timer-below-fold {
    position: relative;
    z-index: 20;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 3.5rem 1.5rem 6.5rem;
    user-select: text;
}

.timer-below-fold .seo-guide-section {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
}

.timer-below-fold .seo-guide-section h2,
.timer-below-fold .seo-guide-section h3,
.timer-below-fold .seo-faq-item strong {
    color: #ffffff;
}

.timer-below-fold .seo-guide-section p,
.timer-below-fold .seo-faq-item p {
    color: #cbd5e1;
}

.timer-below-fold .seo-faq-box {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.timer-below-fold .seo-faq-item {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(255, 255, 255, 0.12);
}

.session-label-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.session-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.session-counter {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    padding: 0.2rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* 원형 프로그레스 링 */
.immersive-timer-wrapper {
    position: relative;
    width: 420px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 5;
}

/* 첨부파일 1 스타일의 네온 시안 프로그레스 링 */
.progress-ring-indicator {
    fill: none;
    stroke: #22d3ee;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s linear, stroke 0.3s ease;
    filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.9));
}

.timer-inner-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.immersive-time-text {
    font-family: 'Pretendard', sans-serif;
    font-size: 5.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.9);
}

.immersive-subtext {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    font-weight: 500;
}

/* 5. 하단 플로팅 글래스 독 */
.floating-dock {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.dock-container {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
}

.dock-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dock-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.dock-btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.dock-btn-main {
    background: #22d3ee;
    color: #0f172a;
    border: none;
    padding: 0.65rem 1.6rem;
    border-radius: 9999px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.65);
    transition: all 0.2s;
}

.dock-btn-main:hover {
    transform: scale(1.05);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.85);
}

.dock-btn-main.running {
    background: #fbbf24;
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.65);
}

.dock-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.2rem;
}

/* 6. 팝업 메뉴 (시간/사운드/배경) */
.dock-menu-wrapper {
    position: relative;
}

.dock-popup {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 1.25rem;
    width: 280px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    animation: popupIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-popup.popup-wide {
    width: 360px;
}

@keyframes popupIn {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.popup-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
}

.popup-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dock-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #94a3b8;
    cursor: pointer;
}

/* 시간 프리셋 그리드 */
.preset-pill-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.preset-pill-grid .preset-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-pill-grid .preset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.preset-pill-grid .preset-btn.active {
    background: #22d3ee;
    color: #0f172a;
    border-color: #22d3ee;
    font-weight: 700;
}

.custom-time-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-time-row input {
    width: 70px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.4rem 0.6rem;
    border-radius: 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

.btn-xs {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* 사운드 옵션 리스트 */
.sound-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sound-opt-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 0.55rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.sound-opt-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.sound-opt-btn.active {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22d3ee;
    color: #22d3ee;
}

.volume-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #94a3b8;
}

.volume-slider-row input[type="range"] {
    flex: 1;
    accent-color: #22d3ee;
}

/* 배경 썸네일 그리드 */
.bg-thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    max-height: 240px;
    overflow-y: auto;
}

.bg-thumb-card {
    position: relative;
    height: 75px;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 0.4rem 0.5rem;
}

.bg-thumb-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.bg-thumb-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.bg-thumb-card.active {
    border-color: #22d3ee;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.7);
}

.bg-thumb-title {
    position: relative;
    z-index: 2;
    font-size: 0.775rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* 전체화면 모드 스타일 */
:fullscreen .immersive-header {
    opacity: 0.15;
}

:fullscreen .immersive-header:hover {
    opacity: 1;
}

:fullscreen .floating-dock {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

:fullscreen .floating-dock:hover {
    opacity: 1;
}

/* 반응형 */
@media (max-width: 600px) {
    .immersive-timer-wrapper {
        width: 320px;
        height: 320px;
    }
    .immersive-time-text {
        font-size: 4rem;
    }
    .session-title {
        font-size: 2rem;
    }
    .dock-container {
        padding: 0.35rem 0.65rem;
        gap: 0.4rem;
    }
    .dock-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    .dock-popup {
        width: 250px;
    }
    .dock-popup.popup-wide {
        width: 300px;
    }
}

/* Timer Header Language Switcher (Glassmorphism dark theme) */
.immersive-header .lang-switcher {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
}
.immersive-header .lang-btn {
    color: rgba(255, 255, 255, 0.7);
}
.immersive-header .lang-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}
.immersive-header .lang-btn.active {
    background: #06b6d4;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}
.immersive-header .lang-divider {
    color: rgba(255, 255, 255, 0.3);
}

