/* Premium Minimalist Design - Dark Blue + Platinum */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Premium Color Palette */
    --bg-primary: #0a0e1a;
    --bg-secondary: #141b2e;
    --bg-tertiary: #1a2338;
    --bg-message: #1e2740;
    
    --accent-platinum: #e5e5ea;
    --accent-platinum-dim: #b8b8c0;
    --accent-glow: rgba(229, 229, 234, 0.15);
    
    --text-primary: #f8f8fa;
    --text-secondary: #7a7a85;
    --text-tertiary: #5a5a65;
    
    --border-subtle: rgba(229, 229, 234, 0.08);
    --border-medium: rgba(229, 229, 234, 0.12);
    
    --shadow-soft: 0 2px 16px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-strong: 0 8px 40px rgba(0, 0, 0, 0.6);
    
    /* Animation Timings */
    --timing-fast: 0.2s;
    --timing-medium: 0.4s;
    --timing-slow: 0.6s;
    --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Subtle background pattern */
#app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(229, 229, 234, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(229, 229, 234, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.header {
    background: rgba(20, 27, 46, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    animation: slideDown var(--timing-slow) var(--easing-smooth);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-platinum) 50%, 
        transparent 100%);
    opacity: 0.3;
}

.header-content h1 {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-family: 'SF Pro Display', -apple-system, sans-serif;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.subscription-badge {
    background: rgba(229, 229, 234, 0.06);
    backdrop-filter: blur(10px);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-subtle);
    color: var(--accent-platinum);
    transition: all var(--timing-medium) var(--easing-smooth);
}

.subscription-badge:hover {
    background: rgba(229, 229, 234, 0.1);
    border-color: var(--border-medium);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
    scroll-behavior: smooth;
}

.welcome-message {
    text-align: center;
    padding: 60px 32px;
    color: var(--text-secondary);
    animation: fadeIn var(--timing-slow) var(--easing-smooth);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.welcome-message h2 {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.welcome-message p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* Messages */
.message {
    display: flex;
    gap: 14px;
    animation: messageSlide var(--timing-slow) var(--easing-smooth);
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    color: var(--accent-platinum);
    font-weight: 300;
    transition: all var(--timing-medium) var(--easing-smooth);
}

.message-avatar:hover {
    border-color: var(--accent-platinum);
    box-shadow: 0 0 20px var(--accent-glow);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, rgba(229, 229, 234, 0.15) 0%, rgba(229, 229, 234, 0.08) 100%);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, rgba(229, 229, 234, 0.1) 0%, rgba(229, 229, 234, 0.05) 100%);
}

.message-content {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.7;
    word-wrap: break-word;
    transition: all var(--timing-medium) var(--easing-smooth);
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(229, 229, 234, 0.12) 0%, rgba(229, 229, 234, 0.08) 100%);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--bg-message);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 4px;
}

.message-content:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-soft);
}

/* Input Area */
.input-area {
    padding: 20px 28px 28px;
    background: rgba(20, 27, 46, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    animation: slideUp var(--timing-slow) var(--easing-smooth);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-platinum) 50%, 
        transparent 100%);
    opacity: 0.3;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--bg-tertiary);
    border-radius: 24px;
    padding: 12px 12px 12px 24px;
    border: 1px solid var(--border-subtle);
    transition: all var(--timing-medium) var(--easing-smooth);
}

.input-container:focus-within {
    border-color: var(--accent-platinum-dim);
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-medium);
    background: rgba(30, 39, 64, 0.9);
}

#message-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    max-height: 120px;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 300;
}

#message-input::placeholder {
    color: var(--text-tertiary);
}

.send-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: linear-gradient(135deg, rgba(229, 229, 234, 0.12) 0%, rgba(229, 229, 234, 0.08) 100%);
    color: var(--accent-platinum);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--timing-medium) var(--easing-smooth);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.send-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--accent-glow);
    transform: translate(-50%, -50%);
    transition: width var(--timing-medium) var(--easing-smooth), 
                height var(--timing-medium) var(--easing-smooth);
}

.send-button:hover:not(:disabled)::before {
    width: 100%;
    height: 100%;
}

.send-button:hover:not(:disabled) {
    border-color: var(--accent-platinum);
    box-shadow: 0 0 24px var(--accent-glow), var(--shadow-medium);
    transform: scale(1.05);
}

.send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.send-button svg {
    position: relative;
    z-index: 1;
    transition: transform var(--timing-fast) var(--easing-smooth);
}

.send-button:hover:not(:disabled) svg {
    transform: translateX(2px);
}

.send-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 39, 64, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-strong);
    animation: fadeIn var(--timing-medium) var(--easing-smooth);
}

.typing-dots {
    display: flex;
    gap: 6px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-platinum);
    animation: typing 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-12px);
        opacity: 1;
    }
}

.loading-indicator p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* Scrollbar */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
    transition: background var(--timing-fast);
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-platinum-dim);
}

/* Responsive */
@media (max-width: 480px) {
    .header {
        padding: 20px 20px;
    }
    
    .header-content h1 {
        font-size: 26px;
    }
    
    .chat-container {
        padding: 24px 20px;
    }
    
    .input-area {
        padding: 16px 20px 24px;
    }
    
    .message-content {
        max-width: 80%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
