/* Import Modern Fonts */
/* FONT LOADING WAS MOVED TO HTML FOR PERFORMANCE. The @import rule was removed. */

/* CSS Variables for Minimalist Theme */
:root {
    --primary-bg: #fdf8f3; 
    --secondary-bg: #ffffff; 
    --surface-light: #ffffff;
    --surface-medium: #fef7f0; 
    --surface-dark: #f4ede4; 
    --neutral-50: #fdf8f3;
    --neutral-100: #f8f1e8; 
    --neutral-200: #f0e6d6; 
    --neutral-300: #e6d5c1;
    --neutral-400: #c4a882; 
    --neutral-500: #a08660; 
    --neutral-600: #7d6847;
    --neutral-700: #5a4a32; 
    --neutral-800: #3d3024; 
    --neutral-900: #2a1f16;
    --accent-primary: #ff9a56; 
    --accent-secondary: #ff8c42;
    --accent-purple: #9333ea; 
    --accent-purple-light: #a855f7;
    --accent-success: #4caf50; 
    --accent-error: #e57373;
    --accent-info: #42a5f5; 
    --text-primary: #2a1f16; 
    --text-secondary: #5a4a32;
    --text-muted: #7d6847; 
    --text-white: #ffffff;
    --shadow-xs: 0 1px 3px 0 rgba(160, 134, 96, 0.08);
    --shadow-sm: 0 2px 6px 0 rgba(160, 134, 96, 0.12), 0 2px 4px 0 rgba(160, 134, 96, 0.06);
    --shadow-md: 0 4px 12px 0 rgba(160, 134, 96, 0.15), 0 2px 6px 0 rgba(160, 134, 96, 0.08);
    --shadow-lg: 0 8px 20px 0 rgba(160, 134, 96, 0.18), 0 4px 12px 0 rgba(160, 134, 96, 0.10);
    --shadow-xl: 0 12px 28px 0 rgba(160, 134, 96, 0.20), 0 6px 16px 0 rgba(160, 134, 96, 0.12);
    --spacing-xs: 0.25rem; 
    --spacing-sm: 0.5rem; 
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem; 
    --spacing-xl: 2rem; 
    --spacing-2xl: 3rem;
    --radius-sm: 8px; 
    --radius-md: 12px; 
    --radius-lg: 16px;
    --radius-xl: 20px; 
    --radius-full: 9999px;
}

/* =================================================================
   DARK MODE THEME
================================================================== */
html[data-theme='dark'] {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --surface-light: #2c2c2c;
    --surface-medium: #3a3a3a;
    --surface-dark: #484848;
    --neutral-200: #484848;
    --neutral-300: #6c6c6c;
    --text-primary: #e0e0e0;
    --text-secondary: #b3b3b3;
    --text-muted: #8e8e8e;
    --shadow-xs: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 6px 0 rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 20px 0 rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 12px 28px 0 rgba(0, 0, 0, 0.5);
}

/* Dark mode specific adjustments for chat bubbles */
html[data-theme='dark'] .question-box {
    background: #36425E; /* A subtle blue for dark mode */
    color: #E0E0E0;
}
/* Reset and Base Styles */
* { padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; } /* Prevent horizontal scroll */

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--primary-bg);
    min-height: 100vh;
    line-height: 1.6; color: var(--text-primary); background: var(--primary-bg);
    min-height: 100vh;
    /* --- Consistent Headings --- */

}
h1, h2, h3, h4, .page-title, .profile-name, .sidebar-logo-link, .login-popup-title {
    font-family: 'Onest', sans-serif;
}
/* --- Layout --- */
.app-layout { display: flex; min-height: 100vh; position: relative; }
.main-content {
    flex: 1; margin-left: 280px; min-height: 100vh;
    padding: var(--spacing-sm --spacing-sm); transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card {
    background: var(--surface-light); border-radius: var(--radius-xl); 
    /* box-shadow: var(--shadow-lg); border: 1px solid var(--neutral-200); */
    /* padding: var(--spacing-md); */
}

/* --- Sidebar --- */
.sidebar { width: 290px; background: var(--surface-light); border-right: 1px solid var(--neutral-200); position: fixed; left: 0; top: 0; height: 100%; z-index: 1002; display: flex; flex-direction: column; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; box-shadow: var(--shadow-sm); }
.sidebar-header { padding: var(--spacing-xl) var(--spacing-lg); background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%); color: var(--text-white); border-bottom: 1px solid var(--neutral-200); }
.sidebar-header h1 { font-size: 1.25rem; font-weight: 600; color: var(--text-white); margin: 0; text-align: center; }
.sidebar-content { flex: 1; padding: var(--spacing-lg); overflow-y: auto; }
.sidebar-footer { padding: var(--spacing-lg); border-top: 1px solid var(--neutral-200); }
.channel-section-title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md); padding: 0 var(--spacing-sm); }
.channel-list { display: flex; flex-direction: column; gap: var(--spacing-xs); }
.channel-item-wrapper { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-md); background: var(--surface-medium); border-radius: var(--radius-md); transition: all 0.3s ease; border: 1px solid transparent; }
.channel-item-wrapper:hover { background: var(--neutral-100); border-color: var(--neutral-300); }
.channel-item-wrapper.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-white);
    border-color: transparent;
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-md);
}
.channel-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    font-size: 0.875rem;
    flex-grow: 1;
    min-width: 0;
    
    /* ADD these 3 lines here */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.channel-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; margin-right: 8px; flex-shrink: 0; }
.channel-name { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delete-btn {
    margin-left: auto; /* Pushes the button to the far right */
    background-color: transparent;
    color: var(--text-muted);
    opacity: 0.5; /* Keep it subtle */
    width: 32px;  /* Explicit width */
    height: 32px; /* Explicit height */
    padding: 0;   /* Remove extra padding */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* Make it a circle */
    transition: all 0.2s ease-in-out;
}

/* Show and style the delete button on hover */
.channel-item-wrapper:hover .delete-btn {
    opacity: 1;
    background-color: var(--surface-dark); /* Use a subtle background on hover */
    color: var(--accent-error); /* Change icon color to red */
}
add-channel-btn{
    margin-bottom: 50px;
}
/* .add-channel-btn { padding: var(--spacing-md); background: var(--surface-medium); border: 2px dashed var(--neutral-300); border-radius: var(--radius-md); color: var(--text-secondary); text-align: center; cursor: pointer; transition: all 0.3s; font-weight: 500; font-size: 0.875rem; } */
.add-channel-btn:hover { background: var(--accent-primary); color: var(--text-white); border-color: var(--accent-primary); border-style: solid; }
.setup-nav { padding: var(--spacing-md); background: var(--surface-medium); border-radius: var(--radius-md); text-decoration: none; color: var(--text-primary); display: flex; align-items: center; gap: var(--spacing-sm); font-weight: 500; transition: all 0.3s ease; margin-bottom: var(--spacing-xs); }
.setup-nav:hover { background: var(--neutral-100); color: var(--accent-primary); }
.setup-nav.active { background: var(--accent-primary); color: var(--text-white); }


/* --- Mobile & Responsive --- */
.hamburger { display: none; position: fixed; top: var(--spacing-lg); left: var(--spacing-lg); z-index: 1003; width: 44px; height: 44px; background: var(--surface-light); border-radius: var(--radius-md); border: 1px solid var(--neutral-200); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: var(--shadow-sm); }
.hamburger span { width: 20px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all 0.3s ease; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(42,31,22,0.4); backdrop-filter: blur(4px); z-index: 999; }
.sidebar-overlay.show { display: block; }

.clear-chat-btn {
    position: static; /* Make it flow with the header content */
    bottom: auto;
    right: auto;
    background: none; /* Remove background */
    color: var(--accent-primary); /* Change to primary accent color for restart */
    border: none;
    border-radius: var(--radius-full);
    padding: var(--spacing-xs); /* Smaller padding for icon-only button */
    font-size: 0.875rem;
    box-shadow: none; /* Remove shadow */
    z-index: auto; /* Remove explicit z-index */
    display: flex;
    align-items: center;
    justify-content: center; /* Center the icon */
    width: 48px; /* Increased width for icon-only button */
    height: 48px; /* Increased height for icon-only button */
    flex-shrink: 0; /* Prevent it from shrinking */
}

.clear-chat-btn .reset-icon {
    font-size: 1.85rem; /* Increased icon size */
    transform: rotate(0deg); /* Initial rotation */
    transition: transform 0.3s ease; /* Smooth rotation transition */
}

.clear-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: var(--surface-medium);
}

.clear-chat-btn:hover .reset-icon {
    transform: rotate(180deg); /* Rotate icon on hover */
}

.clear-chat-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .sidebar-logo-img {
        margin-left: 62%;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .hamburger {
        display: flex;
        position: fixed;
        top: var(--spacing-sm);
        left: var(--spacing-sm);
        z-index: 1003; /* Ensure hamburger is on top */
        background: var(--surface-light); /* Ensure it has a background */
    }
    
    /* Make channel info banner and general QA header fixed and visible on mobile */
   

    .channel-info-content, .qa-header-content {
        flex-grow: 0; /* Don't grow to fill space */
        display: flex;
        align-items: center;
        gap: 100px;
        min-width: 0; /* Allow content to shrink */
        justify-content: flex-end; /* Push inner content to the right */
    }

    .channel-header,
    .qa-header-main {
        display: flex;
        align-items: center;
        gap: var(--spacing-md);
        flex-grow: 0; /* Don't grow to fill space */
        min-width: 0; /* Allow text to truncate */
        flex-shrink: 1; /* Allow content to shrink if needed */
    }

    .main-content {
        margin-left: 0;
        padding: 0; /* Remove default padding */
         /* Space for the fixed mobile header */
    }

    .main-content.has-mobile-nav .card {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        height: calc(100vh - (var(--spacing-xl) * 2)); /* Full height minus fixed mobile header */
        display: flex;
        flex-direction: column;
    }
    .main-content.has-mobile-nav .chat-wrapper {
        flex-grow: 1;
        /* This is a flexbox trick to prevent overflow issues when children grow */
        min-height: 0;
      }

    .channel-avatar { /* This was merged from .mobile-channel-avatar */
        width: 36px; 
        height: 36px;
        font-size: 1.3rem;
        flex-shrink: 0;
        border: none; 
        background: var(--surface-medium);
    }
 /* Merged from .channel-title */
    .qa-title {
        font-size: 1.0rem; 
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
    }

    .qa-description { /* Merged from .channel-stats */
        font-size: 0.75rem;
        display: none;
    }

    .clear-chat-btn {
        position: static;
        bottom: auto;
        right: auto;
        background: none;
        color: var(--accent-primary);
        border: none;
        border-radius: var(--radius-full);
        padding: var(--spacing-xs);
        font-size: 0.875rem;
        box-shadow: none;
        z-index: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .clear-chat-btn .reset-icon {
        font-size: 2.8rem;
        transform: rotate(0deg);
        transition: transform 0.3s ease;
    }

    .clear-chat-btn:hover .reset-icon {
        transform: rotate(180deg);
    }

    .chat-wrapper {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }



    .question-form {
        flex-shrink: 0;
        padding: var(--spacing-md);
        background-color: var(--surface-light);
        border-top: 1px solid var(--neutral-200);
    }

    .form-card {
        padding: var(--spacing-lg) var(--spacing-md);
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--neutral-200);
        background: var(--surface-medium);
        margin-top: 0;
    }

    .channel-form .form-group {
        margin-bottom: var(--spacing-lg);
    }

    .input-with-icon input {
        padding-right: 40px;
        height: 48px;
    }

    .input-icon {
        right: var(--spacing-sm);
        width: 20px;
        height: 20px;
    }

    .btn.btn-primary {
        width: 100%;
        font-size: 1rem;
        padding: var(--spacing-md) var(--spacing-lg);
        height: 50px;
    }

    .saved-channels-section {
        margin-top: var(--spacing-xl);
        padding: var(--spacing-lg) var(--spacing-md);
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--neutral-200);
        border-radius: var(--radius-lg);
    }

    .section-title {
        font-size: 1.5rem;
        justify-content: center;
        text-align: center;
        margin-bottom: var(--spacing-md);
    }

    .section-title svg {
        width: 28px;
        height: 28px;
    }

    .section-description {
        font-size: 0.85rem;
        text-align: center;
        padding: 0;
        margin-bottom: var(--spacing-xl);
    }

    .channel-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .channel-card {
        flex-direction: row;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-xs);
        border: 1px solid var(--neutral-200);
    }

    .channel-card-avatar,
    .channel-card-avatar-placeholder {
        width: 40px;
        height: 40px;
        margin-right: var(--spacing-sm);
    }

    .channel-card-title {
        font-size: 0.95rem;
    }

    .channel-card-stats {
        font-size: 0.75rem;
    }

    .delete-channel-btn {
        margin-left: var(--spacing-sm);
    }

    .delete-channel-btn svg {
        width: 18px;
        height: 18px;
    }
    .question-box, .answer-box {
    margin-left: 0%;
    margin-right: 0%;
    }
}

/* Desktop specific adjustments for header elements */
@media (min-width: 769px) {
    .channel-info-banner,
    .general-qa-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background:#feedd900;
        /* border: 1px solid var(--neutral-200);
        border-radius: var(--radius-lg); */
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-xl);
        /* box-shadow: var(--shadow-lg); */
    }

    .channel-info-content, .qa-header-content {
        flex-grow: 1;
        display: flex;
        align-items: center;
        gap: 100px;
    }

    .clear-chat-btn {
        position: static; /* Reset position for desktop */
        background: var(--surface-medium); /* Restore desktop background */
        color: var(--accent-primary); /* Change to primary accent color for restart */
        box-shadow: none; /* Remove shadow for desktop */
        border: 1px solid var(--neutral-300); /* Restore desktop border */
        padding: var(--spacing-sm); /* Adjusted padding for icon only */
        font-size: 0.875rem;
        z-index: auto;
        width: 56px; /* Increased width for desktop icon-only button */
        height: 56px; /* Increased height for desktop icon-only button */
        border-radius: 50%; /* Make it circular on desktop */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .clear-chat-btn .reset-icon {
        font-size: 2.5rem; /* Increased icon size for desktop */
        transform: rotate(0deg); /* Initial rotation */
        transition: transform 0.3s ease; /* Smooth rotation transition */
    }

    .clear-chat-btn:hover .reset-icon {
        transform: rotate(180deg); /* Rotate icon on hover */
    }
}

/* --- General Components --- */
h2 { font-size: 1.75rem; margin-bottom: var(--spacing-sm); color: var(--text-primary); }
p.text-muted { color: var(--text-secondary); margin-bottom: var(--spacing-xl); }
.form-group { margin-bottom: 0; }
label { display: block; margin-bottom: var(--spacing-sm); font-weight: 500; font-size: 0.875rem; }
input, select, textarea { width: 100%; padding: var(--spacing-md); border: 1px solid var(--neutral-300); border-radius: var(--radius-md); font-size: 1rem; font-family: inherit; background: var(--surface-light); color: var(--text-primary); }
button, .btn { background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%); color: #ffffff; padding: var(--spacing-md) var(--spacing-xl); border: none; border-radius: var(--radius-md); font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.3s ease; box-shadow: var(--shadow-sm); text-decoration: none; }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* --- Page: ask.html --- */
.general-qa-header { background: var(--surface-light); border: 1px solid var(--neutral-200); border-radius: var(--radius-lg); padding: var(--spacing-lg); margin-bottom: var(--spacing-xl); }
.qa-header-main { flex-grow: 1; }
.qa-title { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-xs); }
.qa-description { color: var(--text-secondary); margin: 0; }
.channel-info-banner { background: var(--surface-light); padding: var(--spacing-lg);}
.channel-info-content { display: flex; justify-content: space-between; align-items: center; gap: var(--spacing-2xl+20px); }
.channel-header { display: flex; align-items: center; gap: var(--spacing-md); }
.channel-actions { display: flex; gap: var(--spacing-md); align-items: center; }

.clear-chat-btn:hover { background: var(--accent-error); color: var(--text-white); border-color: var(--accent-error); }
.reset-icon { transition: transform 0.2s ease; }
.clear-chat-btn:hover .reset-icon { transform: scale(1.1); }


.char-count { font-size: 0.75rem; color: var(--text-secondary); transition: color 0.2s ease; }
.char-count.near-limit { color: var(--accent-warning); }
.submit-btn { position: static; transform: none; width: 40px; height: 40px; border-radius: 50%; padding: 0; display: flex; align-items: center; justify-content: center; background: var(--neutral-300); cursor: not-allowed; transition: all 0.2s ease-in-out; flex-shrink: 0; }
.submit-btn.active { background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%); cursor: pointer; box-shadow: var(--shadow-sm); }
.submit-btn.loading { animation: spin 1s linear infinite; }
.submit-btn:hover:not(:disabled) { transform: scale(1.05); }
.submit-icon { width: 20px; height: 20px; color: var(--text-white); }
.qna-pair { margin-bottom: var(--spacing-xl); animation: fadeIn 0.3s ease; }
.question-box, .answer-box { background: var(--surface-light); border-radius: var(--radius-md); padding: var(--spacing-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--neutral-200); transition: all 0.3s ease; }
.question-box:hover, .answer-box:hover { box-shadow: var(--shadow-md); }
.question-box { border-left: 4px solid var(--accent-tertiary); margin-bottom: var(--spacing-md); }
.answer-box { border-left: 4px solid var(--accent-primary); }
.question-header, .answer-header { display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-lg); }
.question-label, .answer-label { font-weight: 600; color: var(--text-primary); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.question-content, .answer-content { font-size: 1rem; line-height: 1.7; word-wrap: break-word; }
.question-content { font-style: italic; }
.sources-section { margin-top: var(--spacing-lg); border-top: 1px solid var(--neutral-200); padding-top: var(--spacing-lg); }
.toggle-sources-btn { background: var(--surface-medium); border: 1px solid var(--neutral-300); color: var(--text-primary); padding: var(--spacing-sm) var(--spacing-md); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: var(--spacing-sm); transition: all 0.2s ease; }
.toggle-sources-btn:hover { background: var(--neutral-100); border-color: var(--neutral-400); }
.sources-icon { transition: transform 0.2s ease; }
.toggle-sources-btn:hover .sources-icon { transform: scale(1.1); }
.toggle-indicator { transition: transform 0.3s ease; }
.toggle-sources-btn.expanded .toggle-indicator { transform: rotate(180deg); }
.sources-list { margin-top: var(--spacing-md); background: var(--surface-medium); border-radius: var(--radius-md); border: 1px solid var(--neutral-200); overflow: hidden; transition: all 0.3s ease; }
.source-item { padding: var(--spacing-md); border-bottom: 1px solid var(--neutral-200); transition: background-color 0.2s ease; }
.source-item:hover { background-color: var(--neutral-100); }
.source-link { color: var(--accent-primary); text-decoration: none; font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: var(--spacing-md); transition: color 0.2s ease; }
.source-link:hover { color: var(--accent-secondary); }
.source-title { flex-grow: 1; }
.source-duration { font-size: 0.75rem; color: var(--text-secondary); background: var(--neutral-100); padding: 2px 6px; border-radius: var(--radius-sm); }
.source-excerpt { margin-top: var(--spacing-sm); color: var(--text-secondary); font-size: 0.875rem; font-style: italic; background: rgba(255,154,86,0.05); padding: var(--spacing-sm); border-radius: var(--radius-sm); border-left: 3px solid var(--accent-primary); display: flex; gap: var(--spacing-sm); align-items: flex-start; }
.quote-icon { flex-shrink: 0; margin-top: 2px; color: var(--accent-primary); }
.typing-indicator { display: flex; padding: 10px 0; }

/* Error message styling */
.error-message { color: var(--accent-error); background: rgba(229,115,115,0.1); padding: var(--spacing-md); border-radius: var(--radius-md); border-left: 3px solid var(--accent-error); margin: var(--spacing-md) 0; }

/* Custom confirm dialog */
.confirm-dialog { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(42,31,22,0.4); 
    backdrop-filter: blur(4px); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 2100;  /* <-- UPDATED VALUE */
    animation: fadeIn 0.2s ease; 
}
.confirm-content { background: var(--surface-light); border-radius: var(--radius-lg); padding: var(--spacing-xl); max-width: 400px; width: 90%; box-shadow: var(--shadow-xl); animation: slideUp 0.3s ease; }
.confirm-content h3 { margin-bottom: var(--spacing-md); color: var(--text-primary); }
.confirm-content p { margin-bottom: var(--spacing-lg); color: var(--text-secondary); }
.confirm-actions { display: flex; gap: var(--spacing-md); justify-content: flex-end; }
.confirm-actions button { padding: var(--spacing-sm) var(--spacing-lg); border-radius: var(--radius-md); font-weight: 500; transition: all 0.2s ease; }
.confirm-actions .cancel-btn { background: var(--surface-medium); color: var(--text-primary); border: 1px solid var(--neutral-300); }
.confirm-actions .cancel-btn:hover { background: var(--neutral-100); border-color: var(--neutral-400); }
.confirm-actions .confirm-btn { background: var(--accent-error); color: var(--text-white); }
.confirm-actions .confirm-btn:hover { background: var(--accent-error); opacity: 0.9; transform: translateY(-1px); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Mobile optimizations */
@media (max-width: 768px) {
    
    .general-qa-header {
        margin-bottom: var(--spacing-md);
    }

    
    .question-box, .answer-box { 
        padding: var(--spacing-md); 
    }
    
    .sources-list { 
        margin: var(--spacing-sm) 0; 
    }
    
    .source-item { 
        padding: var(--spacing-sm); 
    }
    
    .source-link { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: var(--spacing-xs); 
    }
    
    .source-duration { 
        align-self: flex-start; 
    }
    
    .confirm-content { 
        width: 95%; 
        padding: var(--spacing-lg); 
    }
    
    .confirm-actions { 
        flex-direction: column; 
    }
    
    .confirm-actions button { 
        width: 100%; 
    }
    
    .textarea-actions { 
        position: absolute; 
        right: 6px; 
        bottom: 6px; 
    }
    
    .char-count { 
        background: var(--surface-medium); 
        padding: 2px 6px; 
        border-radius: var(--radius-sm); 
    }
}

/* --- Channel Page Specific Styles --- */
.page-header {
    text-align: center;
    margin-top: var(--spacing-lg); /* Increased top margin for better spacing within the card */
    margin-bottom: var(--spacing-2xl); /* Consistent spacing below the header */
    padding: 0 var(--spacing-lg); /* Add horizontal padding for header text */
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    font-size: 2.2rem; /* Slightly larger title for impact */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.page-title svg {
    color: var(--accent-primary);
    flex-shrink: 0;
    width: 32px; /* Larger icon */
    height: 32px; /* Larger icon */
}

.page-description {
    font-size: 1.1rem; /* Slightly larger and more readable description */
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
    line-height: 1.8;
    max-width: 700px; /* Wider for more content */
    margin-left: auto;
    margin-right: auto;
}

.form-card {
    background: var(--surface-medium);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl); /* More generous padding */
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    margin-top: 0;
    margin-bottom: var(--spacing-2xl);
}

.channel-form .form-group {
    margin-bottom: var(--spacing-xl);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding: var(--spacing-md) var(--spacing-lg); /* Consistent padding */
    padding-right: 48px; /* Room for icon */
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md); /* Consistent border-radius */
    font-size: 1rem;
    background: var(--surface-light);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease; /* Smooth transition */
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255,154,86,0.15);
}

.input-icon {
    position: absolute;
    right: var(--spacing-md);
    color: var(--neutral-400);
    pointer-events: none;
    width: 20px; /* Consistent icon size */
    height: 20px; /* Consistent icon size */
}

.btn.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-2xl); /* More padding for a bolder button */
    font-size: 1.05rem; /* Slightly larger text */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em; /* Slightly increased letter spacing */
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm); /* Keep shadow */
    height: 50px; /* Fixed height for better consistency */
}

.btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Saved Channels Section */
.saved-channels-section {
    background: var(--surface-light);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl); /* More generous padding */
    margin-top: var(--spacing-2xl);
    box-shadow: var(--shadow-lg);
}

.section-title {
    font-size: 1.8rem; /* Larger section title */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-title svg {
    color: var(--accent-primary);
    flex-shrink: 0;
    width: 32px; /* Larger icon */
    height: 32px; /* Larger icon */
}

.section-description {
    font-size: 1rem; /* Consistent with page description */
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.7;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.channel-card {
    background: var(--surface-medium);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.channel-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.channel-card-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
    min-width: 0;
}

.channel-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--accent-primary);
}

.channel-card-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--neutral-300);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.channel-card-details {
    flex-grow: 1;
    min-width: 0;
}

.channel-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);

    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.channel-card-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.delete-channel-btn {
    background: none;
    border: none;
    color: var(--accent-error);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.delete-channel-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.delete-channel-btn svg {
    width: 20px;
    height: 20px;
}

/* --- Setup Page Styles --- */
/* This section was removed as the selectors were not found in the HTML files. */

/* This makes the container a flexbox column */


.qna-pair {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.question-box, .answer-box {
    max-width: 95%; /* Bubbles don't take up the full width */
    /* padding: var(--spacing-md) var(--spacing-lg); */
    border: none; /* Remove the main border */
    box-shadow: var(--shadow-sm);
    /* Make the corners more rounded for a softer, bubble-like feel */
    border-radius: var(--radius-xl);
    margin: 8px;
}

.question-box {
    align-self: flex-end; /* Align user's questions to the right */
    background: #E3EFFB; /* A subtle blue background for the user */
    color: #0B3C6F;
    /* Custom border-radius for the "tail" effect */
    border-bottom-right-radius: var(--radius-sm);
}

.answer-box {
    align-self: flex-start; /* Align AI answers to the left */
    background: var(--surface-light); /* Keep the AI responses clean and white */
    /* Custom border-radius for the "tail" effect */
    border-bottom-left-radius: var(--radius-sm);
}

/* Hide the user's question header, as it's now redundant */
.question-box .question-header {
    display: none;
}

/* Make the question text normal instead of italic */
.question-box .question-content {
    font-style: normal;
    color: inherit; /* Inherit the new blue color */
}

/* Refine the answer header for better spacing */
.answer-box .answer-header {
    margin-bottom: var(--spacing-sm);
}
/* In main.css */

/* Make the parent container relative for positioning the dropdown */
.header-actions {
    position: relative;
}

.kebab-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kebab-menu-button:hover {
    background-color: var(--surface-medium);
}

/* The dropdown menu container */
.dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 110%; /* Position it slightly below the button */
    right: 0;
    background-color: var(--surface-light);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-200);
    z-index: var(--z-dropdown);
    min-width: 200px;
    overflow: hidden; /* Ensures child elements respect the border-radius */
    padding: var(--spacing-sm) 0;
}

/* This class will be toggled by JavaScript to show the menu */
.dropdown-menu.show {
    display: block;
}

/* Styling for the links (actions) inside the menu */
.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-menu a:hover {
    background-color: var(--surface-medium);
    color: var(--accent-primary);
}

/* A simple separator line */
.dropdown-menu hr {
    border: none;
    border-top: 1px solid var(--neutral-200);
    margin: var(--spacing-sm) 0;
}
.button-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1); /* Light grey track */
    border-left-color: var(--text-primary); /* Spinner color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* In main.css */

.kebab-menu-button .icon-success,
.kebab-menu-button .icon-failure,
.kebab-menu-button.state-loading .icon-default {
    display: none; /* Hide success/failure icons by default */
}

/* When the button has a state class, show the correct icon */
.kebab-menu-button.state-success .icon-success,
.kebab-menu-button.state-failure .icon-failure {
    display: block;
}

/* Style the new icons */
.kebab-menu-button .icon-success {
    color: var(--accent-success);
}
.kebab-menu-button .icon-failure {
    color: var(--accent-error);
}

/* In main.css */

.empty-state-container {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-xl);
    margin-top: var(--spacing-2xl);
    background: var(--surface-medium);
    border: 2px dashed var(--neutral-300);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.empty-state-icon svg {
    color: var(--neutral-400);
    margin-bottom: var(--spacing-md);
}

.empty-state-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.empty-state-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    max-width: 450px;
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--spacing-md);
}
/* In main.css */

.channel-card.is-processing {
    background-color: var(--surface-medium);
    border-style: dashed;
    opacity: 0.7;
    pointer-events: none; /* Make it unclickable while processing */
}

.channel-card.is-processing .channel-card-details {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.channel-card.is-failed {
    border-color: var(--accent-error);
    background-color: rgba(229, 115, 115, 0.05);
}

.channel-card.is-failed .channel-card-title {
    color: var(--accent-error);
    font-weight: 600;
}

.channel-card-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--neutral-300);
    border-left-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}


/* === Login Popup Modal Styles === */
.login-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.login-popup-content {
    background: var(--surface-light);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    animation: slideUp 0.4s ease;
}

.login-popup-close-btn {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.login-popup-icon {
    margin-bottom: var(--spacing-lg);
}

.login-popup-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.login-popup-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.login-popup-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    width: 100%;
    padding: var(--spacing-md);
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-popup-google-btn:hover {
    background: var(--surface-medium);
    border-color: var(--neutral-400);
}

.login-popup-terms {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--spacing-lg);
}

@media (max-width: 768px) {
    .login-popup-overlay {
        align-items: flex-end;
    }
    .login-popup-content {
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        animation: slideUpFromBottom 0.4s ease;
    }
    @keyframes slideUpFromBottom {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}
/* In static/css/main.css or a style block */
.progress-bar-inner {
    height: 100%;
    background-color: var(--accent-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease-in-out;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-card.is-processing .channel-card-details {
    /* Adjust alignment to make space for progress */
    justify-content: center;
}

/* Add this inside the <style> tag at the top of base.html */
.sidebar-logo-img {
    height: 70px; /* Controls the height of the logo */
    margin: -20px;
    margin-left: 10%;
    width: auto;  /* Lets the width adjust automatically */
}
@media (max-width: 768px) {
    .sidebar-logo-img {
        margin-left: 22%;
    }
    /* Adjusted margins for elements within the card on mobile */
    .page-header {
        margin-top: var(--spacing-lg); /* Consistent top margin for mobile */
        margin-bottom: var(--spacing-xl); /* Spacing for header on mobile */
        padding-left: var(--spacing-md); /* Horizontal padding for mobile header */
        padding-right: var(--spacing-md); /* Horizontal padding for mobile header */
    }

    .page-title {
        font-size: 1.8rem; /* Slightly smaller title on mobile */
        justify-content: center;
        text-align: center;
        margin-bottom: var(--spacing-sm);
    }

    .page-title svg {
        width: 28px;
        height: 28px;
    }

    .page-description {
        font-size: 0.95rem; /* Slightly smaller description on mobile */
        text-align: center;
        padding: 0;
        margin-bottom: var(--spacing-lg);
    }

    .form-card {
        padding: var(--spacing-xl) var(--spacing-md); /* Adjust padding */
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--neutral-200);
        background: var(--surface-medium);
        margin-top: 0;
    }

    .channel-form .form-group {
        margin-bottom: var(--spacing-lg);
    }

    .input-with-icon input {
        padding-right: 40px;
        height: 48px;
    }

    .input-icon {
        right: var(--spacing-sm);
        width: 20px;
        height: 20px;
    }

    .btn.btn-primary {
        width: 100%;
        font-size: 1rem;
        padding: var(--spacing-md) var(--spacing-lg);
        height: 50px;
    }

    .saved-channels-section {
        margin-top: var(--spacing-xl);
        padding: var(--spacing-xl) var(--spacing-md); /* Adjust padding for mobile */
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--neutral-200);
        border-radius: var(--radius-lg);
    }

    .section-title {
        font-size: 1.6rem; /* Smaller section title on mobile */
        justify-content: center;
        text-align: center;
        margin-bottom: var(--spacing-md);
    }

    .section-title svg {
        width: 28px;
        height: 28px;
    }

    .section-description {
        font-size: 0.85rem;
        text-align: center;
        padding: 0;
        margin-bottom: var(--spacing-xl);
    }

    .channel-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .channel-card {
        flex-direction: row;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-xs);
        border: 1px solid var(--neutral-200);
    }

    .channel-card-avatar,
    .channel-card-avatar-placeholder {
        width: 40px;
        height: 40px;
        margin-right: var(--spacing-sm);
    }

    .channel-card-title {
        font-size: 0.95rem;
    }

    .channel-card-stats {
        font-size: 0.75rem;
    }

    .delete-channel-btn {
        margin-left: auto; /* Ensure it stays pushed to the right */
        width: 30px; /* Slightly smaller button on mobile */
        height: 30px; /* Slightly smaller button on mobile */
        padding: var(--spacing-xs);
    }

    .delete-channel-btn svg {
        width: 16px; /* Smaller delete icon on mobile */
        height: 16px;
    }
    .question-box, .answer-box {
    margin-left: 0%;
    margin-right: 0%;
    }
}

/* In main-purged.css */

/* --- Desktop Two-Column Chat Layout --- */
@media (min-width: 769px) {

    /* 1. The main grid container */
    .desktop-chat-layout {
        display: grid;
        grid-template-columns: 1fr 360px; /* Right sidebar is 360px */
        gap: var(--spacing-xl);
        /* This is crucial: Make the grid take up all available space */
        height: 100%;
        /* Prevents the grid from creating its own scrollbar */
        overflow: hidden;
    }

    /* 2. The new chat column (left side) */
    .chat-column {
        display: flex; /* Make it a flex container... */
        flex-direction: column; /* ...that stacks its children vertically. */
        height: 100%;
        /* This is a flexbox/grid fix to prevent weird overflow issues */
        min-height: 0;
    }

    /* 3. Ensure the chat wrapper fills the column */
    .chat-column .chat-wrapper {
        flex-grow: 1; /* Allows the wrapper to grow and fill the space */
        display: flex;
        flex-direction: column;
        min-height: 0;
        /* Remove styles that are no longer needed */
        border-radius: 0;
        background: transparent;
    }

    /* 4. Ensure the chat history scrolls correctly */


    /* 5. The new right sidebar */
    .chat-sidebar-right {
        position: sticky;
        top: var(--spacing-sm);
        max-height: calc(100vh - (var(--spacing-sm) * 2));
        overflow-y: auto;
    }

    /* 6. Remove styles from the moved banner */
    .chat-sidebar-right .channel-info-banner,
    .chat-sidebar-right .general-qa-header {
        margin-bottom: 0;
        box-shadow: none;
        border: none;
        padding: 0;
        border-radius: 0;
        background: transparent;
    }

    /* 7. Override mobile-specific fixed header styles */
    .channel-info-banner,
    .general-qa-header {
        position: static;
        height: auto;
        padding: var(--spacing-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--neutral-200);
        border-radius: var(--radius-lg);
        margin-bottom: var(--spacing-xl);
    }
}

/* --- Mobile Only Rule (This part remains the same) --- */
@media (max-width: 768px) {
    .chat-sidebar-right {
        display: none;
    }

    .channel-info-banner, .general-qa-header {
        
        top: 0;
        left: 0;
        width: 100%;
        height: 64px;
        margin-left: 20px;
        background:#0b3b6f00;
        z-index: 998;
        border-bottom: 1px solid var(--neutral-200);
        display: flex;
        align-items: center;
        padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) calc(var(--spacing-md) + 70px);

    }
}

/* In main-purged.css */

/* In main-purged.css */

/* --- Desktop Two-Column Chat Layout --- */
@media (min-width: 769px) {
    /* 1. Force the main content area on the chat page to take up the full viewport height */
    .main-content.has-mobile-nav {
        height: 100vh;
        padding: 0; /* Remove default padding */
    }
    /* 2. Make the card inside also fill the full height */
    .main-content.has-mobile-nav .card {
        height: 100%;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: var(--spacing-sm);
    }
    /* 3. The main grid container (REMOVE overflow: hidden) */
    .desktop-chat-layout {
        display: grid;
        grid-template-columns: 1fr 360px; /* Right sidebar is 360px */
        gap: var(--spacing-xl);
        height: 100%;
    }
    /* 4. The chat column (left side) now has a defined height to fill */
    .chat-column {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }
    /* 5. The chat wrapper grows to fill the column, pushing the form down */
    .chat-column .chat-wrapper {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        border-radius: 0;
        background: transparent;
    }
    /* 6. The chat history scrolls, and the form stays put */

    .question-form {
        flex-shrink: 0; /* Prevents the form from shrinking */
    }
    /* 7. The right sidebar is now properly sticky */
    .chat-sidebar-right {
        position: sticky;
        top: var(--spacing-sm);
        max-height: calc(100vh - (var(--spacing-sm) * 2));
        overflow-y: auto; /* Its own content will scroll if it's too long */
    }
    /* 8. Reset styles for the moved banner */
    .chat-sidebar-right .channel-info-banner,
    .chat-sidebar-right .general-qa-header {
        margin-bottom: 0;
        box-shadow: none;
        border: none;
        padding: 0;
        border-radius: 0;
        background: transparent;
    }
}
/* In static/css/main-purged.css */

/* In static/css/main-purged.css */

/* --- START: DESKTOP OVERFLOW & LAYOUT FIX --- */
@media (min-width: 769px) {
    .main-content.has-mobile-nav {
        height: 100vh;
        padding: 0;
    }
    .main-content.has-mobile-nav .card {
        height: 100%;
        padding: var(--spacing-sm);
    }
    .desktop-chat-layout {
        height: 100%;
    }
}
/* --- END: DESKTOP OVERFLOW & LAYOUT FIX --- */


/* --- START: NEW MOBILE HEADER & CHAT BUBBLE STYLES --- */

/* --- END: NEW MOBILE HEADER & CHAT BUBBLE STYLES --- */

.channel-list > * {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    background-color: var(--surface-medium);
    border: 1px solid var(--neutral-200);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
}

.channel-list > *:hover {
    background-color: var(--neutral-100);
    border-color: var(--neutral-300);
    color: var(--text-primary);
}

/* --- Restored Chat Header Styles --- */
.question-header, .answer-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.question-label, .answer-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

