/* main.css */

/* =============================================================================
   PROFILE PAGE STYLES
   ============================================================================= */

/* Profile Container - Edge to Edge */
.profile-container {
    min-height: calc(100vh - 80px);
    background: var(--color-background);
    background: linear-gradient(180deg, 
        var(--messy-slate) 0%, 
        var(--messy-midnight) 50%, 
        var(--messy-darkpurple) 100%);
    position: relative;
    padding: 0;
    margin: 0;
}

/* Profile Content Wrapper */
.profile-wrapper {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Profile Header Section */
.profile-header-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
}

.profile-header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Profile Image Container */
.profile-image-container {
    position: relative;
    cursor: pointer;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(126, 87, 194, 0.3);
    transition: all 0.3s ease;
}

.profile-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(126, 87, 194, 0.8);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
}

.profile-image-overlay i {
    font-size: 1.5rem;
}

.profile-image-container:hover .profile-image-overlay {
    opacity: 1;
}

.profile-image-container:hover .profile-image {
    transform: scale(1.05);
    border-color: rgba(126, 87, 194, 0.6);
}

/* Profile Info */
.profile-info {
    flex: 1;
}

.profile-username {
    color: var(--color-foreground);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.profile-email {
    color: var(--color-muted-foreground);
    font-size: 1rem;
    margin: 0;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
}

.section-title {
    color: var(--color-foreground);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(126, 87, 194, 0.2);
    padding-bottom: 0.5rem;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Hidden Upload Field */
.hidden-upload {
    display: none;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.btn-update-profile {
    background: linear-gradient(90deg, #7e57c2 0%, #f06292 100%);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.3);
}

.btn-update-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(126, 87, 194, 0.4);
}

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

/* Statistics Section */
.profile-stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: default;
}

.stat-card.hover-lift:hover {
    background: rgba(126, 87, 194, 0.1);
    border-color: rgba(126, 87, 194, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.15);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-muted-foreground);
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--messy-violet);
}

/* Account Actions Section */
.account-actions-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 12px;
    padding: 2rem;
}

/* Action Groups */
.action-group {
    margin-bottom: 2rem;
}

.action-group:last-child {
    margin-bottom: 0;
}

.group-title {
    color: var(--color-foreground);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(126, 87, 194, 0.2);
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Action Items */
.action-item {
    display: block;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(126, 87, 194, 0.08);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-foreground);
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-item.hover-lift:hover {
    background: rgba(126, 87, 194, 0.1);
    border-color: rgba(126, 87, 194, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(126, 87, 194, 0.1);
    text-decoration: none;
    color: var(--color-foreground);
}

.action-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.action-info {
    flex: 1;
}

.action-title {
    color: var(--color-foreground);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.action-description {
    color: var(--color-muted-foreground);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.action-icon {
    color: var(--messy-violet);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.action-item:hover .action-icon {
    opacity: 1;
    transform: translateX(2px);
}

/* Status Badges */
.action-status {
    display: flex;
    align-items: center;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-enabled {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge.status-disabled {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

/* Focus States for Accessibility */
.action-item:focus,
.profile-image-container:focus,
.btn-update-profile:focus {
    outline: 2px solid var(--messy-violet);
    outline-offset: 2px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .profile-wrapper {
        padding: 0.5rem;
    }
    
    .profile-header-section {
        padding: 1.5rem;
    }
    
    .profile-header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .profile-image {
        width: 100px;
        height: 100px;
    }
    
    .profile-username {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .account-actions-section {
        padding: 1.5rem;
    }
    
    .action-item {
        padding: 1rem 0.75rem;
    }
    
    .action-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .action-status {
        align-self: flex-end;
    }
    
    .btn-update-profile {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .profile-wrapper {
        padding: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =============================================================================
   CHAT HISTORY PAGE STYLES
   ============================================================================= */

/* Main Container - Edge to Edge */
.chat-history-container {
    min-height: calc(100vh - 80px); /* Account for navbar */
    background: var(--color-background);
    background: linear-gradient(180deg, 
        var(--messy-slate) 0%, 
        var(--messy-midnight) 50%, 
        var(--messy-darkpurple) 100%);
    position: relative;
    padding: 0;
    margin: 0;
}

/* Conversations Wrapper */
.conversations-wrapper {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Conversations List */
.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Individual Conversation Item */
.conversation-item {
    display: block;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-foreground);
    transition: all 0.2s ease;
    cursor: pointer;
}

.conversation-item:hover {
    background: rgba(126, 87, 194, 0.1);
    border-color: rgba(126, 87, 194, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.15);
    text-decoration: none;
    color: var(--color-foreground);
}

/* Conversation Content Layout */
.conversation-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.conversation-main {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.conversation-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-foreground);
}

.conversation-preview {
    font-size: 0.9rem;
    color: var(--color-muted-foreground);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Conversation Meta Information */
.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.conversation-date,
.conversation-count {
    font-size: 0.85rem;
    color: var(--color-muted-foreground);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-muted-foreground);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--color-foreground);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 0;
}

/* Floating Action Button (FAB) */
.fab-new-chat {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--messy-purple);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
}

.fab-new-chat:hover {
    background: var(--messy-violet);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(126, 87, 194, 0.4);
    color: white;
    text-decoration: none;
}

.fab-new-chat:active {
    transform: translateY(0);
}

/* Quick Stats Section (Optional) */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--messy-purple);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-muted-foreground);
}

/* Mobile Responsiveness - Chat History */
@media (max-width: 768px) {
    .conversations-wrapper {
        padding: 0.5rem;
    }
    
    .conversation-item {
        padding: 1rem;
    }
    
    .conversation-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .conversation-meta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    .fab-new-chat {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet adjustments - Chat History */
@media (min-width: 769px) and (max-width: 1024px) {
    .fab-new-chat {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* Custom scrollbar for chat history page */
.chat-history-container {
    scrollbar-width: thin;
    scrollbar-color: var(--messy-violet) var(--messy-darkpurple);
}

.chat-history-container::-webkit-scrollbar {
    width: 8px;
}

.chat-history-container::-webkit-scrollbar-track {
    background: var(--messy-darkpurple);
}

.chat-history-container::-webkit-scrollbar-thumb {
    background: var(--messy-violet);
    border-radius: 4px;
}

.chat-history-container::-webkit-scrollbar-thumb:hover {
    background: var(--messy-purple);
}

/* Conversation Page Layout - Bootstrap Flexbox Implementation */

/* Remove custom flexbox - now using pure Bootstrap classes */
/* .card.chat-page-container - REMOVED: Now using .h-100.d-flex.flex-column */
/* .chat-messages-flex - REMOVED: Now using .flex-grow-1.overflow-auto */
/* .input-area-fixed - REMOVED: Now using .flex-shrink-0 */

/* Keep only conversation-specific styling that doesn't conflict with layout */

/* Edge-to-edge chat layout - Zero gap implementation */

/* Main container - remove all spacing for edge-to-edge layout (non-conversation pages only) */
main.container-fluid {
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 80px !important; /* Account for 63px navbar + 17px comfortable spacing */
    width: 100% !important;
    max-width: 100% !important;
}

/* Conversation page main container - no footer, full viewport */
main.flex-grow-1.overflow-hidden {
    /* No footer on conversation pages - reclaim full viewport */
    height: calc(100vh - 63px); /* 63px for navbar only */
    margin-bottom: 0; /* No footer spacing needed */
    padding-top: 80px; /* Account for fixed navbar (63px) + comfortable spacing (17px) */
}

/* Conversation container - remove card styling for seamless layout */
div[data-conversation-id] {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background: var(--color-background);
    color: var(--color-foreground);
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

div[data-conversation-id] .card-body {
    padding: 0 !important;
    margin: 0 !important;
}

/* Container for all chat messages with scroll - LovableUI Dark Theme - Zero Gap */
.chat-messages-container {
    overflow-y: auto;
    margin: 0 !important;
    padding: 1rem; /* Minimal internal spacing only */
    
    /* Dark theme background with gradient */
    background: var(--color-background);
    background: linear-gradient(180deg, 
        var(--messy-slate) 0%, 
        var(--messy-midnight) 50%, 
        var(--messy-darkpurple) 100%);
    border-radius: 0;
    
    /* Custom scrollbar styling for dark theme */
    scrollbar-width: thin;
    scrollbar-color: var(--messy-violet) var(--messy-darkpurple);
}

/* WebKit scrollbar styling for dark theme */
.chat-messages-container::-webkit-scrollbar {
    width: 8px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: var(--messy-darkpurple);
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: var(--messy-violet);
    border-radius: 4px;
}

.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--messy-purple);
}

/* Chat container card body styling for dark theme - Zero Gap */
#chat-messages {
    overflow-y: auto;
    margin: 0 !important;
    padding: 0.75rem 1rem !important; /* Reduced vertical padding for more viewport space */
    
    /* Dark theme styling */
    background: var(--color-background);
    background: linear-gradient(180deg, 
        var(--messy-slate) 0%, 
        var(--messy-midnight) 50%, 
        var(--messy-darkpurple) 100%);
    border-radius: 0;
    
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--messy-violet) var(--messy-darkpurple);
}

#chat-messages::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
    background: var(--messy-darkpurple);
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--messy-violet);
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--messy-purple);
}

/* Shared conversation container - Zero Gap */
.conversation-container {
    overflow-y: auto;
    margin: 0 !important;
    padding: 1rem; /* Minimal internal spacing only */
    
    /* Dark theme styling */
    background: var(--color-background);
    background: linear-gradient(180deg, 
        var(--messy-slate) 0%, 
        var(--messy-midnight) 50%, 
        var(--messy-darkpurple) 100%);
    border-radius: 0;
    
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--messy-violet) var(--messy-darkpurple);
}

.conversation-container::-webkit-scrollbar {
    width: 8px;
}

.conversation-container::-webkit-scrollbar-track {
    background: var(--messy-darkpurple);
}

.conversation-container::-webkit-scrollbar-thumb {
    background: var(--messy-violet);
    border-radius: 4px;
}

.conversation-container::-webkit-scrollbar-thumb:hover {
    background: var(--messy-purple);
}

/* Removed duplicate .card[data-conversation-id] rule - consolidated above */

div[data-conversation-id] .card-header {
    background: var(--messy-midnight) !important;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-foreground);
}

div[data-conversation-id] .card-footer {
    background: var(--messy-midnight) !important;
    border-top: 1px solid var(--color-border);
    color: var(--color-foreground);
}

/* LovableUI Dark Theme - Card Header Styling */

/* Card header - dark theme */
.card-header {
    background: var(--messy-midnight) !important;
    border-bottom: 1px solid var(--color-border) !important;
    color: var(--color-foreground) !important;
}

.card-header h3,
.card-header .mb-0 {
    color: var(--color-foreground) !important;
}

/* Header buttons - dark theme */
.card-header .btn-outline-primary {
    border-color: var(--messy-violet) !important;
    color: var(--messy-violet) !important;
    background-color: transparent !important;
}

.card-header .btn-outline-primary:hover {
    background-color: var(--messy-violet) !important;
    border-color: var(--messy-violet) !important;
    color: white !important;
}

.card-header .btn-light {
    background-color: var(--messy-slate) !important;
    border-color: var(--color-border) !important;
    color: var(--color-foreground) !important;
}

.card-header .btn-light:hover {
    background-color: var(--messy-darkpurple) !important;
    border-color: var(--messy-violet) !important;
    color: var(--color-foreground) !important;
}

/* Dropdown menu - dark theme */
.dropdown-menu {
    background-color: var(--messy-midnight) !important;
    border: 1px solid var(--color-border) !important;
}

.dropdown-item {
    color: var(--color-foreground) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--messy-slate) !important;
    color: var(--color-foreground) !important;
}

.dropdown-divider {
    border-color: var(--color-border) !important;
}

/* Responsive optimizations for LovableUI dark theme - Zero Gap Layout */
@media (max-width: 768px) {
    .chat-messages-container {
        padding: 0.75rem;
    }
    
    #chat-messages {
        padding: 0.5rem 0.75rem !important; /* Reduced vertical padding for mobile */
    }
    
    .conversation-container {
        padding: 0.75rem;
    }
    
    /* Enhanced touch scrolling on mobile */
    .chat-messages-container,
    #chat-messages,
    .conversation-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    /* Tablet optimization */
    .chat-messages-container,
    #chat-messages,
    .conversation-container {
        padding: 1rem;
    }
    
    #chat-messages {
        padding: 0.75rem 1rem !important; /* Reduced vertical padding for tablet */
    }
}

@media (min-width: 1201px) {
    /* Desktop optimization - maintain edge-to-edge but add slight internal padding */
    .chat-messages-container,
    #chat-messages,
    .conversation-container {
        padding: 1.25rem;
    }
    
    #chat-messages {
        padding: 1rem 1.25rem !important; /* Reduced vertical padding for desktop */
    }
}

@media (min-width: 1600px) {
    /* Ultra-wide screens - add max-width constraint for readability */
    .chat-messages-container,
    #chat-messages,
    .conversation-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 1.5rem;
    }
    
    #chat-messages {
        padding: 1.5rem !important; /* Override Bootstrap p-3 with ultra-wide padding */
    }
}

/* A specialized class to keep loading message bubbles at a narrower max width */
.chat-loading-bubble {
    max-width: 80%;
}

/* Only keep article content formatting if needed */
.article-content {
    white-space: pre-line;
}

/* Custom color if you want to keep the steel background */
.bg-custom-steel {
    background-color: #5f788a;
}

/* Any custom image sizing that can't be handled by Bootstrap */
.custom-account-img {
    height: 125px;
    width: 125px;
    object-fit: cover;
}

/* Styles for the message form */
.message-form textarea {
    resize: none;
    overflow: auto;
    min-height: 38px;
    width: 100%;
    box-sizing: border-box;
}

/* Remove margin from the wrapper div that crispy forms adds */
.message-form #div_id_content.mb-3 {
    margin-bottom: 0 !important;
}

.message-form .input-group {
    align-items: center; /* Center align items */
}

.message-form .form-group {
    margin-bottom: 0;
}

/* Force button height to match textarea exactly */
.message-form button[type="submit"] {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px; /* Match the single-row textarea */
}

/* Remove any extra margins from crispy form */
.message-form .asteriskField {
    display: none;
}

/* Chat message base rules */
.chat-message .message-content {
    min-width: 60px;
}

.chat-message {
    transition: opacity 0.3s ease-in-out;
}

.chat-message.loading {
    opacity: 70%;
}

/* Grey out reported messages */
.chat-message.reported {
    opacity: 50%;
}

/* Spinner smaller */
.spinner-grow {
    width: 0.7rem;
    height: 0.7rem;
}

/* --------------------------
   CLEAN CHAT BUBBLE STYLES
   -------------------------- */

/* Chat message container */
.chat-message {
    margin-bottom: 0.75rem; /* Reduced from 1rem for tighter spacing */
    width: 100%;
}

/* Message container for positioning */
.message-container {
    display: flex;
    position: relative;
    align-items: flex-start;
    gap: 0.5rem;
}

/* User messages - right aligned */
.user-message .message-container {
    justify-content: flex-end;
}

/* Assistant messages - left aligned */
.assistant-message .message-container {
    justify-content: flex-start;
}

/* Base message bubble styling */
.message-bubble {
    max-width: 70%;
    min-width: 100px;
    padding: 10px 16px; /* Reduced vertical padding for more compact bubbles */
    border-radius: 14px; /* Reduced from 18px for tighter appearance */
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* User bubble - right side, purple theme */
.user-bubble {
    background-color: var(--messy-violet);
    color: white;
    border-bottom-right-radius: 3px; /* Adjusted to match smaller overall radius */
    box-shadow: 0 1px 6px rgba(126, 87, 194, 0.25); /* Subtler shadow for lighter visual weight */
}

/* Assistant bubble - left side, dark theme */
.assistant-bubble {
    background-color: var(--messy-midnight);
    color: var(--color-foreground);
    border-bottom-left-radius: 3px; /* Adjusted to match smaller overall radius */
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15); /* Subtler shadow for lighter visual weight */
}

/* Message content styling */
.message-content {
    margin: 0 0 6px 0; /* Reduced from 8px for tighter content-timestamp spacing */
    white-space: pre-wrap;
    word-break: break-word;
}

/* Message timestamp styling */
.message-timestamp {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

.user-bubble .message-timestamp {
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
}

.assistant-bubble .message-timestamp {
    text-align: left;
    color: var(--color-foreground);
}

/* Deleted message styling */
.deleted-message {
    margin: 0;
    font-style: italic;
    opacity: 0.7;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* --------------------------
   FLOATING CONTROLS
   -------------------------- */

/* Floating controls container */
.bubble-floating-controls {
    display: flex;
    gap: 4px;
    position: absolute;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Position controls next to bubbles */
.user-message .bubble-floating-controls {
    right: 100%;
    top: 50%;
    transform: translate(-8px, -50%);
}

.assistant-message .bubble-floating-controls {
    left: 100%;
    top: 50%;
    transform: translate(8px, -50%);
}

/* Show controls on hover - DISABLED */
/* .chat-message:hover .bubble-floating-controls {
    opacity: 1;
} */

/* Control button styling */
.bubble-control-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background-color: var(--messy-slate);
    color: var(--color-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bubble-control-btn:hover {
    background-color: var(--messy-violet);
    transform: scale(1.1);
}

/* --------------------------
   HOVER ICONS
   -------------------------- */

/* Hover icons container - positioned below bubble */
.message-hover-icons {
    position: absolute;
    bottom: -35px; /* Position below the bubble with some spacing */
    right: 8px; /* Align to right edge with some padding */
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 15;
}

/* Show hover icons on message hover */
.chat-message:hover .message-hover-icons {
    opacity: 1;
}

/* Hover icon button styling */
.hover-icon-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hover-icon-btn:hover {
    background: rgba(126, 87, 194, 0.9);
    transform: scale(1.1);
}

.hover-icon-btn:active {
    transform: scale(0.95);
}

/* Special styling for copy button */
.copy-btn:hover {
    background: rgba(40, 167, 69, 0.9);
}

/* Special styling for flag button */
.flag-btn:hover {
    background: rgba(220, 53, 69, 0.9);
}

/* Mobile responsiveness for hover icons */
@media (max-width: 768px) {
    .message-hover-icons {
        bottom: -32px; /* Slightly closer on mobile */
        right: 6px;
        gap: 3px;
    }
    
    .hover-icon-btn {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    
    /* Show icons on touch devices without hover */
    @media (hover: none) {
        .chat-message .message-hover-icons {
            opacity: 0.6;
        }
        
        .chat-message:active .message-hover-icons {
            opacity: 1;
        }
    }
}

/* --------------------------
   SCROLL TO BOTTOM BUTTON
   -------------------------- */

/* Scroll to bottom floating button */
.scroll-to-bottom-btn {
    position: fixed;
    bottom: 180px; /* Higher above input area to avoid collision */
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(30, 28, 42, 0.85); /* --messy-slate with transparency */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.3); /* --messy-violet border */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 1;
}

.scroll-to-bottom-btn:hover {
    background: rgba(126, 87, 194, 0.9); /* --messy-violet on hover */
    transform: scale(1.1);
    border-color: rgba(126, 87, 194, 0.6);
}

.scroll-to-bottom-btn:active {
    transform: scale(0.95);
}

.scroll-to-bottom-btn i {
    color: var(--color-foreground);
    font-size: 20px;
}

.scroll-to-bottom-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .scroll-to-bottom-btn {
        bottom: 160px; /* Higher above input area on mobile to avoid collision */
        right: 16px;
        width: 44px;
        height: 44px;
    }
    
    .scroll-to-bottom-btn i {
        font-size: 18px;
    }
}

/* --------------------------
   REACTION CHIPS
   -------------------------- */

/* Reaction chip styling */
.reaction-chip {
    position: absolute;
    bottom: -6px;
    right: 8px;
    background: var(--messy-gold);
    border-radius: 12px;
    padding: 2px 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
}

.reaction-chip.hidden {
    display: none;
}

.reaction-emoji {
    font-size: 14px;
    line-height: 1;
}

/* --------------------------
   EMOJI PICKER
   -------------------------- */

.emoji-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--messy-midnight);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.emoji-picker button {
    background: none;
    border: none;
    cursor: pointer;
    margin: 0 4px;
    font-size: 18px;
    line-height: 1;
    white-space: nowrap;
    outline: none;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.emoji-picker button:hover {
    background-color: var(--messy-violet);
}

/* ================
   DROPDOWN MENU
   ================ */

/* Adjust spacing for .dropdown-item if they're too big */
.dropdown-menu .dropdown-item {
    margin: 0;

    /* remove extra margin if any */
    padding: 0.25rem 1rem;

    /* or reduce default if needed */
    white-space: nowrap;

    /* ensure text doesn't wrap weirdly */
}

/* LovableUI Dark Theme - Message Input Area Styling */

/* Input area container - dark theme footer */
.card-footer {
    background: var(--messy-midnight) !important;
    border-top: 1px solid var(--color-border) !important;
    padding: 1rem !important;
}

/* Message form container */
.message-form {
    margin: 0;
}

/* Input group styling */
.input-group {
    gap: 0.75rem; /* Space between input and button */
}

/* Message input box - LovableUI dark theme */
.form-control,
.message-input,
textarea.form-control {
    background-color: var(--messy-slate) !important;
    color: var(--color-foreground) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 38px;
}

/* Input focus state - purple glow */
.form-control:focus,
.message-input:focus,
textarea.form-control:focus {
    background-color: var(--messy-slate) !important;
    border-color: var(--messy-violet) !important;
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2) !important;
    outline: none !important;
    color: var(--color-foreground) !important;
}

/* Placeholder text styling */
.form-control::placeholder,
.message-input::placeholder,
textarea.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1;
}

/* Send button - LovableUI purple theme */
.btn-primary,
.btn-send,
#sendButton {
    background-color: var(--messy-violet) !important;
    border-color: var(--messy-violet) !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 500;
    min-height: 38px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease;
    box-shadow: none;
}

/* Send button hover state */
.btn-primary:hover,
.btn-send:hover,
#sendButton:hover {
    background-color: var(--messy-darkpurple) !important;
    border-color: var(--messy-darkpurple) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(126, 87, 194, 0.3);
}

/* Send button active/pressed state */
.btn-primary:active,
.btn-send:active,
#sendButton:active,
.btn-primary.active,
.btn-send.active,
#sendButton.active {
    background-color: var(--messy-darkpurple) !important;
    border-color: var(--messy-darkpurple) !important;
    color: white !important;
    transform: scale(0.95) !important;
    box-shadow: 0 2px 4px rgba(126, 87, 194, 0.4) !important;
}

/* Send button focus state */
.btn-primary:focus,
.btn-send:focus,
#sendButton:focus {
    background-color: var(--messy-violet) !important;
    border-color: var(--messy-violet) !important;
    color: white !important;
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.3) !important;
}

/* Send button disabled state */
.btn-primary:disabled,
.btn-send:disabled,
#sendButton:disabled {
    background-color: var(--messy-slate) !important;
    border-color: var(--color-border) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 0.5;
    cursor: not-allowed !important;
    transform: none !important;
}

/* File upload button (if present) - secondary style */
.btn-secondary,
.btn-upload {
    background-color: var(--messy-darkpurple) !important;
    border-color: var(--color-border) !important;
    color: var(--color-foreground) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    transition: all 0.15s ease;
}

.btn-secondary:hover,
.btn-upload:hover {
    background-color: var(--messy-midnight) !important;
    border-color: var(--messy-violet) !important;
    color: var(--color-foreground) !important;
}

.btn-secondary:focus,
.btn-upload:focus {
    background-color: var(--messy-darkpurple) !important;
    border-color: var(--messy-violet) !important;
    color: var(--color-foreground) !important;
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2) !important;
}

/* Help text styling */
.text-body-secondary,
small.text-body-secondary {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Button icon styling */
.btn i.bi {
    font-size: 1rem;
}

/* Responsive input area optimizations */
@media (max-width: 768px) {
    /* Mobile optimizations */
    .card-footer {
        padding: 0.75rem !important;
    }
    
    .input-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-control,
    .message-input,
    textarea.form-control {
        border-radius: 10px !important;
        padding: 0.875rem 1rem !important;
        font-size: 1rem; /* Prevent zoom on iOS */
        min-height: 44px; /* Touch-friendly size */
    }
    
    .btn-primary,
    .btn-send,
    #sendButton {
        width: 100%;
        min-height: 44px; /* Touch-friendly size */
        padding: 0.875rem 1.5rem !important;
        border-radius: 10px !important;
    }
    
    /* Stack buttons vertically on mobile */
    .input-group .btn {
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
}

@media (min-width: 769px) {
    /* Desktop optimizations */
    .input-group {
        flex-direction: row;
        align-items: flex-end;
    }
    
    .flex-grow-1 {
        flex: 1;
    }
    
    /* Inline layout for desktop */
    .btn-primary,
    .btn-send,
    #sendButton {
        margin-left: 0.75rem !important;
        white-space: nowrap;
    }
}

/* Loading indicator in input area - dark theme */
.spinner-grow-sm {
    color: var(--messy-violet) !important;
}

/* Toast notifications - dark theme */
.toast {
    background-color: var(--messy-midnight) !important;
    border: 1px solid var(--color-border) !important;
    color: var(--color-foreground) !important;
}

.toast-header {
    background-color: var(--messy-slate) !important;
    border-bottom: 1px solid var(--color-border) !important;
    color: var(--color-foreground) !important;
}

/* Ensure crispy forms integration */
.crispy-form .form-control {
    background-color: var(--messy-slate) !important;
    color: var(--color-foreground) !important;
    border: 1px solid var(--color-border) !important;
}

/* Form validation states - dark theme */
.form-control.is-valid {
    border-color: #28a745 !important;
    background-color: var(--messy-slate) !important;
}

.form-control.is-invalid {
    border-color: #dc3545 !important;
    background-color: var(--messy-slate) !important;
}

.valid-feedback {
    color: #28a745 !important;
}

.invalid-feedback {
    color: #dc3545 !important;
}

/* LovableUI Two-Row Input Layout Styling */

/* Row 1: Full-width input with maximize icon */
.input-row-1 {
    position: relative;
    width: 100%;
}

.input-wrapper .form-control {
    width: 100% !important;
    /* Keep existing dark theme styling */
}

.maximize-btn {
    background: transparent !important;
    border: none !important;
    color: var(--messy-violet) !important;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maximize-btn:hover {
    color: var(--color-foreground) !important;
    transform: scale(1.1);
}

.maximize-btn:focus {
    outline: 2px solid var(--messy-violet);
    outline-offset: 2px;
}

/* Row 2: Upload and Send buttons */
.input-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.btn-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    padding: 0 !important;
    border: 1px solid !important;
}

.upload-btn {
    background: var(--messy-darkpurple) !important;
    border-color: var(--color-border) !important;
    color: var(--messy-violet) !important;
}

.upload-btn:hover {
    background: var(--messy-midnight) !important;
    border-color: var(--messy-violet) !important;
    color: var(--messy-violet) !important;
    transform: scale(1.05);
}

.upload-btn:focus {
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2) !important;
    outline: none !important;
}

.send-btn {
    background: var(--messy-violet) !important;
    border-color: var(--messy-violet) !important;
    color: white !important;
}

.send-btn:hover {
    background: var(--messy-darkpurple) !important;
    border-color: var(--messy-violet) !important;
    color: white !important;
    transform: scale(1.05);
}

.send-btn:focus {
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2) !important;
    outline: none !important;
}

.send-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Responsive adjustments for two-row layout */
@media (max-width: 768px) {
    .input-row-1 {
        margin-bottom: 0.375rem;
    }
    
    .input-row-2 {
        margin-top: 0.375rem;
    }
    
    .btn-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    .maximize-btn {
        width: 20px;
        height: 20px;
        right: 0.5rem;
    }
    
    .maximize-btn i {
        font-size: 16px;
    }
    
    .btn-icon i {
        font-size: 18px;
    }
}

/* Enhanced accessibility for icon buttons */
.maximize-btn:focus-visible,
.upload-btn:focus-visible,
.send-btn:focus-visible {
    outline: 2px solid var(--messy-violet);
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
.maximize-btn i,
.upload-btn i,
.send-btn i {
    transition: transform 0.15s ease;
    font-size: 20px;
}

.maximize-btn:hover i,
.upload-btn:hover i,
.send-btn:hover i {
    transform: scale(1.1);
}

/* ===== FULLSCREEN INPUT FEATURE ===== */

/* Fullscreen overlay container */
.floating-nav-pill.input-fullscreen-overlay {
    position: fixed !important;
    top: 80px !important; /* navbar height + spacing */
    left: 20px !important;
    right: 20px !important;
    bottom: 20px !important;
    background: var(--messy-midnight) !important;
    z-index: 1040 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
    max-width: none !important; /* Override the pill max-width */
    border-radius: 20px !important;
    gap: 0 !important;
    overflow: hidden !important;
}

/* Fullscreen mode overrides for input section */
.floating-nav-pill.input-fullscreen-overlay .input-section {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
}

.floating-nav-pill.input-fullscreen-overlay .integrated-message-form {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Fullscreen input container layout */
.floating-nav-pill.input-fullscreen-overlay .input-container {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 20px 20px 0 20px !important;
    gap: 0 !important;
}

/* Fullscreen textarea wrapper */
.floating-nav-pill.input-fullscreen-overlay .input-wrapper {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 20px !important;
}

.floating-nav-pill.input-fullscreen-overlay .input-wrapper .form-control {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 400px !important;
    resize: none !important;
    font-size: 1.1rem !important;
    line-height: 1.6 !important;
    padding: 30px !important;
    border-radius: 12px !important;
    background: rgba(40, 30, 60, 0.6) !important;
    border: 1px solid rgba(126, 87, 194, 0.3) !important;
    color: var(--color-foreground) !important;
    box-sizing: border-box !important;
}

.input-fullscreen-overlay .input-wrapper .form-control:focus {
    background: var(--messy-slate) !important;
    border-color: var(--messy-violet) !important;
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2) !important;
}

/* Remove margins and ensure full width for crispy forms wrappers ONLY in fullscreen */
.floating-nav-pill.input-fullscreen-overlay .input-wrapper .mb-3,
.floating-nav-pill.input-fullscreen-overlay .input-wrapper .form-group,
.floating-nav-pill.input-fullscreen-overlay .input-wrapper #div_id_content {
    margin: 0 !important;
    width: 100% !important;
}

/* Ensure all direct children of input-wrapper take full width in fullscreen */
.floating-nav-pill.input-fullscreen-overlay .input-wrapper > * {
    width: 100% !important;
    margin: 0 !important;
}

.input-fullscreen-overlay .input-wrapper .form-control::placeholder {
    color: var(--messy-lavender) !important;
    opacity: 0.8 !important;
    font-size: 1rem !important;
}

/* Fullscreen button row - glassmorphism pill design */
.floating-nav-pill.input-fullscreen-overlay .fullscreen-button-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    padding: 12px 20px !important;
    background: rgba(30, 20, 50, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(126, 87, 194, 0.2) !important;
    border-radius: 30px !important;
    margin: 0 20px 20px 20px !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

/* Reset button positions in fullscreen */
.floating-nav-pill.input-fullscreen-overlay .attach-btn,
.floating-nav-pill.input-fullscreen-overlay .maximize-btn,
.floating-nav-pill.input-fullscreen-overlay .send-btn {
    position: static !important;
    width: 36px !important;
    height: 36px !important;
    transform: none !important;
}

.floating-nav-pill.input-fullscreen-overlay .maximize-btn {
    background: rgba(126, 87, 194, 0.2) !important;
    color: var(--messy-violet) !important;
}

.floating-nav-pill.input-fullscreen-overlay .maximize-btn:hover {
    background: rgba(126, 87, 194, 0.3) !important;
    color: var(--messy-lavender) !important;
    transform: scale(1.05) !important;
}

/* Hide navigation section in fullscreen */
.floating-nav-pill.input-fullscreen-overlay .nav-section {
    display: none !important;
}

/* Hide chat suggestions in fullscreen */
.input-fullscreen-overlay + .chat-suggestions-floating-container {
    display: none !important;
}

/* Hide suggestions when fullscreen is active */
.chat-suggestions-floating-container.fullscreen-hidden {
    display: none !important;
}

/* Animation classes */
.input-transitioning {
    transition: all 0.3s ease !important;
}

/* Responsive adjustments for fullscreen */
@media (max-width: 768px) {
    .floating-nav-pill.input-fullscreen-overlay {
        top: 70px !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        border-radius: 16px !important;
    }
    
    .floating-nav-pill.input-fullscreen-overlay .input-container {
        padding: 12px !important;
    }
    
    .floating-nav-pill.input-fullscreen-overlay .input-wrapper {
        margin-bottom: 12px !important;
    }
    
    .floating-nav-pill.input-fullscreen-overlay .input-wrapper .form-control {
        padding: 16px !important;
        font-size: 1rem !important;
        min-height: 200px !important;
        border-radius: 10px !important;
    }
    
    .floating-nav-pill.input-fullscreen-overlay .fullscreen-button-row {
        margin: 0 12px 12px 12px !important;
        padding: 10px 16px !important;
        gap: 12px !important;
    }
    
    .floating-nav-pill.input-fullscreen-overlay .attach-btn,
    .floating-nav-pill.input-fullscreen-overlay .maximize-btn,
    .floating-nav-pill.input-fullscreen-overlay .send-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
}

/* ===== END FULLSCREEN INPUT FEATURE ===== */

/* Bootstrap Offcanvas Sidebar Toggle Button */
.sidebar-toggle {
    background: none !important;
    border: none !important;
    color: var(--messy-violet) !important;
    font-size: 1.25rem;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.sidebar-toggle:hover {
    color: var(--color-foreground) !important;
}

.sidebar-toggle:focus {
    box-shadow: 0 0 0 2px rgba(126, 87, 194, 0.2) !important;
    outline: none !important;
}

/* Navbar spacing improvements for conversation pages */
.navbar .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Ensure navbar has proper width and spacing */
.navbar.fixed-top {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
}

/* Navbar flex layout improvements - ensure adequate space for sidebar toggle */
.navbar .d-flex.w-100.align-items-center > .flex-shrink-0:first-child {
    min-width: 60px; /* Adequate space for sidebar toggle */
    padding-left: 0.25rem;
}

.navbar .d-flex.w-100.align-items-center > .flex-shrink-0:last-child {
    min-width: 50px; /* Adequate space for mobile toggler */
    padding-right: 0.25rem;
}

/* Enhanced Sidebar Styling with Fallbacks */
.offcanvas.offcanvas-start#sidebarOffcanvas {
    /* Fallback properties first */
    background: #1E1C2A;
    background: var(--sidebar-bg-gradient, linear-gradient(135deg, #1E1C2A 0%, #292639 50%, #3F3356 100%)) !important;
    border-right: 1px solid rgba(126, 87, 194, 0.2) !important;
    border-right: 1px solid var(--sidebar-border-color, rgba(126, 87, 194, 0.2)) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    width: 75% !important;
    width: var(--sidebar-width-mobile, 75%) !important;
    z-index: 1050 !important;
    z-index: var(--sidebar-z-index, 1050) !important;
}

@media (min-width: 640px) {
    .offcanvas.offcanvas-start#sidebarOffcanvas {
        width: 384px !important;
        width: var(--sidebar-width-desktop, 384px) !important;
    }
}

/* Enhanced Header Styling */
.offcanvas.offcanvas-start#sidebarOffcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(126, 87, 194, 0.2) !important;
    border-bottom: 1px solid var(--sidebar-border-color, rgba(126, 87, 194, 0.2)) !important;
    padding: 1rem !important;
}

.offcanvas.offcanvas-start#sidebarOffcanvas .offcanvas-title {
    color: #E5DEFF !important;
    color: var(--section-title-color, #E5DEFF) !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

/* Enhanced Close Button Styling */
.offcanvas.offcanvas-start#sidebarOffcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease-in-out !important;
}

.offcanvas.offcanvas-start#sidebarOffcanvas .btn-close:hover {
    opacity: 1 !important;
}

/* Enhanced Body Styling */
.offcanvas.offcanvas-start#sidebarOffcanvas .offcanvas-body {
    padding: 1rem !important;
    color: #E5DEFF !important;
    color: var(--color-foreground, #E5DEFF) !important;
    /* Fixed Sidebar Layout - Account Section Always Visible */
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important; /* Prevent body from scrolling */
}

/* Fixed Top Section */
.sidebar-top {
    flex-shrink: 0 !important; /* Never shrink */
}

/* Scrollable Middle Section */
.sidebar-scrollable {
    flex: 1 !important; /* Take up remaining space */
    overflow-y: auto !important; /* Allow scrolling */
    margin-bottom: 1rem !important;
    padding-right: 0.25rem !important; /* Space for scrollbar */
}

/* Fixed Bottom Section */
.sidebar-bottom {
    flex-shrink: 0 !important; /* Never shrink */
    border-top: 1px solid rgba(229, 222, 255, 0.1) !important;
    padding-top: 1rem !important;
}

/* Remove old flex-1 class from sidebar-sections */
.sidebar-sections {
    display: block !important; /* Remove flex behavior */
    height: auto !important; /* Remove height constraint */
    overflow-y: visible !important; /* Remove old scroll behavior */
}

/* Account section no longer needs mt-auto */
.sidebar-section.account-section {
    margin-top: 0 !important;
}

/* Ensure scrollbar styling applies to new scrollable area */
.sidebar-scrollable::-webkit-scrollbar {
    width: 6px !important;
}

.sidebar-scrollable::-webkit-scrollbar-track {
    background: var(--messy-darkpurple) !important;
    background: #3F3356 !important;
    border-radius: 3px !important;
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
    background: var(--messy-violet) !important;
    background: #7E57C2 !important;
    border-radius: 3px !important;
}

.sidebar-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--messy-lavender) !important;
    background: #E5DEFF !important;
}

/* Firefox scrollbar for new scrollable area */
.sidebar-scrollable {
    scrollbar-width: thin !important;
    scrollbar-color: var(--messy-violet) var(--messy-darkpurple) !important;
    scrollbar-color: #7E57C2 #3F3356 !important;
    scroll-behavior: smooth !important;
}

/* Enhanced Backdrop Styling */
.offcanvas-backdrop.show {
    background-color: rgba(0, 0, 0, 0.8) !important;
    background-color: var(--sidebar-overlay-bg, rgba(0, 0, 0, 0.8)) !important;
    opacity: 1 !important;
}

/* New Chat Button Styling */
.new-chat-btn {
    background: var(--new-chat-btn-bg-gradient) !important;
    background: linear-gradient(90deg, #7E57C2 0%, #F06292 100%) !important;
    border: none !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 0.75rem 1rem !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    transition: var(--new-chat-btn-transition) !important;
    transition: transform 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 2px 4px rgba(126, 87, 194, 0.3) !important;
}

.new-chat-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(126, 87, 194, 0.4) !important;
    background: linear-gradient(90deg, #7E57C2 0%, #F06292 100%) !important;
}

.new-chat-btn:active {
    transform: var(--new-chat-btn-hover-transform) !important;
    transform: scale(0.95) !important;
}

.new-chat-btn:focus {
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.3) !important;
    outline: none !important;
}

/* Icon styling */
.new-chat-btn .bi {
    font-size: 18px !important;
}

/* Sidebar Sections Styling */
.sidebar-sections {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

/* Section Titles */
.section-title {
    font-size: var(--section-title-font-size) !important;
    font-size: 12px !important;
    font-weight: var(--section-title-font-weight) !important;
    font-weight: 700 !important;
    color: var(--section-title-color) !important;
    color: #E5DEFF !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 0.5rem !important;
    padding: 0 0.5rem !important;
}

/* Sidebar Links */
.sidebar-link {
    display: block !important;
    padding: 0.5rem 0.75rem !important;
    color: var(--color-foreground) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    transition: all 0.15s ease !important;
    font-size: 14px !important;
    margin-bottom: 0.25rem !important;
}

.sidebar-link:hover {
    background-color: var(--list-item-bg-hover) !important;
    background-color: rgba(126, 87, 194, 0.2) !important;
    color: white !important;
    text-decoration: none !important;
}

.sidebar-link i {
    color: var(--section-title-color) !important;
    color: #E5DEFF !important;
    width: 16px !important;
    text-align: center !important;
}

/* Logout Button Styling to Match Sidebar Links */
.sidebar-link.w-100.text-start.border-0.bg-transparent {
    color: var(--color-foreground) !important;
    color: white !important;
    text-decoration: none !important;
    padding: 0.5rem 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    border-radius: 6px !important;
    margin-bottom: 0.25rem !important;
}

.sidebar-link.w-100.text-start.border-0.bg-transparent:hover {
    background-color: var(--list-item-bg-hover) !important;
    background-color: rgba(126, 87, 194, 0.2) !important;
    color: white !important;
    text-decoration: none !important;
}

/* Recent Chat Items */
.recent-chat-item {
    display: flex !important;
    align-items: flex-start !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 6px !important;
    transition: all 0.15s ease !important;
    margin-bottom: 0.25rem !important;
    cursor: pointer !important;
    text-decoration: none !important;
    color: inherit !important;
}

.recent-chat-item:hover {
    background-color: rgba(126, 87, 194, 0.2) !important;
    text-decoration: none !important;
    color: inherit !important;
}

.recent-chat-item:visited,
.recent-chat-item:focus {
    color: inherit !important;
    text-decoration: none !important;
}

.recent-chat-item .bi {
    color: #E5DEFF !important;
    font-size: 16px !important;
    margin-top: 0.125rem !important;
    flex-shrink: 0 !important;
}

.chat-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.chat-title {
    color: white !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    margin-bottom: 0.125rem !important;
}

.chat-timestamp {
    color: var(--list-item-timestamp-color) !important;
    color: rgba(229, 222, 255, 0.7) !important;
    font-size: 12px !important;
    line-height: 1 !important;
}

/* More Button */
.more-chats-btn {
    background: none !important;
    border: none !important;
    color: var(--section-title-color) !important;
    color: #E5DEFF !important;
    font-size: 14px !important;
    padding: 0.5rem 0.75rem !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.more-chats-btn:hover {
    color: white !important;
    background-color: rgba(126, 87, 194, 0.1) !important;
    text-decoration: none !important;
}

.more-chats-btn:visited,
.more-chats-btn:focus {
    color: #E5DEFF !important;
    text-decoration: underline !important;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(229, 222, 255, 0.1) !important;
    margin-top: auto !important;
    padding-top: 1rem !important;
    text-align: center !important;
}

.sidebar-footer .text-muted {
    color: rgba(229, 222, 255, 0.5) !important;
    font-size: 12px !important;
}

/* Sidebar footer links styling - horizontal icon layout */
.sidebar-footer .sidebar-link {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.25rem !important;
    margin: 0 !important;
    color: rgba(229, 222, 255, 0.7) !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 28px !important;
}

.sidebar-footer .sidebar-link:hover {
    color: var(--messy-lavender) !important;
    background-color: rgba(126, 87, 194, 0.25) !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
}

.sidebar-footer .sidebar-link i {
    font-size: 0.85rem !important;
    opacity: 0.9 !important;
}

/* Conversation Footer CSS Removed - footer eliminated for viewport optimization */

/* Custom Scrollbar Styling for Dark Theme */

/* WebKit Browsers (Chrome, Safari, Edge) */
#chat-messages::-webkit-scrollbar,
.sidebar-sections::-webkit-scrollbar,
.offcanvas-body::-webkit-scrollbar,
.chat-messages-container::-webkit-scrollbar,
.conversation-container::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track,
.sidebar-sections::-webkit-scrollbar-track,
.offcanvas-body::-webkit-scrollbar-track,
.chat-messages-container::-webkit-scrollbar-track,
.conversation-container::-webkit-scrollbar-track {
    background: var(--messy-darkpurple);
    background: #3F3356;
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb,
.sidebar-sections::-webkit-scrollbar-thumb,
.offcanvas-body::-webkit-scrollbar-thumb,
.chat-messages-container::-webkit-scrollbar-thumb,
.conversation-container::-webkit-scrollbar-thumb {
    background: var(--messy-violet);
    background: #7E57C2;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#chat-messages::-webkit-scrollbar-thumb:hover,
.sidebar-sections::-webkit-scrollbar-thumb:hover,
.offcanvas-body::-webkit-scrollbar-thumb:hover,
.chat-messages-container::-webkit-scrollbar-thumb:hover,
.conversation-container::-webkit-scrollbar-thumb:hover {
    background: var(--messy-lavender);
    background: #E5DEFF;
}

/* Firefox Support */
#chat-messages,
.sidebar-sections,
.offcanvas-body,
.chat-messages-container,
.conversation-container {
    scrollbar-width: thin;
    scrollbar-color: var(--messy-violet) var(--messy-darkpurple);
    scrollbar-color: #7E57C2 #3F3356;
}

/* Body Scrollbar for Overall Page */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: var(--messy-darkpurple);
    background: #3F3356;
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb {
    background: var(--messy-violet);
    background: #7E57C2;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

body::-webkit-scrollbar-thumb:hover {
    background: var(--messy-lavender);
    background: #E5DEFF;
}

body {
    scrollbar-width: thin;
    scrollbar-color: var(--messy-violet) var(--messy-darkpurple);
    scrollbar-color: #7E57C2 #3F3356;
}

/* Hide body scrollbar completely on conversation pages */
body.d-flex.flex-column.vh-100.overflow-hidden {
    overflow: hidden !important;
}

body.d-flex.flex-column.vh-100.overflow-hidden::-webkit-scrollbar {
    display: none !important;
}

/* Mobile Responsive Scrollbars */
@media (max-width: 768px) {
    #chat-messages::-webkit-scrollbar,
    .sidebar-sections::-webkit-scrollbar,
    .offcanvas-body::-webkit-scrollbar,
    .chat-messages-container::-webkit-scrollbar,
    .conversation-container::-webkit-scrollbar,
    body::-webkit-scrollbar {
        width: 6px;
    }
    
    /* Adjust main container height for mobile navbar - no footer */
    main.flex-grow-1.overflow-hidden {
        height: calc(100vh - 63px); /* 63px navbar only - no footer on conversation pages */
        margin-bottom: 0; /* No footer spacing needed */
        padding-top: 80px; /* Account for fixed navbar (63px) + comfortable spacing (17px) */
    }
    
    /* Conversation footer mobile CSS removed - footer eliminated */
}

/* Smooth Scrolling Enhancement */
#chat-messages,
.sidebar-sections,
.offcanvas-body,
.chat-messages-container,
.conversation-container,
body {
    scroll-behavior: smooth;
}

/* ===== CHAT SUGGESTIONS - FLOATING PILLS ===== */

/* Main floating container for chat suggestions */
.chat-suggestions-floating-container {
    position: absolute;
    bottom: 100%; /* Position above the card-footer */
    left: 1rem;
    right: 1rem;
    margin-bottom: 2rem; /* Optimized buffer to prevent overlap while preserving viewport */
    display: flex; /* Always visible by default */
    flex-wrap: nowrap; /* Keep all pills on single line */
    gap: 0.5rem;
    z-index: 1000; /* Boosted z-index to guarantee visibility above all content */
    pointer-events: auto;
    max-height: 120px; /* Prevent overflow */
    overflow-y: hidden; /* No vertical scrolling needed for single line */
    overflow-x: auto; /* Allow horizontal scrolling if needed */
    scrollbar-width: none; /* Hide scrollbar in Firefox */
    padding: 0.25rem 0;
}

/* Individual suggestion pill styling */
.chat-suggestion-pill {
    background: rgba(30, 28, 42, 0.9); /* messy-slate with transparency */
    color: var(--color-foreground);
    border: 1px solid rgba(126, 87, 194, 0.3); /* messy-violet border */
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    user-select: none;
    flex-shrink: 0; /* Prevent pills from shrinking and breaking text */
    
    /* Ensure readable text */
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hover state for pills */
.chat-suggestion-pill:hover {
    background: rgba(63, 51, 86, 0.9); /* messy-darkpurple with transparency */
    border-color: rgba(126, 87, 194, 0.6); /* brighter messy-violet border */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.3);
    color: var(--messy-lavender);
}

/* Active/pressed state for pills */
.chat-suggestion-pill:active {
    transform: translateY(0);
    background: rgba(126, 87, 194, 0.8); /* messy-violet background */
    border-color: var(--messy-violet);
    color: white;
}

/* Focus state for accessibility */
.chat-suggestion-pill:focus {
    outline: 2px solid var(--messy-violet);
    outline-offset: 2px;
    background: rgba(63, 51, 86, 0.9);
    border-color: var(--messy-violet);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .chat-suggestions-floating-container {
        left: 0.75rem;
        right: 0.75rem;
        gap: 0.375rem;
        max-height: 100px;
        flex-wrap: nowrap; /* Ensure single line on mobile too */
    }
    
    .chat-suggestion-pill {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
        border-radius: 18px;
    }
}

/* Responsive adjustments for tablet */
@media (min-width: 769px) and (max-width: 1200px) {
    .chat-suggestions-floating-container {
        left: 1rem;
        right: 1rem;
        margin-bottom: 0.625rem;
    }
    
    .chat-suggestion-pill {
        padding: 0.4375rem 0.875rem;
        font-size: 0.8438rem;
    }
}

/* Responsive adjustments for desktop */
@media (min-width: 1201px) {
    .chat-suggestions-floating-container {
        left: 1.25rem;
        right: 1.25rem;
        margin-bottom: 0.875rem;
    }
    
    .chat-suggestion-pill {
        padding: 0.5625rem 1.125rem;
        font-size: 0.9375rem;
    }
}

/* Ensure pills container doesn't interfere with chat messages */
.card-footer {
    position: relative; /* Create positioning context for absolute pills */
}

/* Hide horizontal scrollbar for clean appearance */
.chat-suggestions-floating-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar in WebKit browsers (Chrome, Safari, Edge) */
}

/* ===== MOBILE NAVIGATION BAR ===== */

/* Mobile Navigation Bar - Base Styles */
.mobile-nav-bar {
    display: none; /* Hidden by default - only shown on mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--messy-midnight);
    background: linear-gradient(180deg, var(--messy-midnight) 0%, var(--messy-darkpurple) 100%);
    border-top: 1px solid var(--color-border);
    z-index: 1045; /* Above content (1040) but below modals (1050) */
    padding: 0 env(safe-area-inset-left) 0 env(safe-area-inset-right); /* iOS safe areas */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
}

/* Navigation Button Styles */
.mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--messy-violet);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    padding: 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.mobile-nav-btn i {
    font-size: 24px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.mobile-nav-btn span {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 500;
}

/* Center button (New Chat) special styling */
.mobile-nav-btn.new-chat {
    color: white;
}

.mobile-nav-btn.new-chat i {
    background: var(--messy-violet);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 2px 8px rgba(126, 87, 194, 0.3);
}

/* Hover/Active states */
.mobile-nav-btn:hover {
    color: var(--messy-lavender);
}

.mobile-nav-btn:active {
    transform: scale(0.95);
}

.mobile-nav-btn:active i {
    transform: scale(0.9);
}

/* Active page indicator */
.mobile-nav-btn.active {
    color: var(--messy-lavender);
}

.mobile-nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--messy-violet);
    border-radius: 3px 3px 0 0;
}

/* Mobile-only Display & Layout Adjustments */
@media (max-width: 768px) {
    /* Show mobile nav bar */
    .mobile-nav-bar {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    /* Adjust input footer position to sit above nav bar */
    div[data-conversation-id] .card-footer {
        position: fixed !important;
        bottom: 56px !important;
        left: 0;
        right: 0;
        z-index: 1040;
        /* Maintain existing padding */
        padding: 0.75rem !important;
    }
    
    /* Adjust chat messages container height */
    #chat-messages {
        /* Account for: navbar (63px) + mobile nav (56px) + input area (~153px) */
        height: calc(100vh - 63px - 56px - 153px) !important;
        padding-bottom: 1rem;
    }
    
    /* Adjust main container to prevent content being hidden */
    main.flex-grow-1.overflow-hidden {
        /* Add padding to prevent content from being hidden behind fixed elements */
        padding-bottom: calc(153px + 56px) !important;
        height: calc(100vh - 63px) !important;
    }
    
    /* Adjust suggestions pills to float higher - MOBILE SPACING FIX */
    .chat-suggestions-floating-container {
        /* Reduced from calc(2rem + 56px) to 8px for better mobile UX */
        margin-bottom: 8px !important;
    }
    
    /* Adjust fullscreen input overlay */
    .input-fullscreen-overlay {
        bottom: 56px !important;
        height: calc(100vh - 63px - 56px) !important;
    }
    
    /* Adjust toast container to appear above nav bar */
    .toast-container {
        bottom: calc(56px + 1rem) !important;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-nav-bar {
        height: 48px; /* Slightly shorter in landscape */
    }
    
    .mobile-nav-btn i {
        font-size: 20px;
    }
    
    .mobile-nav-btn span {
        font-size: 10px;
    }
    
    .mobile-nav-btn.new-chat i {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    /* Adjust other elements accordingly */
    div[data-conversation-id] .card-footer {
        bottom: 48px !important;
    }
    
    #chat-messages {
        height: calc(100vh - 63px - 48px - 153px) !important;
    }
    
    .chat-suggestions-floating-container {
        margin-bottom: 8px !important; /* Consistent with mobile fix */
    }
    
    .input-fullscreen-overlay {
        bottom: 48px !important;
        height: calc(100vh - 63px - 48px) !important;
    }
}

/* iOS Safe Area Support */
@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .mobile-nav-bar {
            padding-bottom: env(safe-area-inset-bottom);
            height: calc(56px + env(safe-area-inset-bottom));
        }
        
        div[data-conversation-id] .card-footer {
            bottom: calc(56px + env(safe-area-inset-bottom)) !important;
        }
        
        #chat-messages {
            height: calc(100vh - 63px - 56px - env(safe-area-inset-bottom) - 153px) !important;
        }
        
        .chat-suggestions-floating-container {
            margin-bottom: calc(8px + env(safe-area-inset-bottom)) !important; /* Keep safe area but reduce base margin */
        }
    }
}

/* ===== END MOBILE NAVIGATION BAR ===== */

/* ===== GLASSMORPHISM FLOATING NAVIGATION ===== */

/* Container for the floating navigation */
.floating-nav-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 1040;
    pointer-events: none; /* Allow clicks through container */
}

.floating-nav-container > * {
    pointer-events: auto; /* Enable clicks on child elements */
}

/* Main floating pill with glassmorphism effect */
.floating-nav-pill {
    background: rgba(30, 20, 50, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(126, 87, 194, 0.2);
    border-radius: 30px;
    padding: 12px 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    margin: 0 auto;
}

.floating-nav-pill:hover {
    background: rgba(30, 20, 50, 0.9);
    border-color: rgba(126, 87, 194, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Navigation section (mobile/tablet only) */
.nav-section {
    display: none;
    align-items: center;
    gap: 8px;
    border-right: 1px solid rgba(126, 87, 194, 0.2);
    padding-right: 16px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 60px;
}

.nav-btn i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-btn span {
    font-size: 10px;
    font-weight: 500;
}

.nav-btn:hover {
    color: var(--messy-lavender);
    background: rgba(126, 87, 194, 0.1);
    text-decoration: none;
}

.nav-btn-primary {
    color: white !important;
}

.nav-btn-primary i {
    background: var(--messy-violet);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Input section */
.input-section {
    flex: 1;
    min-width: 0;
}

.integrated-message-form {
    width: 100%;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(40, 30, 60, 0.6);
    border: 1px solid rgba(126, 87, 194, 0.3);
    border-radius: 25px;
    padding: 6px 10px;
    transition: all 0.2s ease;
}

.input-container:focus-within {
    background: rgba(40, 30, 60, 0.8);
    border-color: var(--messy-violet);
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2);
}

.input-wrapper {
    flex: 1;
    min-width: 0;
}

.input-wrapper .form-control {
    background: transparent !important;
    border: none !important;
    color: var(--color-foreground) !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    min-height: 40px;
    max-height: 120px;
}

.input-wrapper .form-control:focus {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.input-wrapper .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Button styling within input */
.attach-btn, .send-btn, .maximize-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    flex-grow: 0;
    padding: 0;
    font-size: 14px;
}

.attach-btn {
    background: rgba(126, 87, 194, 0.2);
    color: var(--messy-violet);
}

.attach-btn:hover {
    background: rgba(126, 87, 194, 0.3);
    color: var(--messy-lavender);
    transform: scale(1.05);
}

.maximize-btn {
    background: rgba(126, 87, 194, 0.2);
    color: var(--messy-violet);
}

.maximize-btn:hover {
    background: rgba(126, 87, 194, 0.3);
    color: var(--messy-lavender);
    transform: scale(1.05);
}

.send-btn {
    background: var(--messy-violet);
    color: white;
}

.send-btn:hover {
    background: var(--messy-darkpurple);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .floating-nav-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .floating-nav-pill {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        border-radius: 25px;
    }
    
    .nav-section {
        display: flex;
        width: 100%;
        justify-content: space-around;
        border-right: none;
        border-bottom: 1px solid rgba(126, 87, 194, 0.2);
        padding-right: 0;
        padding-bottom: 12px;
        margin-bottom: 4px;
    }
    
    .input-section {
        width: 100%;
    }
    
    .input-container {
        padding: 8px 12px;
        gap: 10px;
    }
    
    .attach-btn, .send-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    /* Make send button slightly larger for better tap target */
    .send-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        font-size: 20px;
        /* Ensure button stays circular */
        aspect-ratio: 1;
        flex-shrink: 0 !important;
        /* Add subtle shadow for better visibility */
        box-shadow: 0 2px 8px rgba(126, 87, 194, 0.3);
    }
    
    /* Active state for better feedback */
    .send-btn:active {
        transform: scale(0.95);
        box-shadow: 0 1px 4px rgba(126, 87, 194, 0.2);
    }
    
    /* Adjust icon size inside buttons */
    .attach-btn i, .send-btn i {
        font-size: inherit;
    }
    
    /* Hide old mobile nav styles */
    .mobile-nav-bar {
        display: none !important;
    }
    
    /* Adjust chat messages container */
    #chat-messages {
        height: calc(100vh - 63px - 120px) !important;
        padding-bottom: 1rem;
    }
    
    /* Adjust main container */
    main.flex-grow-1.overflow-hidden {
        padding-bottom: 120px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet - show navigation */
    .nav-section {
        display: flex;
    }
    
    .floating-nav-pill {
        max-width: 600px;
    }
    
    /* Hide old mobile nav styles */
    .mobile-nav-bar {
        display: none !important;
    }
    
    /* Adjust chat messages container */
    #chat-messages {
        height: calc(100vh - 63px - 100px) !important;
        padding-bottom: 1rem;
    }
}

@media (min-width: 1025px) {
    /* Desktop - hide navigation, show only input */
    .nav-section {
        display: none;
    }
    
    .floating-nav-pill {
        /* Removed max-width to allow full width expansion */
        padding: 10px 16px;
    }
    
    /* Hide old mobile nav styles */
    .mobile-nav-bar {
        display: none !important;
    }
    
    /* Adjust chat messages container */
    #chat-messages {
        height: calc(100vh - 63px - 100px) !important;
        padding-bottom: 1rem;
    }
}

/* Ultra-wide screens - reasonable max-width for input bar */
@media (min-width: 1600px) {
    .floating-nav-pill {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Chat suggestions positioning - handled by responsive media queries above */

/* ===== END GLASSMORPHISM FLOATING NAVIGATION ===== */

/* =============================================================================
   FLOATING NAVBAR STYLES (TEST)
   ============================================================================= */

/* Floating navbar container */
.floating-navbar-container {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1030;
    pointer-events: none; /* Allow clicks through container */
}

.floating-navbar-container > * {
    pointer-events: auto; /* Enable clicks on child elements */
}

/* Floating navbar pill with glassmorphism - More specific selectors */
.floating-navbar-container .floating-navbar-pill {
    background: rgba(30, 20, 50, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(126, 87, 194, 0.2) !important;
    border-radius: 20px !important;
    padding: 12px 20px !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
    min-height: 48px;
}

.floating-navbar-container .floating-navbar-pill:hover {
    background: rgba(30, 20, 50, 0.9) !important;
    border-color: rgba(126, 87, 194, 0.4) !important;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

/* Sidebar toggle button - positioned absolutely */
.sidebar-toggle-floating {
    position: absolute;
    left: 16px;
    background: transparent;
    border: none;
    color: var(--messy-lavender);
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-toggle-floating:hover {
    background: rgba(126, 87, 194, 0.2);
    color: white;
    transform: translateY(-1px);
}

.sidebar-toggle-floating:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(126, 87, 194, 0.4);
}

/* Centered brand logo */
.navbar-brand-floating {
    color: var(--messy-lavender);
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: all 0.2s ease;
}

.navbar-brand-floating:hover {
    color: white;
    transform: translateY(-1px);
}

/* Navigation links for landing/auth pages */
.nav-link-floating {
    position: absolute;
    right: 16px;
    color: var(--messy-lavender);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-link-floating:hover {
    background: rgba(126, 87, 194, 0.2);
    color: white;
}

.nav-links-floating {
    position: absolute;
    right: 16px;
    display: flex;
    gap: 12px;
}

.nav-links-floating .nav-link-floating {
    position: static;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .floating-navbar-container {
        top: 16px;
        left: 16px;
        right: 16px;
    }
    
    .floating-navbar-container .floating-navbar-pill {
        padding: 10px 16px !important;
        border-radius: 18px !important;
        min-height: 44px;
    }
    
    .sidebar-toggle-floating {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        left: 12px;
    }
    
    .navbar-brand-floating {
        font-size: 1.25rem;
    }
    
    .nav-link-floating {
        font-size: 0.85rem;
        padding: 6px 12px;
        right: 12px;
    }
    
    .nav-links-floating {
        gap: 8px;
        right: 12px;
    }
}

/* Adjust main content spacing for floating navbar */
body.floating-navbar-active main.container-fluid {
    padding-top: 100px !important; /* 60px navbar + 40px spacing */
}

/* Override for login page - remove top padding for full gradient coverage */
body.floating-navbar-active main.container-fluid:has(.login-container) {
    padding-top: 0 !important;
}

/* Override for chat history page - remove dark padding behind navbar */
body.floating-navbar-active main.container-fluid:has(.chat-history-container) {
    padding-top: 0 !important;
}

/* Override for landing page - remove top padding for full gradient coverage */
body.floating-navbar-active main.container-fluid:has(.landing-container) {
    padding-top: 0 !important;
}

/* Add spacing between floating navbar and chat history content */
body.floating-navbar-active .chat-history-container {
    padding-top: 80px;
}

body.floating-navbar-active main.flex-grow-1.overflow-hidden {
    height: calc(100vh - 80px); /* Account for floating navbar */
    padding-top: 100px;
}

/* Chat messages with smooth fade effects for floating navbar test pages */
body.floating-navbar-active #chat-messages {
    height: calc(100vh - 100px) !important; /* Adjust total height to account for navbar */
    
    /* Smooth gradient masks for fade effects */
    mask: linear-gradient(
        to bottom,
        transparent 0px,
        black 80px,                    /* Fade-in from top navbar */
        black calc(100% - 160px),      /* Content area */
        transparent 100%               /* Fade-out to bottom input */
    );
    -webkit-mask: linear-gradient(
        to bottom,
        transparent 0px,
        black 80px,
        black calc(100% - 160px),
        transparent 100%
    );
    
    /* Smooth transition when mask changes */
    transition: mask 0.3s ease, -webkit-mask 0.3s ease;
}

/* Extended bottom fade when chat suggestions are visible */
body.floating-navbar-active #chat-messages.suggestions-visible {
    mask: linear-gradient(
        to bottom,
        transparent 0px,
        black 80px,                    /* Fade-in from top navbar */
        black calc(100% - 220px),      /* Extended fade area for suggestion pills */
        transparent 100%               /* Fade-out to bottom including pills */
    );
    -webkit-mask: linear-gradient(
        to bottom,
        transparent 0px,
        black 80px,
        black calc(100% - 220px),
        transparent 100%
    );
}

/* Mobile responsive fade adjustments for floating navbar test pages */
@media (max-width: 768px) {
    body.floating-navbar-active #chat-messages {
        height: calc(100vh - 80px) !important; /* Mobile height adjustment */
        
        /* Mobile fade masks with smaller distances */
        mask: linear-gradient(
            to bottom,
            transparent 0px,
            black 60px,                    /* Smaller top fade for mobile navbar */
            black calc(100% - 140px),      /* Adjusted bottom fade for mobile input */
            transparent 100%
        );
        -webkit-mask: linear-gradient(
            to bottom,
            transparent 0px,
            black 60px,
            black calc(100% - 140px),
            transparent 100%
        );
    }
    
    /* Mobile suggestions visible state */
    body.floating-navbar-active #chat-messages.suggestions-visible {
        mask: linear-gradient(
            to bottom,
            transparent 0px,
            black 60px,                    /* Mobile top fade */
            black calc(100% - 180px),      /* Extended mobile bottom fade for pills */
            transparent 100%
        );
        -webkit-mask: linear-gradient(
            to bottom,
            transparent 0px,
            black 60px,
            black calc(100% - 180px),
            transparent 100%
        );
    }
}

/* ===== END FLOATING NAVBAR STYLES ===== */

/* =============================================================================
   ANNOUNCEMENTS PAGE STYLES
   ============================================================================= */

/* Subscription section specific styling */
.subscription-section {
    border: 1px solid rgba(126, 87, 194, 0.2) !important;
    background: rgba(126, 87, 194, 0.03) !important;
}

.subscription-section .terms-section-title {
    color: var(--messy-violet);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subscription-section .terms-section-title i {
    font-size: 1.5rem;
}

/* Subscription status indicators */
.subscription-status {
    margin-bottom: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-indicator.subscribed {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.status-indicator.unsubscribed {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.status-indicator i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.status-indicator .terms-paragraph {
    margin: 0;
    color: var(--color-foreground);
}

/* Subscription form */
.subscription-form {
    margin-top: 1rem;
}

/* Announcement buttons */
.announcement-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-subscribe {
    background: var(--messy-violet);
    color: white;
}

.btn-subscribe:hover {
    background: var(--messy-darkpurple);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.3);
    color: white;
}

.btn-unsubscribe {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.btn-unsubscribe:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    color: white;
}

/* Announcements list */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Individual announcement items */
.announcement-item {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.2s ease;
}

.announcement-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(126, 87, 194, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.1);
}

/* Announcement header */
.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.announcement-title {
    font-size: 1.375rem; /* 22px */
    font-weight: 600;
    color: var(--color-foreground);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.announcement-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem; /* 14px */
    color: var(--color-muted-foreground);
    white-space: nowrap;
    flex-shrink: 0;
}

.announcement-date i {
    font-size: 1rem;
    color: var(--messy-violet);
}

/* Announcement body */
.announcement-body {
    font-size: 1rem; /* 16px - Standard legible size */
    line-height: 1.6;
    color: var(--color-foreground);
}

.announcement-body p {
    margin-bottom: 1rem;
}

.announcement-body p:last-child {
    margin-bottom: 0;
}

/* Empty state styling (reusing from chat history) */
.announcements-list .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-muted-foreground);
}

.announcements-list .empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
    color: var(--messy-violet);
}

.announcements-list .empty-state h4 {
    color: var(--color-foreground);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.announcements-list .empty-state p {
    margin-bottom: 0;
    font-size: 1rem;
}

/* Mobile responsiveness for announcements page */
@media (max-width: 768px) {
    .announcement-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .announcement-title {
        font-size: 1.25rem; /* 20px */
    }
    
    .announcement-date {
        font-size: 0.8125rem; /* 13px */
    }
    
    .announcement-item {
        padding: 1.5rem;
    }
    
    .subscription-section {
        padding: 1.5rem;
    }
    
    .status-indicator {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: left;
    }
    
    .announcement-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
    }
    
    .announcements-list .empty-state {
        padding: 3rem 1rem;
    }
    
    .announcements-list .empty-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .announcement-item {
        padding: 1.75rem;
    }
    
    .announcement-title {
        font-size: 1.3125rem; /* 21px */
    }
    
    .subscription-section {
        padding: 1.75rem;
    }
}

/* Desktop large screens */
@media (min-width: 1200px) {
    .announcement-item {
        padding: 2.5rem;
    }
    
    .announcement-title {
        font-size: 1.5rem; /* 24px */
    }
    
    .subscription-section {
        padding: 2.5rem;
    }
}

/* Focus states for accessibility */
.announcement-btn:focus {
    outline: 2px solid var(--messy-violet);
    outline-offset: 2px;
}

.announcement-item:focus-within {
    border-color: rgba(126, 87, 194, 0.3);
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2);
}

/* Print styles for announcements page */
@media print {
    .subscription-section {
        background: none !important;
        backdrop-filter: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    .announcement-item {
        background: none !important;
        backdrop-filter: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        transform: none !important;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .announcement-title,
    .terms-section-title,
    .announcement-body,
    .terms-paragraph {
        color: #000 !important;
    }
    
    .announcement-date,
    .status-indicator {
        color: #666 !important;
    }
    
    .announcement-btn {
        display: none;
    }
}

/* =============================================================================
   END ANNOUNCEMENTS PAGE STYLES
   ============================================================================= */

/* =============================================================================
   INVITATIONS PAGE STYLES
   ============================================================================= */

/* Main layout for invitations page */
.invites-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Left sidebar with form and stats */
.invites-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Right main area with table */
.invites-main {
    min-width: 0; /* Allow content to shrink */
}

/* Form section styling */
.invite-form-section .terms-section-title {
    color: var(--messy-violet);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invite-form-section .terms-section-title i {
    font-size: 1.5rem;
}

/* Form styling */
.invite-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-foreground);
}

.invite-form input[type="email"] {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(126, 87, 194, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-foreground);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.invite-form input[type="email"]:focus {
    outline: none;
    border-color: var(--messy-violet);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2);
}

.invite-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-error {
    color: #ff6b6b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-help {
    color: var(--color-muted-foreground);
    font-size: 0.875rem;
}

/* Stats section styling */
.invite-stats-section .terms-section-title {
    color: var(--messy-teal);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invite-stats-section .terms-section-title i {
    font-size: 1.5rem;
}

.invite-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(126, 87, 194, 0.2);
    transform: translateY(-1px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-value.total {
    color: var(--messy-violet);
}

.stat-value.pending {
    color: #ffc107;
}

.stat-value.used {
    color: #28a745;
}

.stat-value.expired {
    color: #dc3545;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    font-weight: 500;
}

/* Table section styling */
.invite-table-section .terms-section-title {
    color: var(--messy-violet);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invite-table-section .terms-section-title i {
    font-size: 1.5rem;
}

.invite-table-container {
    margin: 1.5rem 0;
}

/* Table styling */
.invite-table {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.invite-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 1.5rem;
    align-items: center;
    transition: all 0.2s ease;
}

.invite-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(126, 87, 194, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.1);
}

/* Email column */
.invite-email {
    min-width: 0;
}

.email-address {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-foreground);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.email-dates {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-item {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-item i {
    color: var(--messy-violet);
    flex-shrink: 0;
}

/* Status column */
.invite-status {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid;
}

.status-badge.used {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.status-badge.expired {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.status-badge.active {
    background: rgba(23, 162, 184, 0.1);
    border-color: rgba(23, 162, 184, 0.3);
    color: #17a2b8;
}

.status-badge.email-sent {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.status-badge.email-failed {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.status-badge.email-pending {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

/* Actions column */
.invite-actions {
    display: flex;
    justify-content: flex-end;
}

/* Button styling */
.invitation-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-send-invite {
    background: var(--messy-violet);
    color: white;
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.5rem;
}

.btn-send-invite:hover {
    background: var(--messy-darkpurple);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.3);
    color: white;
    text-decoration: none;
}

.btn-resend {
    background: rgba(23, 162, 184, 0.8);
    color: white;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.btn-resend:hover {
    background: rgba(23, 162, 184, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
    color: white;
    text-decoration: none;
}

.btn-renew {
    background: rgba(255, 193, 7, 0.8);
    color: #000;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.btn-renew:hover {
    background: rgba(255, 193, 7, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    color: #000;
    text-decoration: none;
}

.btn-view-all {
    background: rgba(126, 87, 194, 0.1);
    color: var(--messy-violet);
    border: 1px solid rgba(126, 87, 194, 0.3);
}

.btn-view-all:hover {
    background: rgba(126, 87, 194, 0.2);
    color: var(--messy-lavender);
    text-decoration: none;
}

.btn-disabled {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
    cursor: not-allowed;
}

/* Table footer */
.invite-table-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(126, 87, 194, 0.1);
}

/* Empty state for invitations table */
.invite-table-container .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-muted-foreground);
}

.invite-table-container .empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
    color: var(--messy-violet);
}

.invite-table-container .empty-state h4 {
    color: var(--color-foreground);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.invite-table-container .empty-state p {
    margin-bottom: 0;
    font-size: 1rem;
}

/* Mobile responsiveness for invitations page */
@media (max-width: 1024px) {
    .invites-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .invite-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: left;
    }
    
    .invite-actions {
        justify-content: flex-start;
    }
    
    .invite-status {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .invites-sidebar {
        gap: 1.5rem;
    }
    
    .invite-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .invite-row {
        padding: 1rem;
    }
    
    .email-address {
        font-size: 0.9375rem;
    }
    
    .date-item {
        font-size: 0.8125rem;
    }
    
    .status-badge {
        font-size: 0.8125rem;
        padding: 0.375rem 0.625rem;
    }
    
    .invitation-btn {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
    
    .invite-table-container .empty-state {
        padding: 3rem 1rem;
    }
    
    .invite-table-container .empty-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .invite-stats {
        grid-template-columns: 1fr;
    }
    
    .email-dates {
        gap: 0.125rem;
    }
    
    .date-item {
        font-size: 0.75rem;
    }
    
    .invite-status {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Focus states for accessibility */
.invitation-btn:focus {
    outline: 2px solid var(--messy-violet);
    outline-offset: 2px;
}

.invite-form input[type="email"]:focus {
    outline: none;
    border-color: var(--messy-violet);
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2);
}

.invite-row:focus-within {
    border-color: rgba(126, 87, 194, 0.3);
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2);
}

/* Print styles for invitations page */
@media print {
    .invites-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .terms-section,
    .invite-row,
    .stat-item {
        background: none !important;
        backdrop-filter: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        transform: none !important;
        break-inside: avoid;
    }
    
    .terms-section-title,
    .email-address,
    .stat-value,
    .form-label {
        color: #000 !important;
    }
    
    .date-item,
    .stat-label,
    .form-help {
        color: #666 !important;
    }
    
    .invitation-btn {
        display: none;
    }
    
    .status-badge {
        border-color: #666 !important;
        color: #000 !important;
    }
}

/* =============================================================================
   END INVITATIONS PAGE STYLES
   ============================================================================= */

/* =============================================================================
   TERMS OF SERVICE PAGE STYLES
   ============================================================================= */

/* Terms page content wrapper */
.terms-content {
    max-width: 900px; /* Optimal reading width */
    margin: 0 auto;
    padding: 2rem 0;
}

/* Main title styling */
.terms-title {
    font-size: 2.25rem; /* 36px - Large and prominent */
    font-weight: 700;
    color: var(--color-foreground);
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.2;
}

/* Last updated section */
.terms-last-updated {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.terms-last-updated h4 {
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    color: var(--messy-violet);
    margin-bottom: 0.5rem;
}

.terms-last-updated p {
    font-size: 1rem; /* 16px - Legible */
    color: var(--color-muted-foreground);
    margin: 0;
}

/* Terms sections with glassmorphism */
.terms-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
}

.terms-section:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(126, 87, 194, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 87, 194, 0.1);
}

/* Section titles */
.terms-section-title {
    font-size: 1.5rem; /* 24px - Clear hierarchy */
    font-weight: 600;
    color: var(--color-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

/* Subsections within main sections */
.terms-subsection {
    background: rgba(126, 87, 194, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.terms-subsection-title {
    font-size: 1.25rem; /* 20px - Good hierarchy */
    font-weight: 600;
    color: var(--messy-lavender);
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Paragraph text with optimal readability */
.terms-paragraph {
    font-size: 1rem; /* 16px - Standard legible size */
    line-height: 1.6; /* Excellent readability */
    color: var(--color-foreground);
    margin-bottom: 1rem;
    font-weight: 400;
}

.terms-paragraph:last-child {
    margin-bottom: 0;
}

/* Lists with proper spacing */
.terms-list {
    font-size: 1rem; /* 16px - Matches paragraphs */
    line-height: 1.6;
    color: var(--color-foreground);
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.terms-list li {
    margin-bottom: 0.5rem;
}

.terms-list li:last-child {
    margin-bottom: 0;
}

/* Warning/alert sections */
.terms-warning {
    background: rgba(255, 193, 7, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.terms-warning .terms-paragraph {
    color: var(--color-foreground);
    font-weight: 500;
}

/* Footer section */
.terms-footer {
    border-top: 1px solid rgba(126, 87, 194, 0.2);
    padding-top: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.terms-footer-text {
    font-size: 0.9375rem; /* 15px - Slightly smaller for footer */
    color: var(--color-muted-foreground);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.terms-footer-text:last-child {
    margin-bottom: 0;
}

/* Mobile responsiveness for terms page */
@media (max-width: 768px) {
    .terms-content {
        padding: 1rem 0;
    }
    
    .terms-title {
        font-size: 1.875rem; /* 30px - Smaller but still prominent */
        margin-bottom: 2rem;
    }
    
    .terms-last-updated,
    .terms-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .terms-subsection {
        padding: 1.25rem;
        margin-top: 1.25rem;
    }
    
    .terms-section-title {
        font-size: 1.375rem; /* 22px */
        margin-bottom: 1.25rem;
    }
    
    .terms-subsection-title {
        font-size: 1.125rem; /* 18px */
        margin-bottom: 0.875rem;
    }
    
    .terms-paragraph,
    .terms-list {
        font-size: 1rem; /* Keep 16px to prevent zoom on iOS */
        line-height: 1.6;
    }
    
    .terms-list {
        padding-left: 1.25rem;
    }
    
    .terms-footer {
        padding-top: 1.5rem;
        margin-top: 2rem;
    }
    
    .terms-footer-text {
        font-size: 0.875rem; /* 14px - Slightly smaller for mobile */
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .terms-content {
        max-width: 800px;
        padding: 1.5rem 0;
    }
    
    .terms-title {
        font-size: 2rem; /* 32px */
        margin-bottom: 2.5rem;
    }
    
    .terms-section {
        padding: 1.75rem;
    }
    
    .terms-subsection {
        padding: 1.375rem;
    }
}

/* Desktop large screens */
@media (min-width: 1200px) {
    .terms-content {
        max-width: 1000px;
        padding: 2.5rem 0;
    }
    
    .terms-title {
        font-size: 2.5rem; /* 40px - Even more prominent on large screens */
        margin-bottom: 3.5rem;
    }
    
    .terms-section {
        padding: 2.5rem;
    }
    
    .terms-subsection {
        padding: 2rem;
    }
}

/* Focus states for accessibility */
.terms-section:focus-within {
    border-color: rgba(126, 87, 194, 0.3);
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2);
}

/* Print styles for terms page */
@media print {
    .terms-content {
        max-width: none;
        padding: 0;
    }
    
    .terms-section,
    .terms-subsection,
    .terms-last-updated {
        background: none !important;
        backdrop-filter: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        transform: none !important;
    }
    
    .terms-title,
    .terms-section-title,
    .terms-subsection-title,
    .terms-paragraph,
    .terms-list,
    .terms-footer-text {
        color: #000 !important;
    }
    
    .terms-last-updated h4 {
        color: #666 !important;
    }
    
    .terms-warning {
        background: #f8f9fa !important;
        border-color: #ffc107 !important;
    }
}

/* ===== TEST LAYOUT - CONVERSATION DETAIL ===== */
/* Modular CSS for conversation_detail_test.html only */
/* These rules are scoped to test pages and can be easily ported to production */

/* Test Layout: Chat messages positioning above input area */
[data-test-layout="conversation-detail"] #chat-messages {
    /* Remove the existing height calculations and use padding-bottom instead */
    height: calc(100vh - 100px) !important;
    padding-bottom: 140px !important; /* Space for input area */
    transition: padding-bottom 0.3s ease !important;
    
    /* Maintain existing gradient masks */
    mask: linear-gradient(
        to bottom,
        transparent 0px,
        black 80px,                    /* Fade-in from top navbar */
        black calc(100% - 140px),      /* End fade to input area */
        transparent 100%
    ) !important;
    
    -webkit-mask: linear-gradient(
        to bottom,
        transparent 0px,
        black 80px,
        black calc(100% - 140px),
        transparent 100%
    ) !important;
}

/* Test Layout: Extended bottom fade when suggestion pills are visible */
[data-test-layout="conversation-detail"] #chat-messages.suggestions-visible {
    padding-bottom: 220px !important; /* Extra space for suggestion pills */
    
    /* Extended gradient mask for suggestion pills */
    mask: linear-gradient(
        to bottom,
        transparent 0px,
        black 80px,                    /* Fade-in from top navbar */
        black calc(100% - 220px),      /* Extended fade area for suggestion pills */
        transparent 100%
    ) !important;
    
    -webkit-mask: linear-gradient(
        to bottom,
        transparent 0px,
        black 80px,
        black calc(100% - 220px),
        transparent 100%
    ) !important;
}

/* Test Layout: Mobile responsive adjustments */
@media (max-width: 768px) {
    [data-test-layout="conversation-detail"] #chat-messages {
        height: calc(100vh - 80px) !important; /* Mobile height adjustment */
        padding-bottom: 160px !important; /* Mobile input area space */
        
        /* Mobile gradient masks */
        mask: linear-gradient(
            to bottom,
            transparent 0px,
            black 60px,                    /* Mobile top fade */
            black calc(100% - 160px),      /* Mobile bottom fade */
            transparent 100%
        ) !important;
        
        -webkit-mask: linear-gradient(
            to bottom,
            transparent 0px,
            black 60px,
            black calc(100% - 160px),
            transparent 100%
        ) !important;
    }
    
    /* Mobile suggestions visible state */
    [data-test-layout="conversation-detail"] #chat-messages.suggestions-visible {
        padding-bottom: 240px !important; /* Mobile space with suggestions */
        
        mask: linear-gradient(
            to bottom,
            transparent 0px,
            black 60px,                    /* Mobile top fade */
            black calc(100% - 240px),      /* Extended mobile bottom fade for pills */
            transparent 100%
        ) !important;
        
        -webkit-mask: linear-gradient(
            to bottom,
            transparent 0px,
            black 60px,
            black calc(100% - 240px),
            transparent 100%
        ) !important;
    }
}

/* Test Layout: Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1200px) {
    [data-test-layout="conversation-detail"] #chat-messages {
        padding-bottom: 150px !important; /* Tablet input area space */
    }
    
    [data-test-layout="conversation-detail"] #chat-messages.suggestions-visible {
        padding-bottom: 210px !important; /* Tablet space with suggestions */
    }
}


