/* ==========================================
   DESIGN SYSTEM & VARIABLES
   ========================================== */
:root {
    /* Color Palette */
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-sidebar: rgba(17, 24, 39, 0.75);
    --bg-card: rgba(31, 41, 55, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --accent-start: hsl(28, 100%, 55%); /* Bright Amber */
    --accent-end: hsl(16, 100%, 50%);   /* Deep Orange */
    --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Layout & Spacing */
    --sidebar-width: 360px;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    /* Animations & Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --glow-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
    --glass-blur: blur(16px);
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(249, 115, 22, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 40%);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.01em;
}

a {
    color: var(--accent-start);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-end);
    text-decoration: underline;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   LAYOUT STRUCTURE
   ========================================== */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
   SIDEBAR STYLE
   ========================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    z-index: 10;
}

.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.logo-wrapper h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Cooking Pot SVG / Icon Animation */
.cooking-pot-icon {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-shadow);
}

.cooking-pot-icon i {
    font-size: 1.2rem;
    color: white;
}

.steam {
    position: absolute;
    width: 3px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    top: -5px;
    opacity: 0;
}

.steam-1 { left: 12px; animation: steamRise 2s infinite 0.1s; }
.steam-2 { left: 18px; animation: steamRise 2s infinite 0.5s; }
.steam-3 { left: 24px; animation: steamRise 2s infinite 0.9s; }

@keyframes steamRise {
    0% {
        transform: translateY(6px) scaleX(1);
        opacity: 0;
    }
    40% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-8px) scaleX(1.5);
        opacity: 0;
    }
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* API Status Card */
.api-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.success {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.error {
    background-color: var(--error);
    box-shadow: 0 0 8px var(--error);
}

.status-text {
    font-size: 0.8rem;
    font-weight: 500;
    flex: 1;
    color: var(--text-secondary);
}

.btn-icon-small {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon-small:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    transform: rotate(30deg);
}

/* Inputs and Forms */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.section-title-small {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.section-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    position: relative;
}

.input-wrapper input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-start);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.1);
}

.add-btn {
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    width: 44px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.add-btn:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

/* Dynamic Chips & Badges */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 4px;
}

.ingredient-chip {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: scaleIn var(--transition-fast) forwards;
}

.ingredient-chip button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: var(--transition-fast);
}

.ingredient-chip button:hover {
    color: var(--error);
}

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

/* Preset Options */
.presets-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.presets-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.preset-chip i {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.preset-chip:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.preset-chip:hover i {
    color: var(--accent-start);
}

.preset-chip.active {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--accent-start);
    color: var(--text-primary);
}

.preset-chip.active i {
    color: var(--accent-start);
}

/* Sidebar Actions */
.sidebar-actions {
    padding: 20px 24px 28px;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    width: 100%;
    padding: 14px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--glow-shadow);
    transition: var(--transition-normal);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
}

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

.btn-primary:disabled {
    background: var(--border-color);
    box-shadow: none;
    color: var(--text-muted);
    cursor: not-allowed;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-secondary);
}

.app-header {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.chef-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chef-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-start);
    font-size: 1.1rem;
}

.chef-info h2 {
    font-size: 1rem;
    font-weight: 600;
}

.status-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge .dot {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px var(--success);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Chat & Scroll wrapper */
.chat-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   WELCOME SCREEN (HERO STATE)
   ========================================== */
.welcome-screen {
    max-width: 680px;
    margin: auto;
    text-align: center;
    padding: 20px 0;
}

.welcome-hero {
    margin-bottom: 40px;
}

.chef-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.2rem;
    color: white;
    box-shadow: var(--glow-shadow);
}

.welcome-hero h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 50%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-lead {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px 20px;
    text-align: left;
    transition: var(--transition-normal);
}

.feature-card:hover {
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
}

.feature-icon {
    font-size: 1.5rem;
    color: var(--accent-start);
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.demo-suggestion {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================
   CONVERSATION LOGS (CHAT BUBBLES)
   ========================================== */
.chat-history {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.chat-bubble {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: messageSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes messageSlide {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-bubble.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble.ai {
    align-self: flex-start;
}

.bubble-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.user .bubble-avatar {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.ai .bubble-avatar {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.2);
}

.bubble-content {
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
}

.user .bubble-content {
    background: var(--accent-gradient);
    color: white;
    border-top-right-radius: 4px;
}

.ai .bubble-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

/* Structured AI Recipe Markdown / Receipt Rendering */
.recipe-card {
    border: 2px dashed rgba(249, 115, 22, 0.2);
    border-radius: var(--border-radius-md);
    background: rgba(17, 24, 39, 0.4);
    padding: 24px;
    margin-top: 10px;
    font-family: var(--font-body);
}

.recipe-header {
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.recipe-title {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    color: var(--accent-start);
    font-weight: 700;
    margin-bottom: 8px;
}

.recipe-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.recipe-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.recipe-meta-item i {
    color: var(--accent-start);
}

.recipe-section-title {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1.05rem;
    margin: 18px 0 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.recipe-card ul, .recipe-card ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.recipe-card li {
    margin-bottom: 6px;
}

.recipe-card blockquote {
    border-left: 3px solid var(--accent-start);
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 16px;
    margin: 12px 0;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==========================================
   SHIMMER LOADING EFFECT
   ========================================== */
.shimmer-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.shimmer-line {
    height: 16px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.05) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 4px;
}

.shimmer-line.title {
    width: 60%;
    height: 24px;
}

.shimmer-line.body-1 {
    width: 100%;
}

.shimmer-line.body-2 {
    width: 90%;
}

.shimmer-line.body-3 {
    width: 75%;
}

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

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    opacity: 0.4;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* ==========================================
   CHAT INPUT FOOTER AREA
   ========================================== */
.chat-input-area {
    padding: 24px 32px 32px;
    background: linear-gradient(180deg, transparent, var(--bg-secondary) 30%);
}

.chat-form {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px 8px 8px 18px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
    align-items: center;
    transition: var(--transition-fast);
}

.chat-form:focus-within {
    border-color: var(--accent-start);
    box-shadow: 0 10px 30px -10px rgba(249, 115, 22, 0.15);
}

.chat-form input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 10px 0;
}

.chat-form input:focus {
    outline: none;
}

.btn-send {
    background: var(--accent-gradient);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.2);
}

.btn-send:hover {
    transform: scale(1.04);
    opacity: 0.95;
}

/* ==========================================
   MODAL CONFIGURATION DIALOG
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity var(--transition-normal);
}

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

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.open .modal-container {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--accent-start);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
}

.input-password-wrapper {
    display: flex;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.input-password-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.input-password-wrapper input:focus {
    outline: none;
}

.btn-toggle-visibility {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-toggle-visibility:hover {
    color: var(--text-primary);
}

.key-help-box {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
}

.key-help-box p {
    color: var(--text-primary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-help-box i {
    color: var(--info);
}

.modal-footer {
    padding: 20px 24px;
    background: rgba(17, 24, 39, 0.4);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-start);
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 200;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    border-left-color: var(--error);
}

.toast.success {
    border-left-color: var(--success);
}

/* ==========================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================== */
@media (max-width: 1024px) {
    --sidebar-width: 320px;
    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: 100vh;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-header {
        padding: 16px 20px;
    }

    .sidebar-content {
        padding: 16px 20px;
        gap: 16px;
    }

    .sidebar-actions {
        padding: 12px 20px 16px;
    }

    .main-content {
        height: 50%;
        flex: 1;
    }

    .app-header {
        padding: 12px 20px;
        height: 60px;
    }

    .chat-wrapper {
        padding: 20px;
    }

    .chat-bubble {
        max-width: 90%;
    }

    .chat-input-area {
        padding: 16px 20px 20px;
    }

    .welcome-hero h2 {
        font-size: 1.6rem;
    }

    .welcome-lead {
        font-size: 0.9rem;
    }

    .features-grid {
        display: none; /* Hide features on small mobile heights to save space */
    }
}
