/* --- Main Website Theme Variables --- */
:root {
    --bg: #0d0f13;
    --panel: #0f1217;
    --muted: #161a21;
    /* Used for hover states and subtle backgrounds */
    --text: #eef2f7;
    --sub: #a7b0c0;
    --pill: #0f1115;
    --accent: #ff6a00;
    /* Main Orange Accent - Used for highlights/active */
    --accent-light: #ff9900;
    /* Lighter Orange for glow/hover */
    --radius: 24px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.35);
    --border-color: #1f2533;

    /* OpenAI Image specific colors/sizes */
    --sidebar-bg-darker: #0d0d0d;
    --upgrade-btn-bg: #222;
    --upgrade-btn-text: #a7b0c0;
}

/* --- Global Styles --- */
* {
    box-sizing: border-box;
    font-family: 'Michroma', sans-serif;
}

/* 💥 Global Custom Scrollbar Styles (Scrollbar එක පේන්න) */

/* Webkit (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
    width: 8px;
    /* Vertical scrollbar width */
    height: 8px;
    /* Horizontal scrollbar height (if any) */
}

*::-webkit-scrollbar-track {
    background: var(--bg);
    /* Dark background for the track */
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    /* Orange color for the thumb */
    border-radius: 4px;
    border: 2px solid var(--bg);
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-light);
    /* Lighter orange on hover */
}

/* Firefox */
* {
    scrollbar-width: thin;
    /* 'auto' or 'thin' */
    scrollbar-color: var(--accent) var(--bg);
}


body {
    /* === GameBanana style pixel retro bg === */
    background-color: #0d1117;
    /* dark navy base */
    background-image:
        linear-gradient(0deg, transparent 24%, rgba(233, 145, 73, 0.952) 25%, rgba(233, 145, 73, 0.952) 26%, transparent 27%, transparent 74%, rgba(233, 145, 73, 0.952) 75%, rgba(233, 145, 73, 0.952) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(233, 145, 73, 0.952) 25%, rgba(233, 145, 73, 0.952) 26%, transparent 27%, transparent 74%, rgba(233, 145, 73, 0.952) 75%, rgba(233, 145, 73, 0.952) 76%, transparent 77%, transparent);
    background-size: 13px 13px;
    /* denser smaller pixel grid size */
    background-attachment: fixed;

    color: var(--text);
    font: 500 1rem/1.5 "Inter", system-ui, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* Retro Font for Titles/Highlights */
.retro-text {
    font-family: 'Press Start 2P', cursive;
    letter-spacing: 2px;
    font-size: 1.8em;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 106, 0, 0.5);
}

.sub-text {
    color: var(--sub);
}


.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    width: 95vw;
    height: 90vh;
    background-color: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin: 40px;
    background-color: var(--panel);
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--accent-light);
}


/* ----------------------------------------------------- */
/* --- SIDEBAR STYLING --- */
/* ----------------------------------------------------- */

.sidebar {
    background-color: var(--sidebar-bg-darker);
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid var(--border-color);
    overflow: hidden;
    height: 100%;
}

/* 1. Fixed Top Section (Logo, New Chat) */
.sidebar-top-fixed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 5px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 6px;
    border: none;
    box-shadow: none;
}

.logo-text {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text);
}


.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--muted);
    color: var(--text);
    border: none;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.new-chat-btn:hover {
    background-color: #2a2f3a;
}

/* 2. SCROLLABLE NAVIGATION SECTION (Search, History, Links) */
.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-right: -5px;
    padding-top: 5px;
    padding-bottom: 10px;
}

/* --- Navigation Links --- */
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95em;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--muted);
}

.nav-link .icon {
    font-size: 1.2em;
    color: var(--sub);
}

.top-search-link {
    background-color: var(--muted);
    color: var(--sub);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.top-search-link:hover {
    background-color: #2a2f3a;
    color: var(--text);
}


/* History Group Styling */
.chat-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 0;
}

.group-title {
    color: var(--sub);
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    padding: 5px 0 5px 15px;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.chat-history-item {
    padding: 8px 15px;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-history-item.active {
    background-color: var(--muted);
    color: var(--accent);
}

.history-note {
    color: var(--sub);
    font-size: 0.85em;
    padding: 5px 15px;
}

/* 3. FIXED BOTTOM AUTH SECTION */
.auth-section {
    padding-top: 15px;
    padding-bottom: 5px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Common style for buttons */
.login-btn,
.logout-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    font-weight: 500;
}

/* Google Sign-in Button Style */
.login-btn {
    width: 100%;
    background-color: var(--accent);
    color: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(255, 106, 0, 0.4);
}

.login-btn .icon {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: var(--text);
    background-color: #4285F4;
    padding: 3px 6px;
    border-radius: 3px;
    line-height: 1;
}

.login-btn:hover {
    background-color: var(--accent-light);
}

/* User Details Display (Signed-in state) */
.user-details-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: var(--muted);
    padding: 10px;
    border-radius: 8px;
}

.user-details-display .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.user-details-display .user-name {
    flex-grow: 1;
    margin: 0 10px;
    color: var(--text);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Logout Button */
.logout-btn {
    background-color: transparent;
    color: var(--sub);
    padding: 5px 8px;
    border: 1px solid var(--sub);
    font-size: 10px;
    border-radius: 5px;
}

.logout-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: rgba(255, 106, 0, 0.1);
}

.hidden {
    display: none !important;
}


/* ----------------------------------------------------- */
/* --- MAIN CONTENT & HEADER (Model Selector Added) --- */
/* ----------------------------------------------------- */

.main-content {
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    padding: 0 40px;
    overflow-y: hidden;
    flex-grow: 1;
}

.main-header {
    display: flex;
    justify-content: space-between;
    /* To space out Model Selector and User Profile */
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 70px;
    height: 60px;
    border-radius: 50%;


}

/* 💥 Model Selector Styles 💥 */
.model-selector-container {
    position: relative;
    /* For positioning the dropdown */
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    font-weight: 500;
}

.model-name {
    color: var(--text);
    font-size: 1.5em;
    /* Larger "Cube" text */
    font-weight: 600;
}

.model-dropdown-btn {
    background-color: var(--muted);
    color: var(--text);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    /* Pill shape */
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.model-dropdown-btn:hover {
    background-color: #2a2f3a;
}

.model-dropdown-btn .fas {
    font-size: 0.8em;
    color: var(--sub);
}

/* Dropdown Menu */
.model-dropdown-menu {
    position: absolute;
    top: 100%;
    /* Position below the button */
    left: 0;
    background-color: var(--panel);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 10px;
    z-index: 20;
    /* Ensure it's above other content */
    min-width: 280px;
    border: 1px solid var(--border-color);
    transform: translateY(10px);
    /* Small offset from the button */
    opacity: 0;
    /* Start hidden */
    pointer-events: none;
    /* Disable interaction when hidden */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.model-dropdown-menu.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.dropdown-header {
    color: var(--sub);
    font-size: 0.85em;
    padding: 5px 10px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.dropdown-item {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 10px 10px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--muted);
}

.dropdown-item.selected {
    background-color: var(--muted);
    color: var(--accent);
}

.dropdown-item.selected .fa-check-circle {
    color: var(--accent);
}

.dropdown-item .item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-item .item-title {
    font-weight: 500;
}

.dropdown-item .item-version {
    font-size: 0.8em;
    color: var(--sub);
}

.upgrade-section {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 0 10px;
}

.upgrade-text {
    font-size: 0.85em;
    color: var(--sub);
    line-height: 1.4;
}

.upgrade-btn {
    background-color: var(--upgrade-btn-bg);
    color: var(--upgrade-btn-text);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.upgrade-btn:hover {
    background-color: #333;
    color: var(--text);
}

/* 💥 END: Model Selector Styles 💥 */


.welcome-section {
    text-align: center;
    margin: 40px 0;
    position: relative;
    padding-top: 50px;
}

.orange-orb {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--accent), transparent 70%);
    border-radius: 50%;
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.8;
    filter: blur(40px);
}

.welcome-section h1 {
    font-size: 2.8em;
    color: var(--text);
    margin-bottom: 10px;
    position: relative;
}

.welcome-section p {
    font-size: 1.2em;
    color: var(--sub);
    position: relative;
}

.prompt-suggestions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
    flex-grow: 1;
    overflow-y: hidden;
}

/* --- CHAT DISPLAY AREA STYLES --- */
.chat-display {
    flex-grow: 1;
    /* CRUCIAL: Takes up all available vertical space */
    overflow-y: auto;
    /* CRUCIAL: This is the ONLY scrolling area for messages */
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* New Wrapper for relative positioning of the tools menu */
.chat-input-wrapper {
    position: relative;
    /* 💥 ප්‍රධාන වෙනස්කම: සම්පූර්ණ input box එක 20px කින් උඩට අදිනවා. */
    margin-top: -30px;
    margin-bottom: 20px;
    padding-bottom: 0px;
    flex-shrink: 0;
}

/* Input Area - Padding 0 */
.chat-input-area {
    background-color: var(--panel);
    border-top: 1px solid var(--border-color);
    padding: 0;
    z-index: 10;
}

/* Input Container - Margin 0 */
.input-container {
    display: flex;
    align-items: flex-end;
    padding: 0 20px;
    /* Horizontal padding තියාගමු */
    gap: 10px;
    margin-bottom: 0;
    /* Input box එක යට තියෙන ඉඩ අයින් කරයි */
}


.prompt-card {
    background-color: var(--panel);
    border-radius: 16px;
    /* 💥 Box එකේ උස මුල් විදිහටම තියාගන්න 10px ට සෙට් කරනවා */
    padding: 20px 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    gap: 10px;
}

/* Input Controls */
.input-controls-left {
    display: flex;
    align-items: center;
    position: relative;
    /* For positioning the tools-menu */
    gap: 8px;
}

.input-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- AUTOGROW TEXTAREA STYLES --- */
.chat-input-field {
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.1em;
    outline: none;
    /* 💥 Text area එකේ උස මුල් විදිහටම තියාගන්න 10px 0 ට සෙට් කරනවා */
    padding: 10px 0;
    resize: none;
    overflow-y: hidden;
    min-height: 25px;
    line-height: 1.2;
}

/* --- Action Buttons (Sizes revert to 40px) --- */
.action-btn {
    background: none;
    border: none;
    color: var(--sub);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
    flex-shrink: 0;
}

/* '+' icon button (Add Tool Button) */
.action-btn.add-tool-btn {
    width: 40px;
    /* 💥 මුල් අගය 40px */
    height: 40px;
    /* 💥 මුල් අගය 40px */
    background-color: var(--muted);
    border-radius: 50%;
    font-size: 1.5em;
}

.action-btn.add-tool-btn:hover {
    background-color: #2a2f3a;
    color: var(--text);
}

/* Tools Pill Button Style */
.action-btn.tools-pill-btn {
    background-color: var(--muted);
    color: var(--sub);
    font-size: 0.9em;
    padding: 8px 12px;
    /* 💥 මුල් අගය 8px 12px */
    border-radius: 20px;
    gap: 6px;
    line-height: 1;
}

.action-btn.tools-pill-btn:hover {
    background-color: #2a2f3a;
    color: var(--text);
}


.action-btn.voice-input-btn {
    background-color: var(--muted);
    color: var(--sub);
    font-size: 1.2em;
    width: 40px;
    /* 💥 මුල් අගය 40px */
    height: 40px;
    /* 💥 මුල් අගය 40px */
    line-height: 1;
    border-radius: 50%;
}

.action-btn.voice-input-btn:hover {
    background-color: #2a2f3a;
    color: var(--text);
}


/* --- Send Button --- */
.send-message-btn {
    background-color: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 12px;
    /* 💥 වටකුරු කෙළවර සහිත හතරැස් හැඩය */
    width: 45px;
    /* 💥 තරමක් පළල වැඩි කළා */
    height: 40px;
    /* උස 40px තියාගත්තා */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    /* 💥 icon එක පොඩ්ඩක් පොඩි කළා */
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 153, 0, 0.6);
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.send-message-btn:hover {
    background-color: var(--accent-light);
}

/* --- TOOLS MENU STYLING (The Floating Box / Dropdown) 💥 --- */

.tools-menu {
    /* 💥 bottom එක 45px ට සෙට් කරනවා (40px button + 10px prompt-card padding) */
    position: absolute;
    bottom: 45px;
    /* Position above the input bar */
    left: 0;
    /* Default alignment */
    background-color: var(--muted);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    padding: 8px;
    z-index: 10;

    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    border: 1px solid var(--border-color);
}

/* File Menu positioning (for the '+' button) */
.tools-menu.file-tools-menu {
    left: 0;
    /* Aligned with the '+' button */
    min-width: 220px;
}

/* AI Tools Menu positioning (for the 'Tools' button) */
.tools-menu.ai-tools-menu {
    /* '+' button width (40px) + gap (8px) = 48px from left */
    left: 48px;
    /* Aligned with the 'Tools' button */
}

.tool-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 12px;

    background: none;
    border: none;
    width: 100%;
    text-align: left;

    color: var(--text);
    padding: 10px 12px;
    border-radius: 8px;

    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tool-item:hover {
    background-color: #2a2f3a;
}

.tool-item .icon {
    font-size: 1.2em;
    color: var(--sub);
}

.tool-item.main-tool-toggle {
    /* Styles for the "Collapse" / "Tools" button at the bottom of the menus */
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    padding-top: 10px;
    color: var(--sub);
    /* border-top: none; */
    /* Keep the separator line */
}

.tool-item.main-tool-toggle .icon {
    color: var(--accent);
}

.tool-item.main-tool-toggle:hover {
    background-color: transparent;
    color: var(--text);
}


/* Message Bubble Styling */
.message {
    max-width: 70%;
    padding: 15px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.message p {
    margin: 0;
}

.user {
    align-self: flex-end;
    background-color: var(--muted);
    color: var(--text);
    border-bottom-right-radius: 5px;
}

.assistant {
    align-self: flex-start;
    background-color: var(--panel);
    color: var(--text);
    border-bottom-left-radius: 5px;
}

.typing-indicator {
    align-self: flex-start;
    background-color: var(--panel);
    color: var(--sub);
    padding: 10px 15px;
    border-radius: 20px;
    font-style: italic;
    font-size: 0.9em;
}



.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--sub);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    display: none;
    /* Default (Desktop) එකේදී hide වෙනවා */
    z-index: 1000;
    transition: color 0.2s;
    margin-right: 15px;
    /* Logo/Model Selector එකෙන් පොඩි ඉඩක් තියන්න */
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99;
    /* Sidebar එකට පිටිපස්සෙන් එන්න */
    display: none;
    /* Default (Desktop/Large Screen) එකේදී hide වෙනවා */
}

/* --- 💥 MOBILE / TABLET RESPONSIVENESS (Max Width: 900px) --- */

/* --- 💥 MOBILE / TABLET RESPONSIVENESS (Max Width: 900px) --- */

/* ----------------------------------------------------- */
/* 💥 NEW: VIDEO LOADING SCREEN STYLES */
/* ----------------------------------------------------- */

#video-loader {
    position: fixed;
    /* Screen එකේ හැම තැනම වසන්න */
    top: 0;
    left: 0;
    width: 100vw;
    /* Full Viewport Width */
    height: 100vh;
    /* Full Viewport Height */
    z-index: 9999;
    /* අනිත් elements වලට උඩින් පෙන්වන්න */
    background-color: var(--bg);
    /* Video එක load වෙද්දී background එකට color එකක් දෙන්න */
    opacity: 1;
    transition: opacity 1s ease-out;
    /* Smooth transition එකක් සඳහා */
    display: flex;
    justify-content: center;
    align-items: center;
}

#video-loader.fade-out {
    opacity: 0;
    pointer-events: none;
    /* fade out උනාට පස්සේ click කරන්න බැරි වෙන්න */
}

#loading-video {
    /* Video එක full screen cover වීමට */
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    /* Aspect ratio එක maintain කරමින් cover වීමට */
}

/* 💥 NEW: App content එක default විදියට hidden තියන්න */
#app-content {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

#app-content.visible {
    visibility: visible;
    opacity: 1;
}

/* Input Field එකේ Padding හදමු */
/* ... (අනෙකුත් styles) ... */


/* ===== Mobile fixes: replace your existing @media (max-width: 900px) block with this ===== */
@media (max-width: 900px) {

    /* remove default body margin (prevents small top gap on some mobiles) */
    body {
        margin: 0;
        /* hide the pixel/grid background on small screens */
        background-image: none !important;
        background-color: #0d1117;
        /* fallback plain dark bg */
    }

    /* Full-screen app container for mobile — remove offsets & margins that created top gap */
    .app-container {
        padding: 0;
        border-radius: 0;
        height: 100%;
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        /* <-- fixed typo: was `left: 3` in your file */
        margin: 0;
        /* remove the desktop margin:40px that caused the gap */
        border: none !important;
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        display: flex;
        flex-direction: column;
        background-color: var(--bg-color, #0d1117);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        border: none;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar:not(.closed-mobile) {
        transform: translateX(0);
    }

    /* scrollable middle area */
    .sidebar-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px 12px 80px;
        /* leave space for footer */
    }

    /* 👉 fixed footer (Google login stays always visible) */
    .sidebar-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 280px;
        /* match sidebar width */
        background: rgba(13, 17, 23, 0.98);
        backdrop-filter: blur(8px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 10px 16px;
        box-sizing: border-box;
        z-index: 200;
    }

    .sidebar-footer button {
        width: 100%;
        padding: 12px 0;
        border: none;
        border-radius: 8px;
        font-size: 1em;
        font-weight: 600;
        color: #fff;
        background: linear-gradient(90deg, #ff9900, #ff6600);
        cursor: pointer;
    }

    .sidebar-footer button:active {
        transform: scale(0.97);
    }


    /* Make main content take the viewport width (you previously had 160% which caused overflow/scroll issues) */
    .main-content {
        padding: 0;
        border-radius: 0;
        width: 160%;
        height: 100%;
        bottom: 0;
        border: none !important;
        margin: 0;
        flex-grow: 1;
        overflow: hidden;
        left: 3;
    }

    /* Header tweaks */
    .main-header {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }

    .menu-toggle-btn {
        display: block;
        order: 1;
    }

    .model-selector-container {
        order: 2;
        margin-right: auto;
        margin-left: 50px;
    }

    .user-profile {
        order: 3;
    }

    .model-selector-container .model-name {
        font-size: 0.95em;
    }

    .model-selector-container .model-dropdown-btn {
        padding: 4px 8px;
    }

    .user-profile p {
        display: none;
    }

    .user-profile .avatar {
        margin-left: 0;
        width: 35px;
        height: 35px;
    }

    .welcome-section {
        padding: 30px 16px;
    }

    .welcome-section .retro-text {
        font-size: 20px;
    }

    .welcome-section .sub-text {
        font-size: 0.85em;
    }

    .orange-orb {
        width: 120px;
        height: 120px;
        top: 25%;
    }

    /* Input area / chat input fixes */
    .chat-input-wrapper {
        padding: 10px;
        margin-top: 0;
    }

    .chat-input-card {
        padding: 28px 20px;
    }

    .input-controls-left .tools-pill-btn {
        font-size: 1px;
        color: transparent;
        width: 35px;
        height: 35px;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 50%;
    }

    .input-controls-left .tools-pill-btn i {
        font-size: 18px;
        color: var(--sub);
    }

    .input-controls-left .add-tool-btn {
        width: 35px;
        height: 35px;
        font-size: 1.4em;
    }

    .chat-input-field {
        padding: 10px 10px;
        font-size: 1em;
        min-height: 36px;
    }

    .input-controls-right .action-btn,
    .input-controls-right .send-message-btn {
        width: 35px;
        height: 35px;
    }

    .input-controls-right .send-message-btn {
        width: 40px;
        height: 35px;
        border-radius: 8px;
    }

    .input-controls-right .action-btn i,
    .input-controls-right .send-message-btn i {
        font-size: 1em;
    }

    .tools-menu {
        bottom: 50px;
        left: 10px;
        width: 95%;
    }

    .tools-menu .tool-item {
        padding: 12px 15px;
    }

}

/* ==== Extra small phones (max-width: 400px) ==== */
@media (max-width: 400px) {

    .sidebar {
        width: 240px;
    }

    .sidebar-content {
        padding: 12px 10px 70px;
    }

    .sidebar-footer {
        width: 240px;
        /* match new sidebar width */
        padding: 8px 12px;
    }

    .sidebar-footer button {
        font-size: 0.9em;
        padding: 10px;

    }

    /* adjust header paddings / text sizes */
    .main-header {
        padding: 8px 10px;
        gap: 8px;
    }

    .main-header .model-selector-container .model-name {
        font-size: 0.9em;
    }

    .main-header .user-profile .avatar {
        width: 30px;
        height: 30px;
    }

    /* make chat input and buttons slightly smaller */
    .chat-input-wrapper {
        padding: 8px;
    }

    .chat-input-card {
        padding: 20px 12px;
    }

    .chat-input-field {
        font-size: 0.9em;
        padding: 8px;
    }

    .input-controls-right .action-btn,
    .input-controls-right .send-message-btn {
        width: 32px;
        height: 32px;
    }

    /* prevent layout overflow */
    .app-container,
    .main-content {
        width: 145%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
        border: none;
    }

    /* make fonts adaptive globally */
    body {
        font-size: 14px;
        line-height: 1.4;
    }

    .welcome-section .retro-text {
        font-size: 18px;
    }

    .welcome-section .sub-text {
        font-size: 0.8em;
    }

    /* Optional - reduce sidebar shadow for small viewports */
    .sidebar {
        box-shadow: 6px 0 20px rgba(0, 0, 0, 0.4);
    }
}

/* 3. Full HD Desktop (1601px up to 1920px) */
/* 100% Zoom හි ඇති Full HD තිර (1920px) සඳහා හොඳම අගය */
@media (min-width: 1601px) and (max-width: 1920px) {
  body {
    /* තවත් වැඩි කළ pixel ප්‍රමාණය */
    background-size: 19px 19px;
  }
}

/* 4. Large Monitors / Ultra Wide / 4K (1921px සහ ඊට වැඩි) */
/* 80% Zoom හෝ ඊට වැඩි විශාල තිර සඳහා */
@media (min-width: 1921px) {
  body {
    /* විශාලතම pixel ප්‍රමාණය */
    background-size: 22px 22px;
  }
}

/* =========================================== */
/* MUSIC PLAYER - New Styles (Transparent Card) */
/* =========================================== */

