/* Import Google Fonts for Kids Dentist Theme */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300..700&family=Quicksand:wght@300..700&display=swap');

/* Color Variables and Theme Setup - Bubbly Dentist Theme */
:root {
    --bg-light: #f0f9ff;           /* Sky Blue Cloud Base */
    --bg-card: rgba(255, 255, 255, 0.95);
    --border-color: rgba(14, 165, 233, 0.15);
    
    /* Diagnostics State Colors (Bright, Kids Friendly) */
    --color-caries: #ff5b7f;       /* Warm Strawberry Red */
    --color-caries-glow: rgba(255, 91, 127, 0.2);
    
    --color-normal: #10b981;       /* Mint Green */
    --color-normal-glow: rgba(16, 185, 129, 0.2);
    
    --color-undetected: #94a3b8;   /* Soft slate */
    --color-undetected-glow: rgba(148, 163, 184, 0.15);
    
    /* System Primary Colors (Playful sky blue) */
    --color-primary: #0ea5e9;      /* Bubble Blue */
    --color-primary-light: #e0f2fe;
    --color-primary-glow: rgba(14, 165, 233, 0.25);
    
    /* Neutral Text */
    --text-primary: #1e293b;       /* Soft dark slate */
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Layout Dimensions - Rounded Corner */
    --radius-lg: 24px;             /* Bubbly rounded borders */
    --radius-md: 16px;
    --radius-sm: 10px;
    
    /* Playful bouncy transitions */
    --transition-fast: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-normal: 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, #e0f2fe 0%, transparent 60%),
        radial-gradient(circle at 90% 80%, #dbeafe 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, #ffffff 0%, transparent 80%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    position: relative;
}

/* Abstract Bubbly Background Shapes - Cute & Clutter-Free */
body::before {
    content: "";
    position: fixed;
    top: -50px;
    left: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -2;
    animation: floatShape1 12s ease-in-out infinite;
}

body::after {
    content: "";
    position: fixed;
    bottom: -80px;
    right: -80px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 75%);
    border-radius: 50%;
    z-index: -2;
    animation: floatShape2 15s ease-in-out infinite;
}

/* Cute decorative abstract circles inside background */
.app-container {
    position: relative;
    z-index: 1;
}

.app-container::before {
    content: "";
    position: absolute;
    top: 25%;
    right: -100px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(10px);
    animation: floatShape1 18s ease-in-out infinite alternate;
}

.app-container::after {
    content: "";
    position: absolute;
    bottom: 10%;
    left: -120px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 91, 127, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(15px);
    animation: floatShape2 20s ease-in-out infinite alternate;
}

@keyframes floatShape1 {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes floatShape2 {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(20px) scale(0.95); }
    100% { transform: translateY(0) scale(1); }
}

h1, h2, h3, h4, h5 {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #e0f2fe;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #bae6fd;
    border-radius: 10px;
    border: 2px solid #e0f2fe;
}
::-webkit-scrollbar-thumb:hover {
    background: #7dd3fc;
}

/* Main Container Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* App Header - Cute style */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px dashed #bae6fd;
}

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

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    border-radius: 50%; /* Circle tooth logo */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px var(--color-primary-glow);
    animation: bubbleFloat 3s ease-in-out infinite;
}

@keyframes bubbleFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.logo-icon svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0369a1; /* Cute deep sky blue */
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    background: white;
    padding: 8px 16px;
    border-radius: 30px;
    border: 2px solid #bae6fd;
    color: var(--text-secondary);
    box-shadow: 0 4px 8px rgba(14,165,233,0.05);
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--color-caries);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-caries);
    transition: var(--transition-normal);
}

.status-dot.online {
    background-color: var(--color-normal);
    box-shadow: 0 0 10px var(--color-normal);
}

/* Main Content Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

@media (max-width: 968px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Playful White Bubbly Card */
.glass-card {
    background: var(--bg-card);
    border: 2px solid rgba(14, 165, 233, 0.12);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: var(--transition-normal);
}

.glass-card:hover {
    box-shadow: 0 16px 40px rgba(14, 165, 233, 0.12);
}

/* Camera Scanner Container */
.scanner-card {
    position: relative;
    align-items: center;
}

.viewfinder-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 3px solid #e2e8f0;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.03);
    display: flex;
    justify-content: center;
    align-items: center;
}

#webcam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror view */
    display: none;
}

/* Magical Scanning HUD */
.overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
}

/* Bubbly Corners instead of Cyber Corners */
.reticle-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 4px solid var(--color-primary);
    border-radius: 12px;
    transition: var(--transition-normal);
}

.reticle-top-left { top: 30px; left: 30px; border-right: none; border-bottom: none; }
.reticle-top-right { top: 30px; right: 30px; border-left: none; border-bottom: none; }
.reticle-bottom-left { bottom: 30px; left: 30px; border-right: none; border-top: none; }
.reticle-bottom-right { bottom: 30px; right: 30px; border-left: none; border-top: none; }

/* Dynamic state coloring of bubble target */
.scanner-card.state-caries .reticle-corner { border-color: var(--color-caries); }
.scanner-card.state-normal .reticle-corner { border-color: var(--color-normal); }
.scanner-card.state-undetected .reticle-corner { border-color: var(--color-undetected); }

/* Center Focus Area */
.focus-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 55%;
    border: 3px dashed rgba(14, 165, 233, 0.25);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.scanner-card.state-caries .focus-box {
    border-color: rgba(255, 91, 127, 0.4);
    box-shadow: 0 0 20px var(--color-caries-glow);
}
.scanner-card.state-normal .focus-box {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 20px var(--color-normal-glow);
}

/* Magic sparkle scanner line */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #38bdf8, #ffffff, #38bdf8, transparent);
    animation: scanning 3.5s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
    z-index: 2;
    transition: var(--transition-normal);
}

.scanner-card.state-caries .scan-line {
    background: linear-gradient(90deg, transparent, var(--color-caries), #ffffff, var(--color-caries), transparent);
    box-shadow: 0 0 15px var(--color-caries-glow);
}
.scanner-card.state-normal .scan-line {
    background: linear-gradient(90deg, transparent, var(--color-normal), #ffffff, var(--color-normal), transparent);
    box-shadow: 0 0 15px var(--color-normal-glow);
}

@keyframes scanning {
    0% { top: 5%; }
    50% { top: 95%; }
    100% { top: 5%; }
}

/* Controls Grid */
.controls {
    width: 100%;
    display: flex;
    gap: 16px;
}

/* Playful, rounded buttons */
button {
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 30px; /* Bubbly pill shape */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    transition: var(--transition-fast);
}

button:hover:not(:disabled) {
    transform: scale(1.04);
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    flex-grow: 1;
    box-shadow: 0 6px 15px var(--color-primary-glow);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e0f2fe;
    color: #0369a1;
    border: 2px solid #bae6fd;
}

.btn-secondary:hover:not(:disabled) {
    background: #bae6fd;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: #fecdd3;
    color: #be123c;
    border: 2px solid #fda4af;
}

.btn-danger:hover {
    background: #fda4af;
}

/* Webcam Placeholder / Empty State */
.camera-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #64748b;
    text-align: center;
    padding: 40px;
    z-index: 1;
}

.camera-placeholder svg {
    width: 64px;
    height: 64px;
    stroke: #bae6fd;
    animation: logoShake 4s ease-in-out infinite;
}

@keyframes logoShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* Diagnostic Results Panel */
.results-card {
    gap: 24px;
}

.panel-title {
    font-size: 1.3rem;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px dashed #e0f2fe;
    padding-bottom: 12px;
}

/* Main diagnostic status bar */
.diagnose-banner {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-normal);
}

.diagnose-banner.banner-caries {
    background: #fff1f2;
    border-color: #fecdd3;
}

.diagnose-banner.banner-normal {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.diagnose-info h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.diagnose-result {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 4px;
    transition: color var(--transition-fast);
}

/* Pill badging labels */
.badge {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-caries {
    background: #ffe4e6;
    color: #e11d48;
    border: 2px solid #fecdd3;
}

.badge-normal {
    background: #d1fae5;
    color: #059669;
    border: 2px solid #a7f3d0;
}

.badge-undetected {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

/* Prediction Confidence Bars - Bubbly Style */
.prediction-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bar-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.bar-label span:first-child {
    font-weight: 600;
    color: #0369a1;
}

.bar-track {
    width: 100%;
    height: 14px; /* Thicker for children theme */
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 8px;
    transition: width 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fill-caries { background: linear-gradient(90deg, #ff8da1, #ff5b7f); }
.fill-normal { background: linear-gradient(90deg, #34d399, #10b981); }
.fill-undetected { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }

/* Playful Advice Panel */
.advice-panel {
    background: #f8fafc;
    border-left: 6px solid var(--color-primary);
    border-radius: var(--radius-sm) var(--radius-md) var(--radius-md) var(--radius-sm);
    padding: 20px;
    transition: var(--transition-normal);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.advice-panel.advice-caries {
    border-left-color: var(--color-caries);
    background: #fffafb;
}

.advice-panel.advice-normal {
    border-left-color: var(--color-normal);
    background: #f6fdfa;
}

.advice-panel.advice-undetected {
    border-left-color: var(--color-undetected);
}

.advice-panel h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #0f172a;
}

.advice-panel p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* History Log Section */
.history-section {
    grid-column: 1 / -1;
}

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

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.history-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    border: 3px dashed #bae6fd;
    border-radius: var(--radius-md);
    background: #f0f9ff;
    font-weight: 500;
}

.history-card {
    background: white;
    border: 2px solid #e0f2fe;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(14,165,233,0.03);
}

.history-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: #7dd3fc;
    box-shadow: 0 8px 20px rgba(14,165,233,0.1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.history-thumb {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #bae6fd;
}

.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirrored */
}

.history-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.history-details .time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.history-details .confidence {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-delete-history {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    color: #cbd5e1;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-delete-history:hover {
    color: var(--color-caries);
    background: #ffe4e6;
}

/* System loading screen - kids design */
.system-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-light);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(14, 165, 233, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.1);
}

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

.loader-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    color: #0369a1;
    text-align: center;
    line-height: 1.6;
}

/* Kids Guide Panel */
.guide-container {
    background: #f0f9ff;
    border: 2px dashed #bae6fd;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 10px;
}

.guide-container h5 {
    color: #0369a1;
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-list {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 500;
}

.guide-list li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.guide-list li::before {
    content: "🦷"; /* cute tooth bullet point */
    font-size: 0.95rem;
}

/* Background Clouds Container */
.cloud-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 100px;
    filter: blur(2px); /* Soften the edges */
}

.cloud::before, .cloud::after {
    content: "";
    position: absolute;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 50%;
}

/* Specific Cloud Shapes & Sizes */
.cloud-1 {
    width: 180px;
    height: 60px;
    top: 12%;
    left: 10%;
    opacity: 0.35;
    animation: floatCloud 25s ease-in-out infinite alternate;
}
.cloud-1::before { width: 80px; height: 80px; top: -40px; left: 30px; }
.cloud-1::after { width: 100px; height: 100px; top: -50px; right: 30px; }

.cloud-2 {
    width: 240px;
    height: 80px;
    top: 45%;
    right: 5%;
    opacity: 0.25;
    animation: floatCloud 35s ease-in-out infinite alternate-reverse;
}
.cloud-2::before { width: 100px; height: 100px; top: -50px; left: 40px; }
.cloud-2::after { width: 130px; height: 130px; top: -70px; right: 40px; }

.cloud-3 {
    width: 150px;
    height: 50px;
    bottom: 20%;
    left: 8%;
    opacity: 0.3;
    animation: floatCloud 22s ease-in-out infinite alternate;
}
.cloud-3::before { width: 65px; height: 65px; top: -30px; left: 25px; }
.cloud-3::after { width: 85px; height: 85px; top: -45px; right: 25px; }

@keyframes floatCloud {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(50px) translateY(-8px); }
}

/* ==========================================================================
   Tab Navigation & Tab Views (Bubbly Kids Theme)
   ========================================================================== */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
    width: 100%;
}

.tab-btn {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 10px 24px;
    border-radius: 30px;
    border: 2px solid #bae6fd;
    background: white;
    color: #0369a1;
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-normal);
}

.tab-btn:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--color-primary-glow);
}

.tab-btn.active {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border-color: #0ea5e9;
    box-shadow: 0 6px 15px var(--color-primary-glow);
}

.tab-btn .tab-icon {
    font-size: 1.2rem;
}

.tab-view {
    display: none;
    width: 100%;
    animation: tabFadeIn 0.4s ease-out;
}

.tab-view.active {
    display: block;
}

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

/* ==========================================================================
   2-Minute Toothbrushing Timer
   ========================================================================== */
.timer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.timer-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.timer-circle-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 10px 0;
}

.timer-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Start at 12 o'clock */
}

.timer-circle-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 12;
}

.timer-circle-progress {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear, stroke var(--transition-normal);
}

.timer-card.running .timer-circle-progress {
    stroke: var(--color-normal);
}

.timer-display-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 80%;
}

.timer-time {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: #0369a1;
    line-height: 1.1;
    margin-bottom: 2px;
    transition: color var(--transition-normal);
}

.timer-card.running .timer-time {
    color: var(--color-normal);
}

.timer-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timer-guidance {
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    border: 2px dashed #bae6fd;
    width: 100%;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.timer-guidance h4 {
    color: #0369a1;
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.timer-guidance p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.timer-step-indicator {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 5px 0;
}

.indicator-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.indicator-step.active {
    background: var(--color-primary);
    border-color: #bae6fd;
    color: white;
    transform: scale(1.2);
    box-shadow: 0 4px 10px var(--color-primary-glow);
}

.indicator-step.completed {
    background: var(--color-normal);
    border-color: #a7f3d0;
    color: white;
}

.timer-controls {
    justify-content: center;
}

.timer-controls button {
    min-width: 130px;
}

/* ==========================================================================
   Brushing Steps Guide
   ========================================================================== */
.brushing-steps-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin-top: 10px;
}

.step-card {
    background: white;
    border: 2px solid #e0f2fe;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    transition: var(--transition-normal);
    box-shadow: 0 4px 10px rgba(14,165,233,0.02);
}

.step-card.active {
    border-color: var(--color-normal);
    background: #f0fdf4;
    transform: scale(1.02);
    box-shadow: 0 8px 20px var(--color-normal-glow);
}

.step-card.active::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 3px solid var(--color-normal);
    border-radius: var(--radius-md);
    animation: cardPulse 2s infinite;
    pointer-events: none;
}

@keyframes cardPulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.015); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.8; }
}

.step-badge {
    position: absolute;
    top: -10px;
    left: 16px;
    background: #bae6fd;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1.5px solid white;
    font-family: 'Fredoka', sans-serif;
}

.step-card.active .step-badge {
    background: #a7f3d0;
    color: #065f46;
}

.step-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    animation: wobbleSlow 3s ease-in-out infinite;
}

.step-card.active .step-icon {
    animation: brushShake 0.5s ease-in-out infinite alternate;
}

@keyframes wobbleSlow {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(8deg); }
}

@keyframes brushShake {
    0% { transform: rotate(-5deg) translateY(-2px); }
    100% { transform: rotate(10deg) translateY(2px); }
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-content h6 {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0369a1;
}

.step-card.active .step-content h6 {
    color: #047857;
}

.step-content p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* ==========================================================================
   Celebration Modal & Confetti
   ========================================================================== */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 20px;
}

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

.celebration-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 3px solid #bae6fd;
    padding: 35px 24px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.celebration-overlay.active .celebration-card {
    transform: scale(1) translateY(0);
}

.celebration-crown {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 5px;
    animation: floatCrown 2s ease-in-out infinite;
}

@keyframes floatCrown {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

.celebration-tooth {
    font-size: 4.5rem;
    line-height: 1;
    margin-bottom: 15px;
    animation: happyTooth 1.2s ease-in-out infinite alternate;
}

@keyframes happyTooth {
    0% { transform: scale(1) rotate(-5deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

.celebration-card h2 {
    font-size: 1.8rem;
    color: #0369a1;
    margin-bottom: 12px;
}

.celebration-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 15px;
}

.celebration-confetti-anchor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.confetti-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    opacity: 0.85;
}

@keyframes fallAndSpin {
    0% {
        transform: translateY(-50px) rotate(0deg) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(720deg) translateX(var(--wind));
        opacity: 0;
    }
}

/* ==========================================================================
   Bottom Navigation Bar
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-card);
    padding: 10px 15px;
    border-radius: 40px;
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.15);
    border: 2px solid var(--border-color);
    z-index: 1000;
    width: 92%;
    max-width: 460px; /* Slightly wider for 4 buttons */
}

.bottom-nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    transition: var(--transition-normal);
}

.bottom-nav-btn svg {
    width: 22px;
    height: 22px;
    transition: var(--transition-normal);
}

.bottom-nav-btn span {
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
}

.bottom-nav-btn:hover {
    color: var(--color-primary);
}

.bottom-nav-btn.active {
    color: var(--color-primary);
}

.bottom-nav-btn.active svg {
    transform: translateY(-4px);
    stroke: var(--color-primary);
}

/* Tab Views */
.bottom-tab-content {
    display: none;
    width: 100%;
    animation: tabFadeIn 0.4s ease-out;
}

.bottom-tab-content.active {
    display: block;
}

/* ==========================================================================
   Profile & Settings View
   ========================================================================== */
.profile-layout-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px; /* space for bottom nav */
}

.profile-card {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 24px;
}

.profile-avatar-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bae6fd, #e0f2fe);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    border: 4px solid white;
    box-shadow: 0 8px 16px var(--color-primary-glow);
    margin-bottom: 10px;
}

.profile-info-text h3 {
    font-size: 1.8rem;
    color: var(--color-primary);
}

.profile-status-tag {
    display: inline-block;
    background: #fef3c7;
    color: #d97706;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 8px;
    border: 2px solid #fde68a;
}

.settings-card {
    padding: 24px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.settings-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-inline-action {
    display: flex;
    gap: 10px;
}

#input-username {
    flex-grow: 1;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-fast);
}

#input-username:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.theme-buttons-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-btn {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 16px;
    font-weight: 600;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.theme-btn.active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
    box-shadow: 0 4px 10px var(--color-primary-glow);
}

.theme-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
}

/* Certificate Modal Specific */
.certificate-card {
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="%23fff" /><circle cx="50" cy="50" r="40" fill="%23fef3c7" opacity="0.3" /></svg>') center/cover;
    border: 4px solid #fbbf24;
}

.cert-ribbon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.cert-name-text {
    font-size: 2rem;
    color: #b45309;
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 15px;
    border-bottom: 2px dashed #fcd34d;
    padding-bottom: 5px;
    display: inline-block;
}

.cert-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 500;
}

.cert-signature-row {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    border-top: 1px solid #fef3c7;
    padding-top: 15px;
}

.signature-block {
    text-align: center;
}

.close-cert-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

.close-cert-btn:hover {
    color: #ef4444;
}

/* ==========================================================================
   Stats Chart View
   ========================================================================== */
.stats-chart-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 150px;
    padding-top: 20px;
    margin: 15px 0;
    border-bottom: 2px solid var(--border-color);
}

.chart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 30%;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-wrapper {
    width: 40px;
    height: 100%;
    display: flex;
    align-items: flex-end;
    background: #f1f5f9;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.chart-bar {
    width: 100%;
    border-radius: 20px 20px 0 0;
    position: relative;
    animation: barGrow 1s ease-out forwards;
    transform-origin: bottom;
}

@keyframes barGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

.bar-age3 { background: linear-gradient(0deg, #f59e0b, #fbbf24); }
.bar-age5 { background: linear-gradient(0deg, #ef4444, #f87171); }
.bar-age12 { background: linear-gradient(0deg, #10b981, #34d399); }

.chart-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-tip {
    background: #fffbeb;
    border: 1px dashed #fcd34d;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #92400e;
    margin-top: 10px;
}

/* ==========================================================================
   Premium Brushing Calendar
   ========================================================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.calendar-day {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    background: white;
    border: 2px solid #bae6fd;
    border-radius: 12px;
    color: #0ea5e9;
    padding: 10px 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    transition: var(--transition-fast);
    box-shadow: 0 4px 6px rgba(14,165,233,0.03);
}

.calendar-day span {
    font-size: 1rem;
    color: #cbd5e1;
    transition: var(--transition-fast);
}

.calendar-day.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(245,158,11,0.15);
}

.calendar-day.active span {
    color: #f59e0b;
}

/* ==========================================================================
   AI Dentist Chatroom
   ========================================================================== */
.chat-messages-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 180px;
    overflow-y: auto;
    border: 2px solid #bae6fd;
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #f0f9ff;
    margin-bottom: 12px;
    scroll-behavior: smooth;
}

.chat-msg {
    max-width: 82%;
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.45;
    word-break: break-word;
}

.chat-msg.doctor {
    background: white;
    border: 1.5px solid #bae6fd;
    color: var(--text-primary);
    border-radius: 16px 16px 16px 4px;
    align-self: flex-start;
    box-shadow: 0 4px 8px rgba(0,0,0,0.02);
}

.chat-msg.user {
    background: var(--color-primary-light);
    border: 1.5px solid #bae6fd;
    color: #0369a1;
    border-radius: 16px 16px 4px 16px;
    align-self: flex-end;
    box-shadow: 0 4px 8px var(--color-primary-glow);
}

/* ==========================================================================
   Multi-Theme Coloring Support (Teddy Bear & Cloud Patterns)
   ========================================================================== */

/* 1. Teddy Pink Theme - Girls' Tone 🧸🌸 (Premium Only) */
body.theme-pink-bear {
    --bg-light: #fff1f2;
    --bg-card: rgba(255, 255, 255, 0.98);
    --border-color: rgba(244, 63, 94, 0.15);
    --color-primary: #ec4899;
    --color-primary-light: #fce7f3;
    --color-primary-glow: rgba(236, 72, 153, 0.25);
    
    /* Subtle pink check pattern */
    background-image: radial-gradient(rgba(244, 63, 94, 0.1) 1.5px, transparent 1.5px), radial-gradient(rgba(244, 63, 94, 0.1) 1.5px, #fff1f2 1.5px);
    background-size: 32px 32px;
    background-position: 0 0, 16px 16px;
}
body.theme-pink-bear .cloud {
    background: rgba(253, 242, 248, 0.7);
}
body.theme-pink-bear .cloud::before, body.theme-pink-bear .cloud::after {
    background: rgba(253, 242, 248, 0.7);
}
body.theme-pink-bear .cloud-1::after {
    content: "🧸";
    font-size: 2.2rem;
    background: none;
    width: auto; height: auto; top: -30px; right: -10px;
}
body.theme-pink-bear .cloud-2::after {
    content: "🧸🌸";
    font-size: 2.8rem;
    background: none;
    width: auto; height: auto; top: -40px; right: -20px;
}
body.theme-pink-bear .cloud-3::after {
    content: "🧸☁️";
    font-size: 2.0rem;
    background: none;
    width: auto; height: auto; top: -25px; right: -10px;
}

/* 2. Lavender Clouds - Girls' Tone ☁️🦄 (Premium Only) */
body.theme-lavender-clouds {
    --bg-light: #faf5ff;
    --bg-card: rgba(255, 255, 255, 0.98);
    --border-color: rgba(139, 92, 246, 0.15);
    --color-primary: #8b5cf6;
    --color-primary-light: #f3e8ff;
    --color-primary-glow: rgba(139, 92, 246, 0.25);
    
    background-image: radial-gradient(rgba(139, 92, 246, 0.08) 1.5px, transparent 1.5px), radial-gradient(rgba(139, 92, 246, 0.08) 1.5px, #faf5ff 1.5px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}
body.theme-lavender-clouds .cloud {
    background: rgba(243, 232, 255, 0.7);
}
body.theme-lavender-clouds .cloud::before, body.theme-lavender-clouds .cloud::after {
    background: rgba(243, 232, 255, 0.7);
}
body.theme-lavender-clouds .cloud-1::after {
    content: "🦄";
    font-size: 2.2rem;
    background: none;
    width: auto; height: auto; top: -30px; right: -10px;
}
body.theme-lavender-clouds .cloud-2::after {
    content: "☁️🌟";
    font-size: 2.8rem;
    background: none;
    width: auto; height: auto; top: -40px; right: -20px;
}
body.theme-lavender-clouds .cloud-3::after {
    content: "🧸💜";
    font-size: 2.0rem;
    background: none;
    width: auto; height: auto; top: -25px; right: -10px;
}

/* 3. Polar Blue Bear - Boys' Tone 🧸❄️ (Premium Only) */
body.theme-blue-bear {
    --bg-light: #f0f9ff;
    --bg-card: rgba(255, 255, 255, 0.98);
    --border-color: rgba(14, 165, 233, 0.15);
    --color-primary: #0284c7;
    --color-primary-light: #e0f2fe;
    --color-primary-glow: rgba(14, 165, 233, 0.25);
    
    background-image: radial-gradient(rgba(14, 165, 233, 0.08) 1.5px, transparent 1.5px), radial-gradient(rgba(14, 165, 233, 0.08) 1.5px, #f0f9ff 1.5px);
    background-size: 32px 32px;
    background-position: 0 0, 16px 16px;
}
body.theme-blue-bear .cloud {
    background: rgba(224, 242, 254, 0.7);
}
body.theme-blue-bear .cloud::before, body.theme-blue-bear .cloud::after {
    background: rgba(224, 242, 254, 0.7);
}
body.theme-blue-bear .cloud-1::after {
    content: "🐻‍❄️";
    font-size: 2.2rem;
    background: none;
    width: auto; height: auto; top: -30px; right: -10px;
}
body.theme-blue-bear .cloud-2::after {
    content: "🧸❄️";
    font-size: 2.8rem;
    background: none;
    width: auto; height: auto; top: -40px; right: -20px;
}
body.theme-blue-bear .cloud-3::after {
    content: "🐻☁️";
    font-size: 2.0rem;
    background: none;
    width: auto; height: auto; top: -25px; right: -10px;
}

/* 4. Minty Clouds - Boys' Tone ☁️🍏 (Premium Only) */
body.theme-mint-clouds {
    --bg-light: #ecfdf4;
    --bg-card: rgba(255, 255, 255, 0.98);
    --border-color: rgba(16, 185, 129, 0.15);
    --color-primary: #10b981;
    --color-primary-light: #d1fae5;
    --color-primary-glow: rgba(16, 185, 129, 0.25);
    
    background-image: radial-gradient(rgba(16, 185, 129, 0.08) 1.5px, transparent 1.5px), radial-gradient(rgba(16, 185, 129, 0.08) 1.5px, #ecfdf4 1.5px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}
body.theme-mint-clouds .cloud {
    background: rgba(209, 250, 229, 0.7);
}
body.theme-mint-clouds .cloud::before, body.theme-mint-clouds .cloud::after {
    background: rgba(209, 250, 229, 0.7);
}
body.theme-mint-clouds .cloud-1::after {
    content: "☁️";
    font-size: 2.2rem;
    background: none;
    width: auto; height: auto; top: -30px; right: -10px;
}
body.theme-mint-clouds .cloud-2::after {
    content: "☁️🍏";
    font-size: 2.8rem;
    background: none;
    width: auto; height: auto; top: -40px; right: -20px;
}
body.theme-mint-clouds .cloud-3::after {
    content: "🐸💚";
    font-size: 2.0rem;
    background: none;
    width: auto; height: auto; top: -25px; right: -10px;
}

/* Base Theme Color Overrides for elements */
body.theme-pink-bear h1, body.theme-pink-bear .brand h1, body.theme-pink-bear .panel-title, body.theme-pink-bear .welcome-banner h2, body.theme-pink-bear .timer-time, body.theme-pink-bear .celebration-card h2, body.theme-pink-bear .stats-card .panel-title span {
    color: #9d174d !important;
}
body.theme-lavender-clouds h1, body.theme-lavender-clouds .brand h1, body.theme-lavender-clouds .panel-title, body.theme-lavender-clouds .welcome-banner h2, body.theme-lavender-clouds .timer-time, body.theme-lavender-clouds .celebration-card h2, body.theme-lavender-clouds .stats-card .panel-title span {
    color: #6d28d9 !important;
}
body.theme-blue-bear h1, body.theme-blue-bear .brand h1, body.theme-blue-bear .panel-title, body.theme-blue-bear .welcome-banner h2, body.theme-blue-bear .timer-time, body.theme-blue-bear .celebration-card h2, body.theme-blue-bear .stats-card .panel-title span {
    color: #0369a1 !important;
}
body.theme-mint-clouds h1, body.theme-mint-clouds .brand h1, body.theme-mint-clouds .panel-title, body.theme-mint-clouds .welcome-banner h2, body.theme-mint-clouds .timer-time, body.theme-mint-clouds .celebration-card h2, body.theme-mint-clouds .stats-card .panel-title span {
    color: #047857 !important;
}

/* Button & Logo backgrounds per theme */
body.theme-pink-bear .logo-icon { background: linear-gradient(135deg, #fb7185, #ec4899); box-shadow: 0 8px 16px rgba(236, 72, 153, 0.25); }
body.theme-lavender-clouds .logo-icon { background: linear-gradient(135deg, #c084fc, #8b5cf6); box-shadow: 0 8px 16px rgba(139, 92, 246, 0.25); }
body.theme-blue-bear .logo-icon { background: linear-gradient(135deg, #38bdf8, #0284c7); box-shadow: 0 8px 16px rgba(2, 132, 199, 0.25); }
body.theme-mint-clouds .logo-icon { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 8px 16px rgba(16, 185, 129, 0.25); }

body.theme-pink-bear .btn-primary { background: linear-gradient(135deg, #ec4899, #be123c); box-shadow: 0 6px 15px rgba(236, 72, 153, 0.25); }
body.theme-lavender-clouds .btn-primary { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 6px 15px rgba(139, 92, 246, 0.25); }
body.theme-blue-bear .btn-primary { background: linear-gradient(135deg, #0ea5e9, #0369a1); box-shadow: 0 6px 15px rgba(14, 165, 233, 0.25); }
body.theme-mint-clouds .btn-primary { background: linear-gradient(135deg, #10b981, #047857); box-shadow: 0 6px 15px rgba(16, 185, 129, 0.25); }

body.theme-pink-bear .bottom-nav-btn.active, body.theme-pink-bear .bottom-nav-btn.active svg { color: #ec4899; stroke: #ec4899; }
body.theme-lavender-clouds .bottom-nav-btn.active, body.theme-lavender-clouds .bottom-nav-btn.active svg { color: #8b5cf6; stroke: #8b5cf6; }
body.theme-blue-bear .bottom-nav-btn.active, body.theme-blue-bear .bottom-nav-btn.active svg { color: #0284c7; stroke: #0284c7; }
body.theme-mint-clouds .bottom-nav-btn.active, body.theme-mint-clouds .bottom-nav-btn.active svg { color: #10b981; stroke: #10b981; }

body.theme-pink-bear .indicator-step.active { background: #ec4899; }
body.theme-lavender-clouds .indicator-step.active { background: #8b5cf6; }
body.theme-blue-bear .indicator-step.active { background: #0284c7; }
body.theme-mint-clouds .indicator-step.active { background: #10b981; }

/* extra layouts */
.welcome-banner {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.04);
}

.welcome-banner h2 {
    font-family: 'Fredoka', sans-serif;
    color: var(--color-primary);
    font-size: 1.4rem;
}

.bottom-tab-content {
    padding-bottom: 100px; /* space for bottom nav bar */
}

/* Avatar Accessories styling */
.profile-avatar-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.profile-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-accessory {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.avatar-accessory.acc-crown {
    top: -22px;
    font-size: 2.4rem;
    left: 50%;
    transform: translateX(-50%);
}
.avatar-accessory.acc-sunglasses {
    top: 10px;
    font-size: 1.6rem;
    left: 50%;
    transform: translateX(-50%);
}
.avatar-accessory.acc-hat {
    top: -26px;
    font-size: 2.6rem;
    left: 50%;
    transform: translateX(-50%);
}
.avatar-accessory.acc-ribbon {
    top: -12px;
    right: -10px;
    font-size: 1.8rem;
}

/* Dentist call simulation styles */
.call-pulse-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 98px;
    height: 98px;
    border-radius: 50%;
    border: 4px solid var(--color-primary);
    animation: ringPulse 2s ease-out infinite;
    pointer-events: none;
}
@keyframes ringPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.voice-wave-container .wave-bar {
    width: 4px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 2px;
    animation: waveHeight 1.2s ease-in-out infinite;
}
.voice-wave-container .wave-bar:nth-child(1) { animation-delay: 0.1s; }
.voice-wave-container .wave-bar:nth-child(2) { animation-delay: 0.3s; }
.voice-wave-container .wave-bar:nth-child(3) { animation-delay: 0.5s; }
.voice-wave-container .wave-bar:nth-child(4) { animation-delay: 0.2s; }
.voice-wave-container .wave-bar:nth-child(5) { animation-delay: 0.4s; }
@keyframes waveHeight {
    0%, 100% { height: 10px; }
    50% { height: 35px; }
}

/* Clinic Ticket styling */
.clinic-ticket {
    border: 2px solid #fed7aa;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(251, 146, 60, 0.08);
    animation: slideDownTicket 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideDownTicket {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
.ticket-header {
    background: linear-gradient(90deg, #ffedd5, #fed7aa);
    color: #c2410c;
    padding: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    letter-spacing: 1px;
}

.accessory-btn {
    transition: var(--transition-fast);
}
.accessory-btn:hover {
    transform: scale(1.05);
}
.accessory-btn.active {
    background: var(--color-primary-light) !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
    font-weight: bold;
}

