/**
 * Bank Chatbot - Modern Styles
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

:root {
    /* Core Colors (Shared) */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #10b981;
    --error: #ef4444;

    /* Light Theme (Default) */
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-light: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --message-bot-bg: #ffffff;
    --message-bot-border: #e2e8f0;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --message-bot-bg: #1e293b;
    --message-bot-border: #334155;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    max-height: 800px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.bank-logo {
    flex-shrink: 0;
}

.header-info h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: var(--spacing-xs);
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}


.status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    background: var(--background);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--surface);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* Message */
.message {
    display: flex;
    gap: var(--spacing-md);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
    align-self: flex-end;
    max-width: 80%;
}

.bot-message {
    align-self: flex-start;
    max-width: 85%;
}

.message-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.user-message .message-content {
    align-items: flex-end;
}

.message-bubble {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: var(--spacing-xs);
}

.bot-message .message-bubble {
    background: var(--message-bot-bg);
    color: var(--text-primary);
    border: 1px solid var(--message-bot-border);
    border-bottom-left-radius: var(--spacing-xs);
}

.error-message .message-bubble {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: #fca5a5;
}

.message-bubble ul {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
}

.message-bubble li {
    margin: var(--spacing-xs) 0;
}

.message-bubble p {
    margin: var(--spacing-sm) 0;
}

.message-bubble p:first-child {
    margin-top: 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 var(--spacing-sm);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    background: var(--background);
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: var(--spacing-xs);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s 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.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.chat-input {
    padding: var(--spacing-lg);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.send-button {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
}

.send-button svg {
    width: 20px;
    height: 20px;
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05);
}

.send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Suggested Prompts Redesign */
.suggested-container {
    margin: var(--spacing-lg) 0;
    padding-left: 48px;
    /* Align with bot message bubble content */
    animation: fadeIn 0.5s ease-out;
}

.suggested-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.suggested-header svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.quick-prompts {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    max-width: 450px;
}

.quick-prompt {
    background: var(--surface-light);
    border: 1px solid var(--border);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.quick-prompt:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.quick-prompt-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9125rem;
    /*font-size: 1rem;*/
}

.quick-prompt-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .chat-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .user-message,
    .bot-message {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: var(--spacing-md);
    }

    .header-info h1 {
        font-size: 1.125rem;
    }

    .chat-messages {
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }

    .message-bubble {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.875rem;
    }

    .chat-input {
        padding: var(--spacing-sm);
    }

    .input-wrapper {
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: var(--spacing-sm);
        border-radius: var(--radius-md);
    }

    #messageInput {
        font-size: 0.875rem;
    }

    .send-button {
        width: 32px;
        height: 32px;
    }

    .send-button svg {
        width: 16px;
        height: 16px;
    }
}