/* ==========================================================================
   K-WaveCare Logo Styling Overrides (Restored to Original Center Alignment)
   ========================================================================== */

.logo {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;            /* 좁은 화면 로고 영역 찌그러짐 방지 */
}

.logo-text-group {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;       /* 센터 정렬 */
    flex-shrink: 0 !important;            /* 텍스트 영역 찌그러짐 방지 */
    margin-left: 6px !important;
}

.logo-text {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    text-align: center !important; 
    white-space: nowrap !important;       /* 줄바꿈 차단 (1줄 고정) */
    letter-spacing: -0.5px !important;
    flex-shrink: 0 !important;
}

.logo-subtext {
    font-family: 'Noto Sans KR', sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    text-align: center !important; 
    white-space: nowrap !important;       /* 줄바꿈 차단 (1줄 고정) */
    letter-spacing: 1.8px !important;
    margin-top: 1px !important;
    flex-shrink: 0 !important;
}

.logo-image {
    height: 44px !important;              /* 헤더 메뉴와의 밸런스를 위해 44px로 확대 */
    width: auto !important;
    object-fit: contain !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0 !important;
}

.logo:hover .logo-image {
    transform: scale(1.05);
}

.footer-logo-image {
    height: 48px !important;              /* 푸터 영역 밸런스를 위해 48px로 확대 */
    width: auto !important;
    object-fit: contain !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0 !important;
}

.footer-logo:hover .footer-logo-image {
    transform: scale(1.05);
}

/* ==========================================================================
   Navigation Menu Fixes (No Wrapping, Single Line)
   ========================================================================== */
.nav-item {
    white-space: nowrap !important;
    font-size: 0.82rem !important;
}

.nav-links {
    gap: 0.8rem !important;
    margin-left: 1rem !important;
}

/* ==========================================================================
   Affirmations Panel Style
   ========================================================================== */
.affirmation-card {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.affirmation-display-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.affirmation-box {
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.affirmation-text {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-main);
    transition: opacity 0.2s ease, transform 0.2s ease;
    word-break: keep-all;
}

.affirmation-index {
    font-size: 0.75rem;
    color: hsl(var(--primary-hue), 100%, 75%);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.affirmation-progressbar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.affirmation-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, hsl(var(--primary-hue), 100%, 70%), hsl(var(--accent-hue), 100%, 70%));
    box-shadow: 0 0 8px hsl(var(--primary-hue), 100%, 70%);
    transition: width 0.1s linear;
}

.affirmation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.aff-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aff-btn i {
    width: 16px;
    height: 16px;
}

.aff-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: hsl(var(--primary-hue), 100%, 75%);
    transform: scale(1.05);
}

.aff-btn:active {
    transform: scale(0.95);
}

.aff-toggle-btn {
    background: linear-gradient(135deg, hsl(var(--primary-hue), 100%, 65%), hsl(var(--accent-hue), 90%, 60%));
    border: none;
    box-shadow: 0 4px 10px var(--glow-color);
}

.aff-toggle-btn:hover {
    box-shadow: 0 6px 15px var(--glow-color);
    transform: scale(1.08);
}

.aff-save-btn:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

.favorites-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: hsl(var(--primary-hue), 100%, 75%);
}

.favorite-affirmations-container h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorite-affirmations-list {
    max-height: 200px;
}

.affirmation-fav-item {
    transition: background 0.2s ease;
}

.affirmation-fav-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.aff-delete-fav-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-radius: 4px;
}

/* Toast Notifications */
.kwave-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translate(-50%, 20px);
    background: rgba(13, 21, 56, 0.95);
    border: 1px solid hsl(var(--primary-hue), 100%, 75%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
}

.kwave-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ==========================================================================
   Tight Spacing / Margin Reductions to Fit Screen
   ========================================================================== */

/* Reduce Dashboard Layout Gap */
.dashboard-grid {
    gap: 1rem !important;
}

.panel-left, .panel-right {
    gap: 1rem !important;
}

/* Reduce Glass Card Padding */
.glass-card {
    padding: 1.2rem !important;
    border-radius: 16px !important;
}

/* Reduce Section Title Margin */
.section-title {
    margin-bottom: 0.8rem !important;
}

/* Tighten Soundscape Synthesizer sub controls */
.synth-sub-controls {
    margin-top: 0.5rem !important;
    padding-top: 0.5rem !important;
    gap: 0.6rem !important;
}

/* Tighten Mixer channels padding */
.mixer-channel {
    padding: 0.6rem 0.8rem !important;
}

.mixer-channels {
    gap: 0.8rem !important;
}

/* Reduce AI Soundscape Banner Margin/Padding */
.ai-soundscape-banner {
    padding: 0.8rem 1rem !important;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 16px !important;
}

.ai-soundscape-banner h2 {
    font-size: 1.5rem !important;
}

/* Tighten Breathing guide circle display */
.breathing-display {
    padding: 0.5rem 0 !important;
}

.breath-circle-container {
    width: 140px !important;
    height: 140px !important;
}

.breath-circle {
    width: 100px !important;
    height: 100px !important;
}

.breath-text {
    font-size: 1.1rem !important;
}

/* Tighten presets and timer display */
.timer-controls {
    gap: 0.8rem !important;
}

.timer-presets {
    gap: 0.4rem !important;
}

.timer-display-wrapper {
    padding: 0.6rem 1rem !important;
}

.countdown-display {
    font-size: 1.8rem !important;
}

.btn-main-play {
    padding: 0.5rem 1rem !important;
}

/* Tighten Ambient Triggers */
.ambient-triggers {
    margin-top: 0.8rem !important;
    gap: 0.6rem !important;
}

/* Dashboard Header & Content Wrapper Spacing Adjustments */
.content-wrapper {
    padding-top: 1.5rem !important;
}

.dashboard-header-container {
    margin-bottom: 1.5rem !important;
    padding-bottom: 0.8rem !important;
}

/* ==========================================================================
   [신규] 헤더 사용자 액션 버튼 공간 최적화 & 메뉴 균형 조율
   ========================================================================== */

/* 1. 프리미엄 등급 인디케이터 (Free 체험 중 / VIP 프리미엄 멤버) */
#premium-status-badge {
    border-radius: 8px !important;            /* 타원형 대신 세련된 라운드 코너 */
    padding: 0.35rem 0.7rem !important;      /* 패딩을 크게 줄여 공간을 덜 차지하게 함 */
    font-size: 0.82rem !important;
    background: rgba(255, 215, 0, 0.06) !important;
    border: 1px solid rgba(255, 215, 0, 0.25) !important;
    color: #ffd700 !important;
    pointer-events: none;                    /* 버튼이 아닌 배지(표시) 목적이므로 클릭 반응성 제거 */
    box-shadow: none !important;             /* 입체감 보단 정적 텍스트 배지 느낌으로 단순화 */
    height: auto !important;
    min-height: 0 !important;
}

/* 👑 이모티콘을 CSS 레벨에서도 숨김 보조 */
#premium-status-badge .icon {
    display: none !important;
}

/* 2. 회원가입 버튼 스타일 변경 (타원형 버튼에서 텍스트 링크 형태로 변경) */
#signup-nav-btn {
    background: transparent !important;      /* 배경 제거 */
    border: none !important;                  /* 테두리 제거 */
    padding: 0.45rem 0.75rem !important;     /* 패딩 간소화 */
    color: var(--color-text-muted) !important;
    font-size: 0.88rem !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    transition: color 0.3s ease, background-color 0.3s ease;
}

#signup-nav-btn:hover {
    color: var(--color-text-main) !important;
    background: rgba(255, 255, 255, 0.05) !important; /* 마우스 호버 시 살짝의 배경 피드백 */
}

/* 3. 대시보드 시작 버튼 스타일 변경 */
#header-cta-btn {
    border-radius: 8px !important;            /* 타원형 대신 트렌디한 라운드 사각형 */
    padding: 0.45rem 1rem !important;        /* 패딩을 줄여 콤팩트하게 변경 */
    font-size: 0.88rem !important;
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.25) !important; /* 주 액션 강조는 유지 */
}

/* 4. 헤더 정렬 및 메뉴 겹침 방지 */
.header-container {
    justify-content: space-between !important;
    gap: 1.5rem !important;                  /* 탭들과 우측 액션간의 최소 간격 보장 */
}

.user-actions {
    gap: 0.6rem !important;                  /* 우측 버튼간 간격을 좁혀서 공간 추가 확보 */
    flex-shrink: 0 !important;               /* 우측 영역이 찌그러지지 않도록 방지 */
}

.nav-links {
    gap: 1.25rem !important;                  /* 탭 메뉴간의 간격을 1.5rem -> 1.25rem으로 소폭 조율하여 전체적인 밸런스 유지 */
}

/* ==========================================================================
   Mobile Responsive Navigation Menu Drawer Styling
   ========================================================================== */

/* Hide hamburger button and menu overlay on desktop by default */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    z-index: 1001; /* Stay above the side drawer */
    transition: transform 0.3s ease;
}

.mobile-menu-btn svg {
    width: 28px;
    height: 28px;
}

.mobile-menu-btn .icon-close {
    display: none;
}

.mobile-menu-btn.active .icon-menu {
    display: none;
}

.mobile-menu-btn.active .icon-close {
    display: block;
}

/* Header Stacking Context Fix */
.main-header {
    z-index: 1001 !important;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    /* Show hamburger button on mobile viewport */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Transform .nav-menu into a vertical sliding side drawer */
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        background: rgba(13, 17, 28, 0.92) !important; /* Translucent premium dark glass */
        border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 90px 24px 40px 24px !important;
        gap: 1.5rem !important;
        z-index: 1000 !important;
        transform: translateX(100%) !important;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s !important;
        box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6) !important;
        visibility: hidden !important; /* Prevent horizontal scrolling or overlapping when closed */
    }

    /* Show drawer when active class is applied */
    .nav-menu.active {
        transform: translateX(0) !important;
        visibility: visible !important;
    }

    /* Stack links vertically on mobile */
    .nav-menu .nav-links {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.8rem !important;
        margin-left: 0 !important;
        width: 100% !important;
    }

    .nav-menu .nav-links .nav-item {
        font-size: 1.05rem !important;
        padding: 10px 0 !important;
        width: 100% !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        color: rgba(255, 255, 255, 0.9) !important; /* Highly legible white text! */
        display: flex !important;
        align-items: center !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
    }

    .nav-menu .nav-links .nav-item:hover {
        color: #ffffff !important;
        padding-left: 6px !important;
        border-bottom-color: rgba(255, 255, 255, 0.2) !important;
    }

    .nav-menu .nav-links .nav-item.active {
        color: #38bdf8 !important; /* sky-blue active item */
        font-weight: 700 !important;
        border-bottom-color: rgba(56, 189, 248, 0.4) !important;
    }

    /* Stack CTA buttons vertically on mobile */
    .nav-menu .user-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 0.8rem !important;
        margin-top: auto !important; /* Push CTAs to the bottom of the drawer */
    }

    .nav-menu .user-actions button,
    .nav-menu .user-actions a {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
    }

    .nav-menu .user-actions #signup-nav-btn {
        color: rgba(255, 255, 255, 0.9) !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
    }

    .nav-menu .user-actions #signup-nav-btn:hover {
        background: rgba(255, 255, 255, 0.15) !important;
    }
}

/* Global overrides to fix mobile layout and modal overlays styling */
body {
    overflow-x: hidden !important;
}

.modal-overlay {
    z-index: 2000 !important;
}

/* Rife Therapy Code buttons click states and hover animations */
.btn-rife {
    transition: all 0.25s ease !important;
}

.btn-rife:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-1px);
    color: #fff !important;
}

.btn-rife.active {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(5, 150, 105, 0.15)) !important;
    border: 1px solid #34d399 !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.4) !important;
    transform: scale(1.03);
}

/* Real-time frequency timeline node dot styling */
.rife-timeline-node {
    position: absolute !important;
    top: 50% !important;
    width: 10px !important;
    height: 10px !important;
    background-color: rgba(255, 255, 255, 0.4) !important;
    border: 2px solid #a855f7 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transform: translate(-50%, -50%) !important;
    transition: all 0.25s ease !important;
    z-index: 10 !important;
}

.rife-timeline-node:hover {
    background-color: #a855f7 !important;
    transform: translate(-50%, -50%) scale(1.3) !important;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.6) !important;
}

.rife-timeline-node.active {
    background-color: #34d399 !important;
    border-color: #34d399 !important;
    transform: translate(-50%, -50%) scale(1.5) !important;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.9) !important;
}


