/**
 * KruPlus Wellness & Mindful Lounge — CSS Stylesheet
 * Elegant Zen Aesthetics, Glassmorphism, Micro-animations, and Responsive Layout
 */

/* ── 1. GLOBAL FLOATING ZEN CAPSULE (Bottom-Right Launcher) ── */
.kp-zen-capsule {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-top: 1.5px solid rgba(255, 255, 255, 0.32);
    border-radius: 9999px;
    color: #f8fafc;
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35), 0 0 20px rgba(16, 185, 129, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.kp-zen-capsule:hover {
    transform: translateY(-2px) scale(1.03);
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(52, 211, 153, 0.45);
    box-shadow: 0 14px 36px -4px rgba(0, 0, 0, 0.4), 0 0 25px rgba(16, 185, 129, 0.35);
}

.kp-zen-capsule:active {
    transform: translateY(0) scale(0.98);
}

.kp-zen-capsule-orb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1FA88A, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 0 10px rgba(31, 168, 138, 0.5);
    animation: capsuleOrbBreath 3.5s ease-in-out infinite alternate;
}

@keyframes capsuleOrbBreath {
    0% { transform: scale(0.95); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
    100% { transform: scale(1.1); box-shadow: 0 0 14px rgba(52, 211, 153, 0.7); }
}

.kp-zen-timer-badge {
    font-variant-numeric: tabular-nums;
    font-size: 11.5px;
    color: #6ee7b7;
    background: rgba(6, 78, 59, 0.6);
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(52, 211, 153, 0.3);
    letter-spacing: 0.3px;
}

/* ── 2. FLOATING MINI-PLAYER BAR (Minimized Mode) ── */
.kp-zen-miniplayer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9991;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 12px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 9999px;
    box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.45), 0 0 25px rgba(16, 185, 129, 0.25);
    color: #ffffff;
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
    animation: miniPlayerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes miniPlayerSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.kp-zen-miniplayer.active {
    display: flex;
}

/* Equalizer Bars Animation */
.kp-zen-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 16px;
    width: 18px;
}

.kp-zen-eq-bar {
    width: 3px;
    background: #1FA88A;
    border-radius: 2px;
    animation: eqPulse 1s ease-in-out infinite alternate;
}
.kp-zen-eq-bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.kp-zen-eq-bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.kp-zen-eq-bar:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.kp-zen-eq-bar:nth-child(4) { height: 80%; animation-delay: 0.4s; }

.kp-zen-equalizer.paused .kp-zen-eq-bar {
    animation: none;
    height: 30% !important;
    background: #64748b;
}

@keyframes eqPulse {
    0% { height: 25%; }
    100% { height: 100%; }
}

/* ── 3. FULLSCREEN ZEN LOUNGE MODAL ── */
.kp-zen-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kp-zen-modal-backdrop.open {
    display: flex;
    opacity: 1;
}

.kp-zen-modal-container {
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    background: linear-gradient(145deg, #0f172a 0%, #06261c 50%, #091e1d 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-top: 1.5px solid rgba(52, 211, 153, 0.4);
    border-radius: 28px;
    color: #f8fafc;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(16, 185, 129, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kp-zen-modal-backdrop.open .kp-zen-modal-container {
    transform: scale(1);
}

/* Ambient Inner Glows */
.kp-zen-modal-container::before {
    content: '';
    position: absolute;
    top: -80px;
    right: 15%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    pointer-events: none;
    filter: blur(40px);
}

/* Header & Tabs */
.kp-zen-header {
    padding: 20px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 10;
}

.kp-zen-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}

.kp-zen-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.kp-zen-tab-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.kp-zen-tab-btn.active {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(52, 211, 153, 0.35);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

/* Tab Contents Scrollable Body */
.kp-zen-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 26px;
    position: relative;
    z-index: 5;
}

/* ── 4. TAB 1: MUSIC & SOUNDSCAPE TRACKS ── */
.kp-zen-category-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.kp-zen-cat-pill {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.kp-zen-cat-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.kp-zen-cat-pill.active {
    background: linear-gradient(135deg, #178a71, #1FA88A);
    color: #ffffff;
    border-color: rgba(79, 209, 176, 0.5);
    box-shadow: 0 2px 12px rgba(31, 168, 138, 0.3);
}

.kp-zen-track-card {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 10px;
}

.kp-zen-track-card:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(52, 211, 153, 0.3);
    transform: translateX(4px);
}

.kp-zen-track-card.is-playing {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.5) 0%, rgba(30, 41, 59, 0.85) 100%);
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.2);
}

/* ── 5. TAB 2: MINDFUL BREATHING ── */
.kp-zen-breathing-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
}

.kp-zen-breath-circle-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 30px;
}

.kp-zen-breath-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.4) 0%, rgba(16, 185, 129, 0.15) 70%);
    border: 2px solid rgba(52, 211, 153, 0.6);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
    transition: transform 3.8s ease-in-out, background 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kp-zen-breath-circle-outer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(52, 211, 153, 0.3);
    animation: rotateDashed 40s linear infinite;
}

@keyframes rotateDashed {
    to { transform: rotate(360deg); }
}

/* Inhale / Hold / Exhale States */
.kp-zen-breath-circle.inhale {
    transform: scale(1.6);
    background: radial-gradient(circle, rgba(52, 211, 153, 0.6) 0%, rgba(6, 182, 212, 0.25) 70%);
    box-shadow: 0 0 50px rgba(52, 211, 153, 0.5);
}

.kp-zen-breath-circle.hold {
    transform: scale(1.6);
    background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, rgba(245, 158, 11, 0.15) 70%);
    border-color: rgba(251, 191, 36, 0.7);
    box-shadow: 0 0 45px rgba(251, 191, 36, 0.45);
}

.kp-zen-breath-circle.exhale {
    transform: scale(1.0);
    background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(14, 165, 233, 0.1) 70%);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.3);
}

/* ── 6. TAB 3: EYE REST 20-20-20 & STRETCHES ── */
.kp-zen-stretch-grid {
    display: grid;
    grid-cols: 1;
    gap: 14px;
}
@media (min-width: 640px) {
    .kp-zen-stretch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.kp-zen-stretch-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

/* ── 7. MASTER ADMIN TRACK MANAGER UI ── */
.kp-zen-admin-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.kp-zen-input {
    width: 100%;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px 14px;
    color: #ffffff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.kp-zen-input:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
}

/* ── 8. GENTLE EYE-REST NOTIFICATION TOAST ── */
.kp-zen-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    max-width: 420px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: 22px;
    padding: 16px 20px;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.25);
    color: #ffffff;
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
    transform: translateY(-40px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.kp-zen-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
