/* ============================================
   DMOS AI - Design System
   Version: 3.1.0 - Caddy Coaching System
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Background layers */
    --bg-deepest: #050506;
    --bg-deep: #0A0A0B;
    --bg-base: #111113;
    --bg-elevated: #1A1A1F;
    --bg-hover: #222228;
    
    /* Borders */
    --border-subtle: #1A1A1F;
    --border-default: #2A2A33;
    --border-strong: #3A3A44;
    
    /* Text hierarchy */
    --text-primary: #F5F5F7;
    --text-secondary: #8A8A93;
    --text-tertiary: #5C5C66;
    --text-muted: #3A3A44;
    
    /* Accent colors */
    --accent-blue: #3B82F6;
    --accent-blue-hover: #2563EB;
    --accent-blue-glow: rgba(59, 130, 246, 0.15);
    --accent-blue-muted: rgba(59, 130, 246, 0.1);
    
    --accent-green: #22C55E;
    --accent-green-glow: rgba(34, 197, 94, 0.15);
    
    --accent-amber: #F59E0B;
    --accent-amber-glow: rgba(245, 158, 11, 0.15);
    
    --accent-red: #EF4444;
    --accent-red-glow: rgba(239, 68, 68, 0.15);
    
    --accent-purple: #8B5CF6;
    --accent-purple-glow: rgba(139, 92, 246, 0.15);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --gradient-hero: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --gradient-success: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 4px 20px rgba(59, 130, 246, 0.3);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 24px;
    --text-2xl: 32px;
    --text-3xl: 40px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Z-index layers */
    --z-base: 1;
    --z-elevated: 10;
    --z-sticky: 20;
    --z-overlay: 30;
    --z-modal: 40;
    --z-toast: 50;
    
    /* Layout */
    --header-height: 56px;
    --input-bar-height: 72px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-deep);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

@keyframes celebrationPop {
    0% { 
        opacity: 0; 
        transform: scale(0.8); 
    }
    50% { 
        transform: scale(1.05); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes confettiFall {
    0% { 
        transform: translateY(-100vh) rotate(0deg); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(100vh) rotate(720deg); 
        opacity: 0; 
    }
}

.animate-fade-in { animation: fadeIn var(--transition-base) forwards; }
.animate-fade-in-up { animation: fadeInUp var(--transition-slow) forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* ============================================
   LOGO
   ============================================ */
.logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    color: var(--bg-deep);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.logo-box-sm {
    width: 32px;
    height: 32px;
}

.logo-box-lg {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
}

.logo-box-xl {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    text-align: center;
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-md);
    color: var(--text-primary);
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-input-lg {
    padding: var(--space-lg) var(--space-xl);
    font-size: var(--text-lg);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-error {
    font-size: var(--text-sm);
    color: var(--accent-red);
    margin-top: var(--space-sm);
}

.form-input-code {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-align: center;
    background: var(--accent-blue-muted);
    border-color: var(--accent-blue);
}

/* ============================================
   SCREENS
   ============================================ */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
}

/* Loading Screen */
.screen-loading {
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.loading-content {
    text-align: center;
}

.loading-content .logo-box {
    margin: 0 auto var(--space-xl);
    animation: pulse 2s ease-in-out infinite;
}

.loading-text {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* ============================================
   AUTH SCREEN
   ============================================ */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.auth-header .logo-box {
    margin: 0 auto var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.auth-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-error {
    font-size: var(--text-sm);
    color: var(--accent-red);
    text-align: center;
    min-height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

.auth-footer-text {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.auth-footer-link {
    color: var(--accent-blue);
    font-weight: 600;
}

/* ============================================
   ONBOARDING SCREEN
   ============================================ */
.onboarding-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2xl);
}

.onboarding-progress {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-count {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    min-width: 40px;
    text-align: right;
}

.onboarding-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Caddy Message in Onboarding */
.onboarding-caddy {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.caddy-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.caddy-avatar-dot {
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
}

.caddy-bubble {
    flex: 1;
}

.caddy-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.caddy-text {
    font-size: var(--text-lg);
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.caddy-subtext {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-top: var(--space-sm);
}

.caddy-subtext a {
    color: var(--accent-blue);
}

/* Onboarding Inputs */
.onboarding-input-area {
    margin-top: var(--space-xl);
}

/* Option Buttons */
.option-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.option-btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-lg);
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    text-align: left;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.option-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}

.option-btn.selected {
    background: var(--accent-blue-muted);
    border-color: var(--accent-blue);
}

.option-text {
    flex: 1;
}

.option-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.option-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.option-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-default);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.option-btn.selected .option-check {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.option-btn.selected .option-check::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Multi-select Chips */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chip-btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.chip-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.chip-btn.selected {
    background: var(--accent-blue-muted);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Onboarding Actions */
.onboarding-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
}

.onboarding-actions .btn {
    flex: 1;
}

/* ============================================
   MAIN APP
   ============================================ */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.app-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-lg);
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    padding-top: env(safe-area-inset-top, 0);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-title {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Conversation Area */
.conversation-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-lg);
    padding-bottom: calc(var(--input-bar-height) + var(--space-lg) + var(--safe-area-bottom));
}

/* Message Bubbles */
.message {
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.3s ease forwards;
}

.message-ai {
    display: flex;
    gap: var(--space-md);
}

.message-avatar {
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar-dot {
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    border-radius: 50%;
}

.message-content {
    flex: 1;
    max-width: 85%;
}

.message-sender {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.message-bubble {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    border-top-left-radius: var(--radius-sm);
    padding: var(--space-lg);
}

.message-text {
    font-size: var(--text-md);
    color: var(--text-primary);
    line-height: 1.6;
    word-wrap: break-word;
}

.message-text a {
    color: var(--accent-blue);
    text-decoration: underline;
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-user .message-bubble {
    background: var(--accent-blue-muted);
    border-color: var(--accent-blue);
    border-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-sm);
    max-width: 85%;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    border-top-left-radius: var(--radius-sm);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Script Block */
.script-block {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 8px 0;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: fit-content;
    max-width: 100%;
    display: inline-block;
}

.script-block:hover {
    border-color: var(--accent-blue);
    background: var(--accent-blue-muted);
}

.script-text {
    font-size: var(--text-base);
    color: var(--text-primary);
    line-height: 1.4;
}

.script-hint {
    font-size: var(--text-xs);
    color: var(--accent-blue);
    font-weight: 500;
    margin-top: 4px;
}

/* Input Bar */
.input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md) var(--space-lg);
    padding-bottom: calc(var(--space-md) + var(--safe-area-bottom));
    background: var(--bg-base);
    border-top: 1px solid var(--border-subtle);
    z-index: var(--z-sticky);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    max-width: 600px;
    margin: 0 auto;
}

.input-field-wrapper {
    flex: 1;
    position: relative;
}

.input-field {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-md);
    color: var(--text-primary);
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    resize: none;
    max-height: 120px;
    transition: all var(--transition-fast);
}

.input-field::placeholder {
    color: var(--text-tertiary);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.btn-send {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    box-shadow: var(--shadow-glow-blue);
    transition: all var(--transition-fast);
    cursor: pointer;
    flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.btn-send:active:not(:disabled) {
    transform: scale(0.95);
}

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

/* ============================================
   PANELS
   ============================================ */
.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    z-index: var(--z-overlay);
}

.panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.slide-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    transition: transform var(--transition-slow);
}

.slide-panel-right {
    right: 0;
    transform: translateX(100%);
}

.slide-panel.open {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.panel-title {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-primary);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

/* Menu Items */
.menu-section {
    margin-bottom: var(--space-xl);
}

.menu-section-title {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: none;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-weight: 500;
    text-align: left;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.menu-item:hover {
    background: var(--bg-hover);
}

.menu-item-danger {
    color: var(--accent-red);
}

/* Stats in Menu */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal);
    padding: var(--space-lg);
    animation: fadeIn var(--transition-fast) forwards;
}

.modal-content {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    background: var(--bg-base);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeInUp var(--transition-base) forwards;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.modal-title {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: calc(var(--input-bar-height) + var(--space-lg) + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--text-primary);
    color: var(--bg-deep);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all var(--transition-slow);
    z-index: var(--z-toast);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================
   CELEBRATION
   ============================================ */
.celebration-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: var(--z-modal);
    padding: var(--space-lg);
}

.celebration-content {
    text-align: center;
    padding: var(--space-2xl);
    animation: celebrationPop 0.5s ease-out forwards;
}

.celebration-emoji {
    font-size: 72px;
    margin-bottom: var(--space-lg);
}

.celebration-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.celebration-message {
    font-size: var(--text-md);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s linear forwards;
}

/* ============================================
   10 SOLUTIONS
   ============================================ */
.solutions-grid {
    display: grid;
    gap: var(--space-sm);
}

.solution-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.solution-num {
    width: 28px;
    height: 28px;
    background: var(--text-primary);
    color: var(--bg-deep);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
}

.solution-info {
    flex: 1;
}

.solution-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.solution-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
    .conversation-area {
        max-width: 700px;
        margin: 0 auto;
    }
    
    .input-bar {
        padding-left: var(--space-xl);
        padding-right: var(--space-xl);
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}