/* ==========================================================================
   G-CARE Speech Therapy KR v1.3: style.css (Kids Room Cozy Playground Theme)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;700&family=Outfit:wght@300;400;600;800;900&family=Nanum+Myeongjo:wght@700;800&family=Nanum+Gothic:wght@400;700;800&display=swap');

:root {
    --bg-dark: #fffbf0;
    --panel-bg: rgba(255, 255, 255, 0.75);
    --panel-border: rgba(255, 123, 159, 0.25);
    
    --neon-violet: #a78bfa;
    --neon-violet-glow: rgba(167, 139, 250, 0.4);
    --neon-mint: #20b080;
    --neon-mint-glow: rgba(32, 176, 128, 0.4);
    --neon-amber: #ffe066;
    --neon-amber-glow: rgba(255, 224, 102, 0.4);
    --neon-coral: #ff7b9f;
    --neon-coral-glow: rgba(255, 123, 159, 0.4);
    
    --text-primary: #4e3b62;
    --text-muted: #8874a3;
    --text-dark: #120e2e;
    
    --grad-primary: linear-gradient(135deg, #ff7b9f 0%, #ffae76 100%);
    --grad-mint: linear-gradient(135deg, #20b080 0%, #76e1b5 100%);
    --grad-amber: linear-gradient(135deg, #ffe066 0%, #f59e0b 100%);
    --grad-coral: linear-gradient(135deg, #ff6584 0%, #ffae76 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Comfortaa', 'Outfit', 'Nanum Gothic', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 50% 50%, #fffbf0 0%, #fff5d6 60%, #ffeec2 100%),
        radial-gradient(at 0% 0%, rgba(255, 123, 159, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(32, 176, 128, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    line-height: 1.6;
}

/* Glassmorphism */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.gradient-text {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 40px);
    position: sticky;
    top: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.brand-icon {
    font-size: 2rem;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 900;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
    border-left: 4px solid var(--neon-violet);
}

.workspace {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Dashboard Cockpit Grid */
.cockpit-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 20px;
}

.flex-col-gap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Diagnostic Baseline UI */
.diag-card {
    padding: 20px;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.diag-words-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 14px 0;
}

.diag-word-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    text-align: center;
}

.diag-word-btn.selected {
    border-color: var(--neon-mint);
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px var(--neon-mint-glow);
}

.diag-word-btn.correct {
    background: var(--neon-mint);
    color: #fff;
    border-color: transparent;
}

.diag-word-btn.incorrect {
    background: var(--neon-coral);
    color: #fff;
    border-color: transparent;
}

/* Custom Treatment Plan UI */
.plan-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.plan-item {
    background: rgba(30, 27, 75, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.15);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.plan-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--neon-violet);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.plan-checkbox.checked {
    background: var(--neon-violet);
    color: #fff;
}

/* Line Charts Progress Trackers */
.chart-container {
    height: 140px;
    background: #030107;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

#canvas-progress {
    width: 100%;
    height: 100%;
}

/* Role Reversal and Traffic Lights */
.role-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 16px;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.2) 0%, rgba(30, 27, 75, 0.6) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.role-tag {
    font-weight: 900;
    font-size: 0.95rem;
    padding: 4px 12px;
    border-radius: 20px;
}

.role-child { background: var(--grad-mint); color: #fff; }
.role-parent { background: var(--grad-amber); color: #fff; }

.traffic-system {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 16px;
    border-radius: 16px;
}

.light-bulb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #181131;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.light-stop.active {
    background: var(--neon-coral);
    color: #fff;
    box-shadow: 0 0 20px var(--neon-coral-glow);
}

.light-ready.active {
    background: var(--neon-amber);
    color: #fff;
    box-shadow: 0 0 20px var(--neon-amber-glow);
}

.light-go.active {
    background: var(--neon-mint);
    color: #fff;
    box-shadow: 0 0 20px var(--neon-mint-glow);
}

/* Canvas waves */
.visualizer-container {
    height: 130px;
    background: #030107;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

#canvas-spec {
    width: 100%;
    height: 100%;
}

/* Tabs & Cards */
.sound-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sound-tab-btn {
    flex: 1;
    background: rgba(30, 27, 75, 0.5);
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sound-tab-btn.active {
    background: var(--grad-primary);
    color: #fff;
    border-color: transparent;
}

.phonics-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
}

.anatomy-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 10px;
}

.anatomy-svg {
    width: 110px;
    height: 110px;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.word-card {
    background: rgba(39, 26, 71, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.word-card:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--neon-violet);
}

.word-card h4 { font-size: 1.1rem; }
.word-card p { font-size: 0.75rem; color: var(--text-muted); }

/* Interactive Modals and Popups */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 3, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    max-width: 600px;
    width: 100%;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Pricing Grid */
.price-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 14px;
}

.price-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-card.featured {
    border-color: var(--neon-violet);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

.price-card h3 { font-size: 1.1rem; }
.price-card h2 { font-size: 1.8rem; font-weight: 900; }

.price-list {
    list-style: none;
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Action Buttons */
.btn-action {
    background: var(--grad-primary);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 30px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 0.85rem;
}

.btn-action:hover {
    transform: scale(1.03);
}

/* Dinosaur Hatching */
.dino-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dino-egg {
    width: 80px;
    height: 105px;
    background: radial-gradient(circle at 30% 30%, #ffd166 0%, #f78c6a 50%, #9e2a2b 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s ease;
}

.dino-egg.shaking {
    animation: shakeEgg 0.3s infinite alternate;
}

@keyframes shakeEgg {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

.hatch-progress {
    width: 160px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.hatch-bar {
    width: 0%;
    height: 100%;
    background: var(--grad-amber);
}

.token-slots {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    border: 1px dashed rgba(139, 92, 246, 0.3);
}

.token-slot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.token-slot.filled {
    background: radial-gradient(circle, #ffe066 0%, #f59e0b 100%);
    border: 2px solid #fff;
    box-shadow: 0 0 10px var(--neon-amber-glow);
}

/* Yaja drag */
.waiting-board {
    background: rgba(10, 6, 22, 0.5);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.drag-chip {
    padding: 6px 12px;
    background: var(--grad-mint);
    border-radius: 8px;
    cursor: grab;
    font-weight: 800;
    font-size: 0.8rem;
    box-shadow: 0 3px 6px rgba(16, 185, 129, 0.3);
    display: inline-block;
}

.drop-zone {
    height: 48px;
    border: 2px dashed rgba(16, 185, 129, 0.4);
    border-radius: 10px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
}

.drop-zone.hovered {
    background: rgba(16, 185, 129, 0.12);
}

/* SOAP and chat console */
.chat-console {
    display: flex;
    flex-direction: column;
    height: 320px;
}

.chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.chat-message.bot {
    background: rgba(30, 27, 75, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.18);
    align-self: flex-start;
}

.chat-message.user {
    background: var(--grad-primary);
    color: #fff;
    align-self: flex-end;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-area input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 8px 12px;
    color: #fff;
}

.soap-console {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.soap-output {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px;
    font-size: 0.8rem;
    height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.soap-actions {
    display: flex;
    gap: 8px;
}

.btn-soap {
    flex: 1;
    background: rgba(30, 27, 75, 0.7);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-soap:hover {
    background: var(--grad-primary);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 800;
}

/* Settings items bar */
.settings-menu {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    margin-top: 10px;
}

.setting-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.setting-btn:hover {
    transform: scale(1.15);
    color: var(--neon-violet);
}
