/**
 * Lumi Enhanced Design System
 * 
 * Premium UI with glassmorphism, gradients, and micro-animations
 */

:root {
    /* Primary Brand Gradient */
    --lumi-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --lumi-gradient-blue: linear-gradient(135deg, #0EA5E9 0%, #3B82F6 100%);
    --lumi-gradient-purple: linear-gradient(135deg, #8B5CF6 0%, #D946EF 100%);
    --lumi-gradient-warm: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    --lumi-gradient-green: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --glass-blur: blur(12px);

    /* Modern Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.18);
    --shadow-glow-blue: 0 0 40px rgba(59, 130, 246, 0.4);
    --shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.4);

    /* Animation Timings */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================================
   Base Styles
   ============================================================================ */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* ============================================================================
   Card Styles - Premium Glass Effect
   ============================================================================ */

.lumi-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.lumi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.lumi-card-dark {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(71, 85, 105, 0.3);
}

.lumi-card-light {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(226, 232, 240, 0.6);
}

/* ============================================================================
   Button Styles
   ============================================================================ */

.lumi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.lumi-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lumi-btn:hover::before {
    opacity: 1;
}

.lumi-btn-primary {
    background: var(--lumi-gradient-blue);
    color: white;
    border: none;
    box-shadow: var(--shadow-md), 0 0 20px rgba(59, 130, 246, 0.3);
}

.lumi-btn-primary:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
    transform: translateY(-1px);
}

.lumi-btn-primary:active {
    transform: translateY(0);
}

.lumi-btn-secondary {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    backdrop-filter: blur(8px);
}

.lumi-btn-secondary:hover {
    background: rgba(100, 116, 139, 0.3);
    border-color: rgba(100, 116, 139, 0.5);
}

.lumi-btn-ghost {
    background: transparent;
    color: #94a3b8;
    border: none;
}

.lumi-btn-ghost:hover {
    background: rgba(100, 116, 139, 0.15);
    color: #f8fafc;
}

.lumi-btn-glow {
    animation: btn-glow 2s ease-in-out infinite;
}

@keyframes btn-glow {

    0%,
    100% {
        box-shadow: var(--shadow-md), 0 0 20px rgba(59, 130, 246, 0.3);
    }

    50% {
        box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

/* ============================================================================
   Input Styles
   ============================================================================ */

.lumi-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 12px;
    color: #f8fafc;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    backdrop-filter: blur(8px);
}

.lumi-input::placeholder {
    color: #64748b;
}

.lumi-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 0 20px rgba(59, 130, 246, 0.15);
}

.lumi-input-light {
    background: rgba(248, 250, 252, 0.9);
    border-color: rgba(203, 213, 225, 0.6);
    color: #0f172a;
}

.lumi-input-light:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ============================================================================
   Phone Frame - Premium Design
   ============================================================================ */

.phone-frame {
    position: relative;
    width: 100%;
    max-width: 390px;
    height: 844px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 50px;
    padding: 12px;
    box-shadow:
        0 0 0 2px rgba(100, 116, 139, 0.3),
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 2px 10px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background: #0f172a;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-radius: 40px;
    overflow: hidden;
    position: relative;
}

/* ============================================================================
   Status Bar
   ============================================================================ */

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, transparent 100%);
    position: relative;
    z-index: 5;
}

.status-bar-time {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.status-bar-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
}

/* ============================================================================
   Chat Interface
   ============================================================================ */

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 200px);
    padding: 12px;
    gap: 12px;
    overflow-y: auto;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9375rem;
    line-height: 1.4;
    animation: bubble-in 0.3s var(--transition-spring);
}

@keyframes bubble-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-bubble-user {
    align-self: flex-start;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: #e2e8f0;
    border-bottom-left-radius: 6px;
}

.chat-bubble-me {
    align-self: flex-end;
    background: var(--lumi-gradient-blue);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.chat-bubble-agent {
    align-self: flex-end;
    background: var(--lumi-gradient-purple);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* ============================================================================
   Keyboard Styles
   ============================================================================ */

.keyboard-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    padding: 8px 4px 24px;
}

.keyboard-container.agent-mode {
    background: linear-gradient(180deg, #1e3a5f 0%, #0c1929 100%);
    border-top-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 -10px 30px rgba(59, 130, 246, 0.15);
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 8px;
}

.keyboard-key {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 42px;
    padding: 0 12px;
    background: rgba(71, 85, 105, 0.4);
    border: none;
    border-radius: 8px;
    color: #f8fafc;
    font-size: 1.125rem;
    font-weight: 400;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.keyboard-key:hover {
    background: rgba(100, 116, 139, 0.5);
}

.keyboard-key:active {
    transform: scale(0.95);
    background: rgba(100, 116, 139, 0.6);
}

.keyboard-key-space {
    flex: 1;
    max-width: 200px;
    background: rgba(100, 116, 139, 0.3);
}

.keyboard-key-special {
    background: rgba(51, 65, 85, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.keyboard-key-send {
    background: var(--lumi-gradient-blue);
    color: white;
    min-width: 60px;
}

.keyboard-key-send:hover {
    box-shadow: var(--shadow-glow-blue);
}

/* Agent Mode Key Styles */
.agent-mode .keyboard-key {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.agent-mode .keyboard-key:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
}

.agent-mode .keyboard-key-space {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    animation: space-pulse 2s ease-in-out infinite;
}

@keyframes space-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    }
}

/* ============================================================================
   Input Bar
   ============================================================================ */

.input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 20px;
    margin: 0 8px 8px;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.input-bar.agent-mode {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.input-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 0.9375rem;
    outline: none;
}

.input-bar input::placeholder {
    color: #64748b;
}

/* ============================================================================
   Loading & Animations
   ============================================================================ */

.loading-dots {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Shimmer Effect */
.shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Pulse Ring */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.5);
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ============================================================================
   Header & Navigation
   ============================================================================ */

.lumi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.lumi-header-light {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(226, 232, 240, 0.8);
}

.lumi-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lumi-logo img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.lumi-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--lumi-gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.5);
    padding: 3px;
    gap: 2px;
}

.mode-toggle button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: transparent;
    color: #94a3b8;
}

.mode-toggle button:hover {
    color: #e2e8f0;
    background: rgba(71, 85, 105, 0.3);
}

.mode-toggle button.active {
    color: white;
}

.mode-toggle button.active.keyboard {
    background: var(--lumi-gradient-blue);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.mode-toggle button.active.app {
    background: var(--lumi-gradient-purple);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

/* ============================================================================
   Badges & Tags
   ============================================================================ */

.lumi-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.lumi-badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.lumi-badge-purple {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.lumi-badge-green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.lumi-badge-amber {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.lumi-badge-red {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================================
   Tooltips
   ============================================================================ */

.lumi-tooltip {
    position: relative;
}

.lumi-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    font-size: 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.lumi-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ============================================================================
   Modal & Overlay
   ============================================================================ */

.lumi-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in 0.2s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lumi-modal {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 20px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: modal-in 0.3s var(--transition-spring);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.lumi-modal-light {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(226, 232, 240, 0.8);
}

/* ============================================================================
   Progress & Indicators
   ============================================================================ */

.lumi-progress {
    height: 6px;
    background: rgba(71, 85, 105, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.lumi-progress-bar {
    height: 100%;
    background: var(--lumi-gradient-blue);
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
}

.lumi-progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: progress-shine 1.5s ease-in-out infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

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

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

.bg-gradient-subtle {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.border-glow {
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.border-glow-purple {
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

/* ============================================================================
   Responsive Adjustments
   ============================================================================ */

@media (max-width: 640px) {
    .phone-frame {
        border-radius: 40px;
        padding: 8px;
        height: auto;
        min-height: 700px;
    }

    .phone-screen {
        border-radius: 32px;
    }

    .lumi-header {
        padding: 12px 16px;
    }

    .mode-toggle button span {
        display: none;
    }
}

/* ============================================================================
   Dark/Light Theme Utilities
   ============================================================================ */

/* Dark theme card styling */
.dark .lumi-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(71, 85, 105, 0.3);
}

/* Light theme card styling */
.light .lumi-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(226, 232, 240, 0.6);
}

/* Light theme input styling */
.light .lumi-input {
    background: rgba(248, 250, 252, 0.9);
    border-color: rgba(203, 213, 225, 0.6);
    color: #0f172a;
}