:root {
    --bg-color: #000000;
    --sidebar-bg: #333333;
    --sidebar-width-collapsed: 70px;
    --sidebar-width-expanded: 260px;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent-blue: #54a0ff;
    --input-bg: #121212;
    --input-border: #333333;
    --font-main: 'Inter', sans-serif;
    --ease-premium: cubic-bezier(0.2, 0.0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* --- ANIMATIONS --- */
@keyframes fadeInUpPremium {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-load {
    opacity: 0; /* Start hidden */
    animation: fadeInUpPremium 0.8s var(--ease-premium) forwards;
}

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width-collapsed);
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding-top: 1.5rem;
    border-right: 1px solid #2a2a2a;
    gap: 1.5rem;
    transition: width 0.4s var(--ease-premium), transform 0.4s var(--ease-premium);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar.expanded { width: var(--sidebar-width-expanded); }
.sidebar.expanded .expand { display: none; }
.sidebar.expanded .contract { display: block !important; }

.sidebar-item {
    display: flex; align-items: center; padding: 0 1.5rem;
    cursor: pointer; color: #d1d1d1; transition: color 0.3s;
    height: 40px; overflow: hidden;
}

.sidebar-item:hover, .sidebar-item.active { color: #fff; }

.sidebar-icon { font-size: 1.2rem; min-width: 22px; display: flex; justify-content: center; max-width: 22px; }
.sidebar-icon img { width: 100%; }

.sidebar-text {
    margin-left: 1rem; white-space: nowrap; opacity: 0;
    transition: opacity 0.1s ease; 
}

.sidebar.expanded .sidebar-text {
    opacity: 1; transition: opacity 0.3s ease 0.25s;
}

.your-chats-container {
    margin-top: 2rem; padding: 0 1.5rem; opacity: 0;
    pointer-events: none; transition: opacity 0.1s ease;
    flex: 1; overflow-y: auto; max-height: 40vh;
}

.sidebar.expanded .your-chats-container {
    opacity: 1; pointer-events: auto; transition: opacity 0.4s ease 0.3s;
}

.chat-header { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }
.chat-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; padding: 0; margin: 0; }
.chat-list li { 
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.9rem; color: #ccc; cursor: pointer; 
    padding: 8px 12px; border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}
.chat-list li:hover { background-color: rgba(255,255,255,0.08); color: #fff; }
.chat-list .chat-link { 
    flex: 1; color: inherit; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-list .chat-actions-menu { position: relative; }
.chat-list .chat-dots-btn {
    background: none; border: none; cursor: pointer;
    padding: 4px 8px; opacity: 0.4; transition: opacity 0.2s;
}
.chat-list li:hover .chat-dots-btn { opacity: 1; }
.chat-list .chat-dots-btn svg { width: 16px; height: 16px; fill: #ccc; }
.chat-list .chat-actions-dropdown {
    display: none; position: absolute; right: 0; top: 100%;
    background: #2a2a2a; border: 1px solid #444; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 100; min-width: 100px;
}
.chat-list .chat-actions-menu.active .chat-actions-dropdown { display: block; }
.chat-list .chat-actions-dropdown a {
    display: block; padding: 8px 12px; color: #ddd;
    text-decoration: none; font-size: 0.85rem;
}
.chat-list .chat-actions-dropdown a:hover { background: rgba(255,255,255,0.1); }
.chat-list .chat-actions-dropdown a.delete-chat { color: #f77; }
.chat-list .chat-actions-dropdown a.delete-chat:hover { background: rgba(255,0,0,0.1); }

/* --- Main Layout --- */
.main-content {
    flex: 1; position: relative; display: flex;
    flex-direction: column; padding: 2rem; height: 100vh;
}

.logo-container {
    position: absolute; top: 30px; right: 40px;
    font-weight: 600; font-size: 1.5rem; display: flex;
    align-items: center; gap: 5px;
    z-index: 50; text-align: right;
}
.logo-text { color: var(--accent-blue); }

/* --- Hero Section --- */
.hero-wrapper {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: center; width: 100%;
    transition: opacity 0.3s ease;
}

.hero-wrapper.hidden { display: none; }

.hero-section { text-align: center; margin-bottom: 80px; padding: 0 20px; }
.hero-title { font-size: 3.5rem; font-weight: 400; margin-bottom: 0.5rem; letter-spacing: -1px; }

.hero-name {
    font-weight: 700;
    background: linear-gradient(90deg, #6dd5ed, #2193b0, #6dd5ed); 
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.hero-subtitle { color: var(--text-secondary); font-weight: 300; font-size: 1rem; }

/* --- Chat History --- */
.chat-history-container {
    flex: 1; width: 100%; max-width: 100%;
    margin: 0 auto; overflow-y: auto; display: none;
    flex-direction: column; gap: 24px; padding: 60px 15% 20px 15%;
}

.chat-history-container::-webkit-scrollbar { width: 6px; }
.chat-history-container::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.chat-history-container::-webkit-scrollbar-track { background: transparent; }

.chat-history-container.active { display: flex; }

.message-row { display: flex; width: 100%; }
.message-row.user { justify-content: flex-end; }

.user-bubble {
    background-color: #0c0c0c; color: #fff;
    padding: 14px 20px; border-radius: 20px; border-bottom-right-radius: 4px;
    max-width: 70%; font-size: 1rem; line-height: 1.5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border: 1px solid #333333;
    animation: fadeInUpPremium 0.3s ease forwards;
}

.message-row.ai { justify-content: flex-start; }
.message-row.ai.audio .ai-content { width: 370px; }
.message-row.ai.audio .ai-image-container { background: none!important; }
.ai-content { display: flex; flex-direction: column; gap: 8px; max-width: 70%; animation: fadeInUpPremium 0.3s ease forwards; }

/* --- AI Image Container (Wrapper) --- */
.ai-image-container {
    position: relative; 
    border-radius: 16px;
    overflow: hidden; 
    background: transparent; 
    height: auto;
    max-width: 100%;
    max-height: 60vh; 
    display: flex;
    justify-content: center;
}

/* Apply Glow & Border directly to Media */
.ai-image-container img, 
.ai-image-container video {
    width: auto;
    max-width: 100%;
    display: block;
    border-radius: 16px;
    /* MOVED STYLES HERE */
    border: 1px solid #333;
    box-shadow: 0 0 35px rgba(200, 200, 200, 0.15), 0 4px 20px rgba(109, 213, 237, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    object-fit: contain;
    max-height: 60vh;
}

/* Optional: Slight boost on hover */
.ai-image-container:hover img,
.ai-image-container:hover video {
    box-shadow: 0 0 45px rgba(200, 200, 200, 0.25), 0 6px 25px rgba(109, 213, 237, 0.4);
}

/* OVERLAY BUTTONS (Hidden by default) */
.overlay-btn, .overlay-actions {
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.ai-image-container:hover .overlay-btn,
.ai-image-container:hover .overlay-actions {
    opacity: 1;
}

/* Download Button (Top Right) - Now applies to Video too */
.download-btn {
    position: absolute; top: 10px; right: 10px;
    width: 36px; height: 36px;
    background: rgba(0, 0, 0, 0.6); /* Slightly darker for better visibility */
    backdrop-filter: blur(4px);
    color: #fff; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s;
    cursor: pointer;
}
.download-btn:hover { background: rgba(0, 0, 0, 0.9); border-color: #fff; }

/* Bottom Action Buttons (Edit / Animate) */
.overlay-actions {
    position: absolute; bottom: 10px; left: 10px; right: 10px;
    display: flex; gap: 8px;
}

.overlay-pill {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: #ddd; border: 1px solid rgba(255,255,255,0.1);
    padding: 8px; border-radius: 8px;
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer; text-align: center;
    transition: all 0.2s;
}
.overlay-pill:hover { background: rgba(0, 0, 0, 0.8); color: #fff; border-color: #fff; }

/* --- Input Component --- */
.input-wrapper-outer {
    width: 100%; display: flex; justify-content: center;
    padding-bottom: 30px; z-index: 60; 
}

.input-wrapper-outer:after{
    content: ""; background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 20%, rgb(0 0 0 / 90%) 100%); height: 100px; width: 100%; position: absolute; top: -100px; left: 0; z-index: -1;
}

.input-container {
    width: 100%; max-width: 880px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 28px;
    padding: 15px 20px;
    position: relative;
    display: flex; flex-direction: column; gap: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    min-height: 160px;
}

.input-top-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.input-controls-left { display: flex; align-items: center; gap: 12px; }

/* Buttons & Toggles */
.pill-btn {
    background-color: #2a2a2a; color: #ccc; border: none;
    padding: 8px 16px; border-radius: 20px; font-size: 0.9rem;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: background 0.2s; position: relative;
}
button#lyricsBtn { background: none; }
.pill-btn:hover, .pill-btn.active { background-color: #333; color: #fff; }

.icon-btn { 
    color: #666; font-size: 1rem; cursor: pointer; 
    transition: all 0.2s; position: relative;
    width: 30px; height: 30px; display: flex; 
    align-items: center; justify-content: center; border-radius: 6px;
}
.icon-btn:hover, .icon-btn.active { color: #fff; background-color: #2a2a2a; }

.media-toggle {
    background-color: #1a1a1a; border-radius: 14px; padding: 4px;
    display: flex; position: relative; cursor: pointer;
    width: 260px; /* Increased to fit 3 items */
    height: 40px; flex-shrink: 0;
}
.toggle-slider {
    position: absolute; top: 4px; left: 4px;
    width: 84px; /* Approx 1/3 minus padding */
    height: calc(100% - 8px);
    background-color: #333; border-radius: 10px;
    transition: transform 0.3s var(--ease-premium);
}
.toggle-option {
    flex: 1; display: flex; align-items: center; justify-content: center;
    gap: 8px; font-size: 0.9rem; font-weight: 500; z-index: 2;
    color: #777; transition: color 0.3s;
}
.toggle-option.active-text { color: #fff; }

/* Input Bottom Row */
.input-bottom-row {
    display: flex; align-items: center; justify-content: space-between;
    flex: 1; padding-top: 2px;
}

.prompt-bot-left { border-radius: 7px; width: 80%; display: flex; align-items: center; justify-content: left; margin-right: 10px; }
.add-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background-color: #333; color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; margin-right: 15px; margin-bottom: 2px; flex-shrink: 0;
}
.asset-upload-preview { display: flex; align-items: center; justify-content: left; width: 100%; overflow: auto; }
.asset-upload-preview img { width: 80px; border-radius: 7px; /*margin-right: 10px; margin-bottom: 5px;*/ }

.main-input {
    flex: 1; background: transparent; border: none; color: #fff;
    font-size: 1.1rem; font-family: var(--font-main); resize: none;
    outline: none; height: 100%; width: 100%; line-height: 1.5; padding-bottom: 2px;
}
.main-input::placeholder { color: #444; }

.generate-btn {
    background-color: #fff; color: #000; border: none;
    padding: 12px 20px 12px 20px; border-radius: 24px; font-weight: 600;
    font-size: 0.95rem; cursor: pointer; display: flex;
    align-items: center; gap: 12px; transition: transform 0.1s;
    position: relative; flex-shrink: 0;
}
.credit-badge {
    background-color: #000; color: #fff;
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
    opacity: 0; position: absolute;
}

    /* Tooltip CSS */
    .tooltip {
        position: absolute;
        bottom: calc(100% + 10px);
        right: 0;
        background-color: #333;
        color: #ddd;
        font-size: 0.75rem;
        font-weight: 400;
        padding: 8px 12px;
        border-radius: 8px;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transform: translateY(10px);
        transition: all 0.2s ease;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }
    /* Arrow for tooltip */
    .tooltip::after {
        content: '';
        position: absolute;
        top: 100%;
        right: 20px; /* Align with button somewhat */
        border-width: 5px;
        border-style: solid;
        border-color: #333 transparent transparent transparent;
    }

     .generate-btn:hover .tooltip {
        opacity: 1;
        transform: translateY(0);
    }

/* Popups */
.dropdown-menu {
    position: absolute; bottom: calc(100% + 12px); left: 0;
    background-color: #333; border: 1px solid #333;
    border-radius: 16px; padding: 8px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.6); z-index: 200;
    opacity: 0; transform: translateY(10px) scale(0.95);
    pointer-events: none; transition: all 0.25s var(--ease-premium);
    transform-origin: bottom left;
}
.dropdown-menu.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* FIX 1: Add Scrollbar to Model Dropdown */
#modelListContainer {
    max-height: 300px;
    overflow-y: auto;
    /* Custom Scrollbar for Webkit */
}
#modelListContainer::-webkit-scrollbar { width: 6px; }
#modelListContainer::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
#modelListContainer::-webkit-scrollbar-track { background: transparent; }

#modelDropdown { min-width: 280px; }
.dropdown-item { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 12px; justify-content: space-between; transition: background 0.2s; color: #ddd; font-size: 0.9rem; }
.dropdown-item:hover { background-color: #333; color: #fff; }
.dropdown-item img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.dropdown-content-left { display: flex; align-items: center; gap: 10px; }
.dropdown-text h4 { font-size: 0.9rem; font-weight: 500; }
.dropdown-text p { font-size: 0.7rem; color: #777; margin-top: 2px; }
.check-icon { color: var(--accent-blue); opacity: 0; }
.dropdown-item.selected .check-icon { opacity: 1; }
.popup-header { padding: 8px 12px; font-size: 0.85rem; color: #888; font-weight: 500; border-bottom: 1px solid #333; margin-bottom: 5px; }

/* --- Mobile Overlay --- */
.overlay-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(3px);
    z-index: 90; opacity: 0; pointer-events: none;
    transition: opacity 0.3s var(--ease-premium);
}
.overlay-backdrop.active { opacity: 1; pointer-events: auto; }

.file-preview-wrapper{position: relative; width: 80px; height: 80px; overflow: hidden;}
.close-preview{position: absolute; top: 0px; right: 3px; background: none; outline: none; border: 0; box-shadow: 0 0 0; font-size: 1.1em;}
/* --- New Multi-Image Preview Styles --- */
.file-preview-wrapper {
    position: relative;
    display: flex;       /* Ensures it takes up space */
    flex-shrink: 0;      /* Prevents it from getting squashed */
    width: 80px;         /* Fixed width matching image */
    height: 80px;
    margin-right: 12px;  /* Spacing between images */
    margin-bottom: 5px;
}

.file-preview-wrapper img, 
.file-preview-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #333;
}

.close-preview {
    position: absolute;
    top: 2px;
    right: 5px;
    background: white;
    color: #000000;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* --- NEW: Music Controls Styles --- */
.music-pill-container {
    padding: 10px 12px;
    display: flex; gap: 8px; flex-wrap: wrap;
    min-width: 320px;
}
.music-pill {
    padding: 6px 14px;
    background: #2a2a2a; color: #aaa;
    border-radius: 8px; cursor: pointer;
    font-size: 0.85rem; font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.music-pill:hover { background: #333; color: #fff; }
.music-pill.active { background: #eee; color: #000; font-weight: 600; }

/* Custom Input Pill */
.music-pill input {
    background: transparent; border: none; color: inherit;
    width: 40px; text-align: center; font-family: inherit; font-size: inherit; font-weight: inherit; outline: none;
}

/* Lyrics Slide Down */
#lyricsContainer {
    width: 100%; overflow: hidden;
    max-height: 0; opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
}
#lyricsContainer.visible {
    max-height: 150px; opacity: 1; margin-top: 10px;
}
.lyrics-input {
    width: 100%; background: #1a1a1a;
    border: 1px solid #333; border-radius: 12px;
    padding: 12px; color: #ddd; font-family: 'Inter', sans-serif;
    font-size: 0.95rem; resize: none; outline: none;
    height: 100px;
}
.lyrics-input:focus { border-color: #555; }

/* Added truncation per request */
#voiceBtnText{max-width: 15ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}

/* --- Chat Suggestions (Intent Guard) --- */
.suggestion-actions {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    animation: fadeIn 0.3s ease;
}

.suggestion-btn {
    /* Base Style: Subtle Ghost Button */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ccc;
    padding: 8px 16px;
    border-radius: 20px; /* Pill shape looks more conversational */
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: translateY(-1px);
}

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

/* Primary Action (Switch to Video) */
.suggestion-btn.primary {
    background: linear-gradient(135deg, var(--accent-blue, #2962ff), #1e4bd1);
    border: 1px solid transparent; /* Keeps sizing consistent */
    color: #fff;
    box-shadow: 0 2px 8px rgba(41, 98, 255, 0.25);
}

.suggestion-btn.primary:hover {
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.4);
    filter: brightness(1.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Optional: Icon style inside button */
.suggestion-btn i {
    font-size: 0.8rem;
    opacity: 0.9;
}

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

.switch { position: relative; display: inline-block; width: 34px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #54a0ff; }
input:checked + .slider:before { transform: translateX(16px); }


/* Container for the upfront control pills */
.input-controls-left {
    display: flex;
    align-items: center;
    gap: 8px; /* Tight spacing like your reference */
    flex-wrap: nowrap;
}

/* The Status Pill (Visual Upfront Style) */

.status-pill .pill-icon {
    font-size: 0.9rem;
    color: #888; /* Dimmed color when Off */
    transition: color 0.2s ease;
    width: 18px;
    text-align: center;
}

/* Optional: Highlight the icon when On */
.status-pill.active-pill .pill-icon {
    
}

.pill-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
}

/* Hover Tooltip */
.pill-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid #333;
}

.status-pill:hover .pill-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/**/

.status-pill {
    padding: 0 4px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    height: 38px;
    position: relative;
    transition: all 0.2s;
}

.status-pill:hover { background: #2a2a2a; border-color: #444; }

.pill-icon { font-size: 0.85rem; color: #888; }
.pill-value { font-size: 0.85rem; color: #fff; font-weight: 500; }

/* Tooltip styling */
.pill-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    border: 1px solid #333;
    z-index: 1000;
}

.status-pill:hover .pill-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Ensure Dropdowns don't inherit tooltip hover */
.status-pill .dropdown-menu { transform-origin: bottom left; left: 0; bottom: 110%; }

/* Update main.css to ensure pills don't clip dropdowns */
.status-pill {
    position: relative; /* Context for the absolute dropdown */
    overflow: visible !important; /* Crucial for the menu to be seen */
    z-index: 100; /* Ensure active pill is on top */
}

.status-pill .dropdown-menu {
    position: absolute;
    bottom: 120%; /* Opens upward */
    left: 0;
    min-width: 200px;
}

.sidebar.expanded .your-chats-container{scrollbar-width: thin; scrollbar-color: #444 transparent;}
.sidebar.expanded .your-chats-container::-webkit-scrollbar { width: 6px; }
.sidebar.expanded .your-chats-container::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.sidebar.expanded .your-chats-container::-webkit-scrollbar-track { background: transparent; }


/* --- Animated Lean Prompt Box --- */
/* DESIGN-STABLE ANIMATION */
.input-container {
    display: flex;
    flex-direction: column;
    min-height: 160px; /* Original Height from your design */
    transition: min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 3px;
}

.input-top-row, .frame-upload-container, #lyricsContainer {
    opacity: 1;
    max-height: 120px;
    margin-bottom: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* LEAN STATE */
.input-container.lean {
    min-height: 65px; 
    padding-top: 10px;
    padding-bottom: 10px;
}

.input-container.lean .input-top-row,
.input-container.lean .frame-upload-container,
.input-container.lean #lyricsContainer {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    pointer-events: none;
    transform: translateY(-15px); /* Smoothly tucks away */
}

.input-bottom-row{gap: 2px !important;}

/**/
/* --- 📱 RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    /* Mobile Sidebar - Drawer Style */
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100%;
        width: 280px !important;
        transform: translateX(-100%); /* Hidden off-canvas */
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.expanded { transform: translateX(0); }
    .sidebar-text { opacity: 1; }
    .your-chats-container { opacity: 1; pointer-events: auto; }
    
    /* Layout Adjustments */
    .main-content { padding: 1rem; }
    .logo-container { top: 20px; right: 20px; font-size: 1.2rem; }
    .logo-container img { width: 120px; }
    
    .hero-title { font-size: 2.2rem; line-height: 1.2; }
    .hero-section { margin-bottom: 40px; }
    
    /* Input Container Mobile */
    .input-container { padding: 15px; border-radius: 20px; min-height: auto; }
    .input-top-row { gap: 10px; }
    .input-controls-left { width: 100%; justify-content: space-between; }
    #modelBtn { flex: 1; justify-content: space-between; }
    
    .media-toggle { width: 100%; max-width: 100%; margin-top: 5px; }
    
    /* Stacking the input bottom row */
    .prompt-bot-left { width: 100%; overflow: hidden; }
    .generate-btn { padding: 12px 12px; font-size: 0.85rem; }
    .generate-btn span { display: none; } /* Optional: hide text on very small screens */
    .credit-badge { width: 24px; height: 24px; font-size: 0.7rem; }
}