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

/* Modal Assistant Body - Parent container for voice circle */
.modal-assistant-body {
    position: relative; /* Voice circle için reference point */
    overflow: hidden; /* Circle modal dışına taşmasın */
}

/* Voice Circle Base Styles - HOLLOW RING with CANVAS ATMOSPHERE */
.voice-circle {
    width: 250px;
    height: 250px;
    /* FIXED position to modal-assistant-body center */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: visible;
    /* Arka planda kalması için düşük z-index */
    z-index: 1;
    pointer-events: none;
    background: transparent !important;
    border: none !important;
    outline: none !important;
}

#voiceCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    opacity: 1.0;
    background: transparent !important;
    border: none !important;
}

/* Dark mode - normal visibility */
body[data-theme="dark"] #voiceCanvas,
body.dark-mode #voiceCanvas {
    filter: blur(1px) saturate(1.8) brightness(1.3);
    mix-blend-mode: screen;
}

/* Light mode - darker brightness for better visibility on white background */
body[data-theme="light"] #voiceCanvas,
body:not(.dark-mode) #voiceCanvas {
    filter: blur(0.5px) saturate(2.2) brightness(0.7) contrast(1.3);
    mix-blend-mode: multiply;
}

/* Canvas will handle atmosphere */

/* ========== IDLE STATE - Calm Breathing ========== */
.voice-circle.idle {
    animation: voicePulseIdle 3s infinite ease-in-out;
}

.voice-circle.idle::before {
    animation: atmosphereIdleBefore 3s infinite ease-in-out;
}

.voice-circle.idle::after {
    animation: atmosphereIdleAfter 3s infinite ease-in-out 0.5s;
}

@keyframes voicePulseIdle {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.03);
        opacity: 0.5;
    }
}

@keyframes atmosphereIdleBefore {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.25);
        opacity: 0.9;
    }
}

@keyframes atmosphereIdleAfter {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
}

/* ========== LISTENING STATE - Active Glow ========== */
.voice-circle.listening {
    background-image: linear-gradient(var(--bg-primary, #fff), var(--bg-primary, #fff)), 
                      linear-gradient(135deg, #007aff 0%, #a855f7 100%);
    animation: voiceListening 1.2s infinite ease-in-out;
    opacity: 0.5;
}

.voice-circle.listening::before {
    background: radial-gradient(circle, rgba(0, 122, 255, 0.9) 0%, rgba(168, 85, 247, 0.6) 50%, transparent 70%);
    animation: atmosphereListeningBefore 1.2s infinite ease-in-out;
    filter: blur(25px);
}

.voice-circle.listening::after {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.8) 0%, rgba(0, 122, 255, 0.5) 50%, transparent 70%);
    animation: atmosphereListeningAfter 1.2s infinite ease-in-out 0.3s;
    filter: blur(45px);
}

@keyframes voiceListening {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 0.6;
    }
}

@keyframes atmosphereListeningBefore {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.4;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
        opacity: 0.6;
    }
}

@keyframes atmosphereListeningAfter {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3) rotate(-180deg);
        opacity: 0.5;
    }
}

/* ========== THINKING STATE - Intense Energy ========== */
.voice-circle.thinking {
    background-image: linear-gradient(var(--bg-primary, #fff), var(--bg-primary, #fff)), 
                      linear-gradient(135deg, #00d4ff 0%, #10b981 100%);
    animation: voiceThinking 0.6s infinite ease-in-out;
    opacity: 0.5;
}

.voice-circle.thinking::before {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.95) 0%, rgba(16, 185, 129, 0.7) 50%, transparent 70%);
    animation: atmosphereThinkingBefore 0.6s infinite ease-in-out;
    filter: blur(25px);
}

.voice-circle.thinking::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.85) 0%, rgba(0, 212, 255, 0.6) 50%, transparent 70%);
    animation: atmosphereThinkingAfter 0.6s infinite ease-in-out 0.2s;
    filter: blur(45px);
}

@keyframes voiceThinking {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.4;
    }
    25% { 
        transform: translate(-50%, -50%) scale(1.12);
        opacity: 0.7;
    }
    50% { 
        transform: translate(-50%, -50%) scale(0.98);
        opacity: 0.5;
    }
    75% { 
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 0.6;
    }
}

@keyframes atmosphereThinkingBefore {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.5;
    }
    25% {
        transform: translate(-50%, -50%) scale(1.3) rotate(90deg);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(180deg);
        opacity: 0.6;
    }
    75% {
        transform: translate(-50%, -50%) scale(1.25) rotate(270deg);
        opacity: 0.65;
    }
}

@keyframes atmosphereThinkingAfter {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.4;
    }
    25% {
        transform: translate(-50%, -50%) scale(1.4) rotate(-90deg);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(-180deg);
        opacity: 0.5;
    }
    75% {
        transform: translate(-50%, -50%) scale(1.35) rotate(-270deg);
        opacity: 0.55;
    }
}

/* ========== SPEAKING STATE - Maximum Energy ========== */
.voice-circle.speaking {
    background-image: linear-gradient(var(--bg-primary, #fff), var(--bg-primary, #fff)), 
                      linear-gradient(135deg, #007aff 0%, #a855f7 50%, #ff6b35 100%);
    animation: voiceSpeaking 0.8s infinite ease-in-out;
    opacity: 0.6;
}

.voice-circle.speaking::before {
    background: radial-gradient(circle, 
        rgba(0, 122, 255, 1) 0%, 
        rgba(168, 85, 247, 0.8) 35%, 
        rgba(255, 107, 53, 0.6) 60%, 
        transparent 75%);
    animation: atmosphereSpeakingBefore 0.8s infinite ease-in-out;
    filter: blur(25px);
}

.voice-circle.speaking::after {
    background: radial-gradient(circle, 
        rgba(255, 107, 53, 0.9) 0%, 
        rgba(168, 85, 247, 0.7) 35%, 
        rgba(0, 122, 255, 0.5) 60%, 
        transparent 75%);
    animation: atmosphereSpeakingAfter 0.8s infinite ease-in-out 0.25s;
    filter: blur(45px);
}

@keyframes voiceSpeaking {
    0% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    15% { 
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.7;
    }
    30% { 
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0.55;
    }
    45% { 
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 0.65;
    }
    60% { 
        transform: translate(-50%, -50%) scale(0.97);
        opacity: 0.6;
    }
    75% { 
        transform: translate(-50%, -50%) scale(1.12);
        opacity: 0.7;
    }
    90% { 
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.55;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
}

@keyframes atmosphereSpeakingBefore {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.6;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.4) rotate(72deg);
        opacity: 0.8;
    }
    40% {
        transform: translate(-50%, -50%) scale(1.15) rotate(144deg);
        opacity: 0.7;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.35) rotate(216deg);
        opacity: 0.75;
    }
    80% {
        transform: translate(-50%, -50%) scale(1.2) rotate(288deg);
        opacity: 0.7;
    }
}

@keyframes atmosphereSpeakingAfter {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.5;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.5) rotate(-72deg);
        opacity: 0.7;
    }
    40% {
        transform: translate(-50%, -50%) scale(1.25) rotate(-144deg);
        opacity: 0.6;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.45) rotate(-216deg);
        opacity: 0.65;
    }
    80% {
        transform: translate(-50%, -50%) scale(1.3) rotate(-288deg);
        opacity: 0.6;
    }
}

/* Mini Circle (when chat started) */
.voice-circle.mini {
    width: 40px;
    height: 40px;
    position: fixed;
    top: 80px;
    right: 30px;
    margin: 0;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
}

/* Voice/Send Button Container */
.modal-input-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-voice-btn {
    background: transparent;
    border: none;
    color: var(--text-color, #000);
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-voice-btn:hover {
    background: rgba(0, 122, 255, 0.1);
    transform: scale(1.1);
}

.modal-voice-btn.recording {
    color: #ff6b35;
    animation: voiceRecording 1s infinite ease-in-out;
}

@keyframes voiceRecording {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Dark mode adjustments */
body.dark-mode .modal-voice-btn {
    color: #fff;
}

/* ========== DARK MODE - Enhanced Atmosphere ========== */
body.dark-mode .voice-circle {
    background-image: linear-gradient(var(--bg-primary, #1a1a1a), var(--bg-primary, #1a1a1a)), 
                      linear-gradient(135deg, #007aff 0%, #00d4ff 50%, #ff6b35 100%);
}

body.dark-mode .voice-circle::before {
    background: radial-gradient(circle, rgba(0, 180, 255, 0.4) 0%, transparent 70%);
    filter: blur(20px);
}

body.dark-mode .voice-circle::after {
    background: radial-gradient(circle, rgba(0, 240, 255, 0.3) 0%, transparent 70%);
    filter: blur(30px);
}

body.dark-mode .voice-circle.listening {
    background-image: linear-gradient(var(--bg-primary, #1a1a1a), var(--bg-primary, #1a1a1a)), 
                      linear-gradient(135deg, #007aff 0%, #a855f7 100%);
}

body.dark-mode .voice-circle.listening::before {
    background: radial-gradient(circle, rgba(0, 180, 255, 0.6) 0%, rgba(200, 100, 255, 0.4) 50%, transparent 70%);
}

body.dark-mode .voice-circle.listening::after {
    background: radial-gradient(circle, rgba(200, 100, 255, 0.5) 0%, rgba(0, 180, 255, 0.3) 50%, transparent 70%);
}

body.dark-mode .voice-circle.thinking {
    background-image: linear-gradient(var(--bg-primary, #1a1a1a), var(--bg-primary, #1a1a1a)), 
                      linear-gradient(135deg, #00d4ff 0%, #10b981 100%);
}

body.dark-mode .voice-circle.thinking::before {
    background: radial-gradient(circle, rgba(0, 240, 255, 0.7) 0%, rgba(20, 220, 150, 0.5) 50%, transparent 70%);
}

body.dark-mode .voice-circle.thinking::after {
    background: radial-gradient(circle, rgba(20, 220, 150, 0.6) 0%, rgba(0, 240, 255, 0.4) 50%, transparent 70%);
}

body.dark-mode .voice-circle.speaking {
    background-image: linear-gradient(var(--bg-primary, #1a1a1a), var(--bg-primary, #1a1a1a)), 
                      linear-gradient(135deg, #007aff 0%, #a855f7 50%, #ff6b35 100%);
}

body.dark-mode .voice-circle.speaking::before {
    background: radial-gradient(circle, 
        rgba(0, 180, 255, 0.8) 0%, 
        rgba(200, 100, 255, 0.6) 35%, 
        rgba(255, 130, 70, 0.5) 60%, 
        transparent 75%);
}

body.dark-mode .voice-circle.speaking::after {
    background: radial-gradient(circle, 
        rgba(255, 130, 70, 0.7) 0%, 
        rgba(200, 100, 255, 0.5) 35%, 
        rgba(0, 180, 255, 0.4) 60%, 
        transparent 75%);
}

/* Chat Messages - Arka planda voice circle varken mesajların okunabilir olması için */
.modal-chat-messages {
    position: relative;
    z-index: 10;
}

/* Removed conflicting modal-message-item styles - using chat-message system from style.css instead */

/* Empty state container - voice circle'ın arkada kalması için */
.modal-chat-empty-state {
    position: relative;
    z-index: 5;
}

/* Empty state logo ve text voice circle'ın üstünde olmalı */
.modal-empty-logo,
.modal-empty-text {
    position: relative;
    z-index: 10;
}

/* Text bubble'ın altında görünsün */
.modal-empty-text {
    margin-top: 180px;
}

/* ============================================
   CHAT ICON ANIMATION (Pulse Glow + Color Shift)
   ============================================ */

/* Chat assistant toggle button - sadece icon'a animasyon */
.assistant-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icon itself - animasyon sadece buraya */
.assistant-toggle-btn i {
    animation: assistantIconPulse 4s ease-in-out infinite,
               assistantIconColorShift 6s ease-in-out infinite;
    display: inline-block;
}

/* ============================================
   SIDEBAR AIRA ASSISTANT
   ============================================ */

/* Sidebar'daki Aira icon'a da aynı animasyon */
.sidebar-aira-icon {
    animation: assistantIconPulse 4s ease-in-out infinite,
               assistantIconColorShift 6s ease-in-out infinite !important;
    display: inline-block;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
    padding: 0 !important;
}

/* Dark mode için */
body[data-theme="dark"] .sidebar-aira-icon {
    animation: assistantIconPulseDark 4s ease-in-out infinite,
               assistantIconColorShiftDark 6s ease-in-out infinite !important;
}

/* Hover'da da animasyonlar devam etsin - durmayacak */
.nav-links a:hover .sidebar-aira-icon,
#sidebarAssistantToggle:hover .sidebar-aira-icon {
    animation: assistantIconPulse 4s ease-in-out infinite,
               assistantIconColorShift 6s ease-in-out infinite !important;
    filter: inherit !important;
}

body[data-theme="dark"] .nav-links a:hover .sidebar-aira-icon,
body[data-theme="dark"] #sidebarAssistantToggle:hover .sidebar-aira-icon {
    animation: assistantIconPulseDark 4s ease-in-out infinite,
               assistantIconColorShiftDark 6s ease-in-out infinite !important;
    filter: inherit !important;
}

/* Sidebar Aira link - focus/outline kaldır */
#sidebarAssistantToggle {
    outline: none !important;
}

#sidebarAssistantToggle:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Pulse glow effect - sadece icon etrafında */
@keyframes assistantIconPulse {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(0, 122, 255, 0.4))
                drop-shadow(0 0 6px rgba(0, 122, 255, 0.3))
                drop-shadow(0 0 9px rgba(0, 122, 255, 0.2));
    }
    25% {
        filter: drop-shadow(0 0 5px rgba(0, 224, 255, 0.5))
                drop-shadow(0 0 10px rgba(0, 224, 255, 0.4))
                drop-shadow(0 0 15px rgba(0, 224, 255, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(255, 159, 64, 0.5))
                drop-shadow(0 0 12px rgba(255, 159, 64, 0.4))
                drop-shadow(0 0 18px rgba(255, 159, 64, 0.3));
    }
    75% {
        filter: drop-shadow(0 0 5px rgba(0, 224, 255, 0.5))
                drop-shadow(0 0 10px rgba(0, 224, 255, 0.4))
                drop-shadow(0 0 15px rgba(0, 224, 255, 0.3));
    }
}

/* Color shift effect - icon rengi */
@keyframes assistantIconColorShift {
    0%, 100% {
        color: #007aff; /* Mavi */
    }
    33% {
        color: #00e0ff; /* Turkuaz */
    }
    66% {
        color: #ff9f40; /* Turuncu */
    }
}

/* Dark mode için daha parlak glow */
body[data-theme="dark"] .assistant-toggle-btn i {
    animation: assistantIconPulseDark 4s ease-in-out infinite,
               assistantIconColorShiftDark 6s ease-in-out infinite;
}

@keyframes assistantIconPulseDark {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(0, 122, 255, 0.6))
                drop-shadow(0 0 8px rgba(0, 122, 255, 0.4))
                drop-shadow(0 0 12px rgba(0, 122, 255, 0.3));
    }
    25% {
        filter: drop-shadow(0 0 6px rgba(0, 224, 255, 0.7))
                drop-shadow(0 0 12px rgba(0, 224, 255, 0.5))
                drop-shadow(0 0 18px rgba(0, 224, 255, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 159, 64, 0.7))
                drop-shadow(0 0 16px rgba(255, 159, 64, 0.5))
                drop-shadow(0 0 24px rgba(255, 159, 64, 0.4));
    }
    75% {
        filter: drop-shadow(0 0 6px rgba(0, 224, 255, 0.7))
                drop-shadow(0 0 12px rgba(0, 224, 255, 0.5))
                drop-shadow(0 0 18px rgba(0, 224, 255, 0.4));
    }
}

@keyframes assistantIconColorShiftDark {
    0%, 100% {
        color: #4da6ff; /* Daha açık mavi */
    }
    33% {
        color: #66f0ff; /* Daha açık turkuaz */
    }
    66% {
        color: #ffb366; /* Daha açık turuncu */
    }
}

/* Hover durumunda animasyon hızlansın */
.assistant-toggle-btn:hover i {
    animation: assistantIconPulse 2s ease-in-out infinite,
               assistantIconColorShift 3s ease-in-out infinite;
}

body[data-theme="dark"] .assistant-toggle-btn:hover i {
    animation: assistantIconPulseDark 2s ease-in-out infinite,
               assistantIconColorShiftDark 3s ease-in-out infinite;
}

/* ============================================
   MODAL SIDEBAR STYLES
   ============================================ */

/* Modal Assistant Body - Parent container for voice circle */
.modal-assistant-body {
    position: relative; /* Voice circle için reference point */
    overflow: hidden; /* Circle modal dışına taşmasın */
}

/* Modal Header Actions */
.modal-assistant-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Modal Sidebar Toggle Button - Floating like base.html sidebar */
.modal-sidebar-toggle-btn {
    position: absolute;
    top: 50px; /* Below smaller header */
    left: 10px;
    z-index: 25;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    color: var(--text-primary, #000);
    font-size: 1.1rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-sidebar-toggle-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Modal Sidebar - Inside modal container */
.modal-assistant-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background-color: var(--bg-secondary, #f8f9fa);
    border-right: 1px solid var(--border-color, #dee2e6);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 20;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    /* Default: hidden like base.html sidebar */
    transform: translateX(-100%);
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}

.modal-assistant-sidebar::-webkit-scrollbar {
    width: 3px;
}

.modal-assistant-sidebar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.modal-assistant-sidebar::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.modal-assistant-sidebar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Dark mode sidebar scroll */
body.dark-mode .modal-assistant-sidebar,
body[data-theme="dark"] .modal-assistant-sidebar {
    scrollbar-color: #495057 transparent;
}

body.dark-mode .modal-assistant-sidebar::-webkit-scrollbar-thumb,
body[data-theme="dark"] .modal-assistant-sidebar::-webkit-scrollbar-thumb {
    background: #495057;
}

body.dark-mode .modal-assistant-sidebar::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .modal-assistant-sidebar::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Modal Sidebar Visible State - Show like base.html */
.modal-assistant-sidebar.show {
    transform: translateX(0);
}

/* Hide toggle button when sidebar is visible - handled by JavaScript */

/* Header removed - direct navigation */


/* Modal Nav Links */
.modal-nav-links {
    list-style: none;
    padding: 20px 16px 16px 16px; /* Extra top padding since no header */
    margin: 0;
    flex: 1;
}

.modal-nav-links li {
    margin-bottom: 4px;
}

/* Add divider after search item */
.modal-nav-links li.with-divider {
    border-bottom: 1px solid var(--border-color, #dee2e6);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.modal-nav-item {
    display: flex;
    align-items: center;
    color: var(--text-primary, #000);
    text-decoration: none;
    padding: 0.4rem 0rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 1rem;
    gap: 12px;
    position: relative;
    height: 39.2px; /* Match base sidebar item height exactly */
    box-sizing: border-box;
}

/* First item with close button - special layout */
.modal-nav-item.with-close-btn {
    justify-content: space-between;
}

.modal-nav-item .nav-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Modal Sidebar Close Button - Only in first item */
.modal-sidebar-close-btn {
    background: transparent;
    border: none;
    color: var(--text-primary, #000);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-sidebar-close-btn:hover {
    background-color: var(--hover-bg);
    transform: scale(1.1);
}

.modal-nav-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary, #000);
    text-decoration: none;
}

.modal-nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.modal-link-text {
    transition: opacity 0.3s ease;
}

/* Modal Nav Divider */
.modal-nav-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color, #dee2e6);
    margin: 16px 0;
}



/* Dark Mode Support for Modal Sidebar */
body.dark-mode .modal-assistant-sidebar,
body[data-theme="dark"] .modal-assistant-sidebar {
    background-color: var(--bg-secondary, #2d2d2d);
    border-right-color: var(--border-color, #444);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .modal-sidebar-toggle-btn,
body[data-theme="dark"] .modal-sidebar-toggle-btn {
    background: var(--bg-primary, #1a1a1a);
    border-color: var(--border-color, #444);
    color: var(--text-primary, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .modal-nav-item,
body[data-theme="dark"] .modal-nav-item {
    color: var(--text-primary, #fff);
}

body.dark-mode .modal-nav-item:hover,
body[data-theme="dark"] .modal-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}


body.dark-mode .modal-nav-divider,
body[data-theme="dark"] .modal-nav-divider {
    background-color: var(--border-color, #444);
}

body.dark-mode .modal-sidebar-close-btn,
body[data-theme="dark"] .modal-sidebar-close-btn {
    color: var(--text-primary, #fff);
}

body.dark-mode .modal-sidebar-close-btn:hover,
body[data-theme="dark"] .modal-sidebar-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode divider */
        body.dark-mode .modal-nav-links li.with-divider,
        body[data-theme="dark"] .modal-nav-links li.with-divider {
            border-bottom-color: var(--border-color, #444);
        }
        
        /* Modal Chat Search Styles - Based on User Management */
        .modal-chat-search {
            padding: 0;
        }
        
        .modal-chat-search .input-group {
            width: 248px;
            position: relative;
        }
        
        .modal-search-input {
            border: 1px solid var(--border-color, #dee2e6) !important;
            background-color: var(--bg-primary, #ffffff) !important;
            color: var(--text-primary, #000000) !important;
            border-radius: 0 4px 4px 0 !important;
            padding: 0.2rem 0.75rem !important;
            font-size: 0.9rem !important;
            height: 32px !important;
            min-height: 32px !important;
            max-height: 32px !important;
            line-height: 1.2 !important;
            box-sizing: border-box !important;
            padding-right: 35px !important; /* Space for clear button */
        }
        
        .modal-chat-search .input-group-text {
            background-color: var(--bg-secondary, #f8f9fa) !important;
            border-color: var(--border-color, #dee2e6) !important;
            color: #000000 !important;
            border-radius: 4px 0 0 4px !important;
            padding: 0.375rem 0.5rem !important;
            height: 32px !important;
            min-height: 32px !important;
            max-height: 32px !important;
            font-size: 0.9rem !important;
            box-sizing: border-box !important;
            line-height: 1.2 !important;
        }
        
        .modal-search-input:focus {
            border-color: var(--primary, #f8f9fa) !important;
            box-shadow: none !important;
            outline: 0 !important;
        }
        
        /* Dark mode modal search */
        body.dark-mode .modal-search-input,
        body[data-theme="dark"] .modal-search-input {
            background-color: var(--bg-tertiary, #2d2d2d) !important;
            color: var(--text-primary, #ffffff) !important;
            border-color: var(--border-color, #444) !important;
        }
        
        body.dark-mode .modal-chat-search .input-group-text,
        body[data-theme="dark"] .modal-chat-search .input-group-text {
            background-color: #0d0d0d !important;
            border-color: var(--border-color, #444) !important;
            color: #ffffff !important;
        }
        
        body.dark-mode .modal-search-input:focus,
        body[data-theme="dark"] .modal-search-input:focus {
            background-color: var(--bg-tertiary, #2d2d2d) !important;
            border-color: var(--primary, #f8f9fa) !important;
            color: var(--text-primary, #ffffff) !important;
            box-shadow: none !important;
        }
        
        /* Modal Search Clear Button */
        .modal-search-clear-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            background: transparent;
            border: none;
            color: var(--text-secondary, #6c757d);
            cursor: pointer;
            font-size: 14px;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s ease;
            z-index: 10;
        }
        
        .modal-search-clear-btn:hover {
            background: var(--hover-bg, rgba(0, 0, 0, 0.1));
            color: var(--text-primary, #000);
        }
        
        /* Dark mode clear button */
        body.dark-mode .modal-search-clear-btn,
        body[data-theme="dark"] .modal-search-clear-btn {
            color: var(--text-secondary, #adb5bd);
        }
        
        body.dark-mode .modal-search-clear-btn:hover,
        body[data-theme="dark"] .modal-search-clear-btn:hover {
            background: var(--hover-bg, rgba(255, 255, 255, 0.1));
            color: var(--text-primary, #ffffff);
        }
        
        /* Adjust input padding to make room for clear button */
        .modal-search-input {
            padding-right: 35px !important;
        }
        
        /* Placeholder styles */
        .modal-search-input::placeholder {
            color: #6c757d !important;
            opacity: 1 !important;
        }
        
        body.dark-mode .modal-search-input::placeholder,
        body[data-theme="dark"] .modal-search-input::placeholder {
            color: #adb5bd !important;
            opacity: 1 !important;
        }
        
        /* Modal Chat List Styles */
        .modal-chat-list-container {
            flex: 1;
            padding: 0;
        }
        
        .modal-chat-list-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 12px 8px 12px;
            font-weight: 600;
            font-size: 1rem;
            color: var(--text-primary, #000);
        }
        
        .modal-chat-list-header i {
            font-size: 1.1rem;
            width: 20px;
            text-align: center;
        }
        
        /* Dark mode header */
        body.dark-mode .modal-chat-list-header,
        body[data-theme="dark"] .modal-chat-list-header {
            color: var(--text-primary, #ffffff);
        }
        
        .modal-chat-list {
            display: flex;
            flex-direction: column;
        }
        
        .modal-chat-item {
            padding: 6px 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            border-radius: 4px;
            margin-bottom: 2px;
            margin-left: 0px; /* Align with Chats icon */
            position: relative;
        }

        .modal-chat-item:hover {
            background-color: var(--hover-bg);
        }

        .modal-chat-delete-btn {
            opacity: 0;
            visibility: hidden;
            background: rgba(220, 53, 69, 0.1);
            border: none;
            border-radius: 4px;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #dc3545;
            cursor: pointer;
            transition: all 0.2s ease;
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
        }

        .modal-chat-item:hover .modal-chat-delete-btn {
            opacity: 1;
            visibility: visible;
        }

        .modal-chat-delete-btn:hover {
            background: rgba(220, 53, 69, 0.2);
            color: #b02a37;
        }
        
        .modal-chat-item-title {
            font-size: 0.9rem;
            color: var(--text-primary, #000);
            line-height: 1.4;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            cursor: pointer;
            padding-right: 30px; /* Space for delete button */
        }
        
        /* Dark mode chat list */
        body.dark-mode .modal-chat-item:hover,
        body[data-theme="dark"] .modal-chat-item:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        /* Dark mode delete button */
        body.dark-mode .modal-chat-delete-btn,
        body[data-theme="dark"] .modal-chat-delete-btn {
            background: rgba(220, 53, 69, 0.15);
            color: #ff6b6b;
        }

        body.dark-mode .modal-chat-delete-btn:hover,
        body[data-theme="dark"] .modal-chat-delete-btn:hover {
            background: rgba(220, 53, 69, 0.25);
            color: #ff5252;
        }
        
        body.dark-mode .modal-chat-item-title,
        body[data-theme="dark"] .modal-chat-item-title {
            color: var(--text-primary, #ffffff);
        }
        
        /* Empty state for chat list */
        .modal-chat-empty {
            text-align: center;
            padding: 24px 16px;
            color: var(--text-secondary, #6c757d);
            font-size: 0.9rem;
        }
        
        body.dark-mode .modal-chat-empty,
        body[data-theme="dark"] .modal-chat-empty {
            color: var(--text-secondary, #adb5bd);
        }



/* Responsive Design for Modal Sidebar */
@media (max-width: 768px) {
    .modal-assistant-sidebar {
        width: 240px;
    }
    
    .modal-nav-links {
        padding: 16px 8px 12px 8px;
    }
    
    .modal-nav-links li {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .modal-nav-item {
        padding: 0.5rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .modal-nav-item i {
        font-size: 1rem;
        width: 18px;
    }
    
    /* Mobile search filter - complete restructure */
    .modal-chat-search {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        display: block !important;
    }
    
    .modal-chat-search .input-group {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
    }
    
    .modal-search-input {
        flex: 1 !important;
        min-width: 0 !important;
        width: auto !important;
    }
    
    .modal-chat-search .input-group-text {
        flex-shrink: 0 !important;
        width: auto !important;
    }
    
    /* Mobile search input height fix */
    .modal-search-input {
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        line-height: 1.2 !important;
        box-sizing: border-box !important;
    }
    
    .modal-chat-search .input-group-text {
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        box-sizing: border-box !important;
        line-height: 1.2 !important;
    }
    
    /* Removed conflicting modal-message-item mobile styles - using chat-message system from style.css instead */
}

/* Removed conflicting CSS rule that was hiding toggle button */

