/* AI Chat Interface Styles - PulseCore Theme */

/* Welcome Message Styles (Mobile-Compatible) */
.welcome-message {
    margin-bottom: 20px;
}

.welcome-content {
    background: rgba(15, 15, 35, 0.8);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.zin-intro h2 {
    color: #a855f7;
    margin-bottom: 12px;
    font-size: 20px;
}

.zin-intro p {
    color: #e2e8f0;
    line-height: 1.5;
    margin-bottom: 20px;
}

.quick-actions h3 {
    color: #e2e8f0;
    margin-bottom: 12px;
    font-size: 16px;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-btn {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
    padding: 12px 8px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.quick-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    transform: translateY(-1px);
}

.team-section {
    background: rgba(168, 85, 247, 0.1);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.team-section h3 {
    color: #a855f7;
    margin-bottom: 8px;
    font-size: 16px;
}

.team-section p {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 12px;
}

.team-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.team-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 15, 35, 0.6);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.team-icon {
    font-size: 14px;
}

.team-name {
    color: #cbd5e1;
    font-size: 11px;
}

/* Enhanced Main Layout Background for Journal Mode */
body.journal-mode {
    background: #0a0e1a;
    overflow-x: hidden;
}

body.journal-mode {
    overflow-y: auto !important;
    height: auto !important;
}

body.journal-mode .app-layout {
    min-height: 100vh;
    height: auto;
    background: 
        radial-gradient(circle at 25% 25%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #0a0e1a 0%, #1a1b2e 25%, #16213e 50%, #0f3460 75%, #0a0e1a 100%);
    position: relative;
}

body.journal-mode .chat-main {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1.5rem;
    backdrop-filter: blur(25px);
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    margin: 2rem;
    padding: 2rem;
}

body.journal-mode .chat-container,
body.journal-mode .input-section {
    display: none;
}

/* Journal Mode Toggle Button */
.btn-journal-mode {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: 1px solid #8b5cf6;
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
}

.btn-journal-mode:hover {
    background: linear-gradient(135deg, #8b5cf6, #c084fc);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.3);
}

.mode-indicator.journal {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
}

/* Floating Chat Indicator */
.floating-chat-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.floating-chat-indicator.hidden {
    display: none;
}

.chat-indicator-btn {
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 2px solid #3b82f6;
    border-radius: 16px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.chat-indicator-btn:hover {
    background: linear-gradient(135deg, #334155, #475569);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.chat-glow-icon {
    font-size: 1.2em;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 5px #3b82f6); }
    to { filter: drop-shadow(0 0 15px #60a5fa); }
}

.indicator-text {
    color: #e2e8f0;
    font-size: 0.9em;
    font-weight: 500;
}

.notification-pulse {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.notification-pulse.hidden {
    display: none;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(0.8); opacity: 1; }
}

/* Floating Chat Panel */
.floating-chat-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 320px;
    height: 400px;
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 999;
}

.floating-chat-panel.hidden {
    display: none;
}

.floating-chat-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    flex-direction: column;
}

.chat-title span:first-child {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.95em;
}

.chat-mode {
    color: #bfdbfe;
    font-size: 0.8em;
}

.close-floating-chat {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.floating-chat-container {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.5);
}

.floating-chat-input {
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 0 0 10px 10px;
    display: flex;
    gap: 8px;
}

.floating-chat-input input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 10px;
    color: #e2e8f0;
    font-size: 0.9em;
}

.btn-floating-voice, .btn-floating-send {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    border: none;
    color: #e2e8f0;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Journal Section - Completely Redesigned */
.journal-section {
    padding: 0;
    background: transparent;
    margin: 0;
}

.journal-section.hidden {
    display: none;
}

/* Simple Header */
.journal-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
}

.journal-title-simple {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 20%, #ec4899 40%, #06b6d4 60%, #10b981 80%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
    letter-spacing: -0.02em;
}


/* Zin's Response Area */
.zin-responses-area {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
    border-radius: 1.5rem;
    margin-bottom: 32px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(25px);
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.zin-header-compact {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(168, 85, 247, 0.9));
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.zin-header-compact::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.zin-avatar-small {
    font-size: 1.2em;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
    animation: glowSmall 3s ease-in-out infinite alternate;
}

@keyframes glowSmall {
    from { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4)); }
    to { filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.6)); }
}

.zin-name-small {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.zin-subtitle-small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-style: italic;
    margin-left: auto;
    font-weight: 400;
}

.zin-responses {
    max-height: 200px;
    overflow-y: auto;
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.3);
}

.zin-welcome-message {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    padding: 20px;
    border: 2px dashed #475569;
    border-radius: 8px;
}

.zin-actions-row-compact {
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.3);
    border-bottom: 1px solid #475569;
}

.zin-quick-actions-small {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-zin-small {
    padding: 6px 12px;
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(124, 58, 237, 0.08);
    color: rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(10px);
}

.btn-zin-small .btn-icon-small {
    font-size: 0.9em;
}

.btn-zin-small.analyze {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.2);
    color: rgba(226, 232, 240, 0.9);
}

.btn-zin-small.improve {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.2);
    color: rgba(226, 232, 240, 0.9);
}

.btn-zin-small.continue {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
    color: rgba(226, 232, 240, 0.9);
}

.btn-zin-small:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
    color: rgba(226, 232, 240, 1);
}

.zin-input-area-small {
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.5);
    display: flex;
    gap: 8px;
}

.zin-input-small {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.zin-input-small:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.btn-zin-send-small {
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: rgba(226, 232, 240, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    backdrop-filter: blur(10px);
}

.btn-zin-send-small:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
    color: rgba(226, 232, 240, 1);
}

/* Bottom Controls Section */
.journal-bottom-controls {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.7));
    border-radius: 1rem;
    margin-top: 24px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    gap: 24px;
}

/* Voice Controls Compact */
.voice-controls-compact {
    display: flex;
    align-items: center;
    gap: 20px;
}

.voice-status-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-text-small {
    color: #06b6d4;
    font-size: 0.9em;
    font-weight: 500;
    font-style: italic;
}

.timer-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-label-small {
    color: #94a3b8;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.journal-timer-small {
    color: #10b981;
    font-size: 1.2em;
    font-family: 'Monaco', 'Cascadia Code', monospace;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 0.3rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.voice-buttons-small {
    display: flex;
    gap: 8px;
}

.btn-voice-small {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-voice-small .btn-icon-small {
    font-size: 1em;
}

.btn-voice-small.record {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-voice-small.record:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-voice-small.record:not(:disabled) {
    animation: recordPulseSmall 2s ease-in-out infinite;
}

@keyframes recordPulseSmall {
    0%, 100% { box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 2px 12px rgba(239, 68, 68, 0.5), 0 0 0 2px rgba(239, 68, 68, 0.1); }
}

.btn-voice-small.stop {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.btn-voice-small.pause {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-voice-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    animation: none !important;
}

/* Save Actions Compact */
.save-actions-compact {
    display: flex;
    gap: 8px;
}

.btn-action-small {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-action-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.4s;
}

.btn-action-small:hover::before {
    transform: translateX(100%);
}

.btn-action-small .btn-icon-small {
    font-size: 1em;
    filter: drop-shadow(0 0 4px currentColor);
}

.btn-action-small.save {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.8), rgba(34, 197, 94, 0.7));
    color: #fff;
    box-shadow: 
        0 4px 16px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-action-small.save:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(34, 197, 94, 0.8));
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-action-small.export {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.8), rgba(14, 165, 233, 0.7));
    color: #fff;
    box-shadow: 
        0 4px 16px rgba(6, 182, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-action-small.export:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(14, 165, 233, 0.8));
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(6, 182, 212, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-action-small.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.7));
    color: #fff;
    box-shadow: 
        0 4px 16px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-action-small.danger:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.8));
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Journal Editor Container */
.journal-editor-container {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(25px);
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    margin-bottom: 32px;
    overflow: hidden;
    position: relative;
}

.editor-header-compact {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    position: relative;
}

.editor-header-compact::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, #a855f7, #ec4899, #06b6d4);
}

.editor-title-small {
    color: #a855f7;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editor-stats-small {
    display: flex;
    gap: 16px;
    color: #06b6d4;
    font-size: 0.8em;
    font-weight: 500;
}

.journal-textarea {
    width: 100%;
    min-height: 125px;
    max-height: none;
    padding: 32px;
    background: rgba(10, 14, 26, 0.7);
    border: none;
    color: #e2e8f0;
    font-size: 1.2em;
    line-height: 1.8;
    resize: vertical;
    font-family: 'Georgia', 'Times New Roman', serif;
    transition: all 0.4s ease;
    position: relative;
}

.journal-textarea:focus {
    outline: none;
    background: rgba(10, 14, 26, 0.9);
    box-shadow: 
        inset 0 0 0 2px rgba(124, 58, 237, 0.4),
        0 0 30px rgba(124, 58, 237, 0.15);
}

.journal-textarea::placeholder {
    color: #64748b;
    font-style: italic;
    line-height: 1.6;
    opacity: 0.8;
}


/* Response Messages in Zin Area */
.zin-user-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.15);
    border-left: 4px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    color: #e2e8f0;
}

.zin-ai-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: rgba(124, 58, 237, 0.15);
    border-left: 4px solid #7c3aed;
    border-radius: 0 8px 8px 0;
    color: #e2e8f0;
}

.zin-error-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.15);
    border-left: 4px solid #ef4444;
    border-radius: 0 8px 8px 0;
    color: #fca5a5;
}

/* Floating Chat Messages */
.floating-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 90%;
}

.floating-message.user-message {
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid #3b82f6;
    margin-left: auto;
    margin-right: 0;
}

.floating-message.ai-message {
    background: rgba(124, 58, 237, 0.15);
    border-left: 3px solid #7c3aed;
    margin-left: 0;
    margin-right: auto;
}

.floating-message-content {
    color: #e2e8f0;
    font-size: 0.85em;
    line-height: 1.4;
}

.floating-message-time {
    color: #64748b;
    font-size: 0.7em;
    margin-top: 4px;
    text-align: right;
}

/* Hide scrollbars in floating chat but keep functionality */
.floating-chat-container::-webkit-scrollbar {
    width: 3px;
}

.floating-chat-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}

.floating-chat-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 2px;
}

.floating-chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Advanced Voice Settings Modal */
.voice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.voice-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a1f35 0%, #2d1b69 100%);
    border-radius: 12px;
    border: 2px solid #4c1d95;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(90deg, #4c1d95, #7c3aed);
    border-bottom: 1px solid #553c9a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #e2e8f0;
    font-size: 1.5em;
    margin: 0;
}

.modal-close {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fecaca;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.settings-tabs {
    display: flex;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    overflow-x: auto;
}

.tab-button {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.9em;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 140px;
}

.tab-button:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #c4b5fd;
}

.tab-button.active {
    background: rgba(124, 58, 237, 0.2);
    color: #e2e8f0;
    border-bottom-color: #7c3aed;
}

.tab-content {
    display: none;
    padding: 30px;
    min-height: 400px;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    color: #e2e8f0;
    margin-bottom: 25px;
    font-size: 1.3em;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    color: #cbd5e1;
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-select, .setting-input {
    width: 100%;
    padding: 10px;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
}

.setting-select:focus, .setting-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

input[type="range"] {
    width: calc(100% - 60px);
    margin-right: 10px;
    vertical-align: middle;
}

.setting-group span {
    display: inline-block;
    color: #94a3b8;
    font-weight: 500;
    min-width: 50px;
    vertical-align: middle;
}

.setting-help {
    font-size: 0.85em;
    color: #64748b;
    margin-top: 5px;
    font-style: italic;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.rate-presets, .pitch-presets {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-btn {
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid #7c3aed;
    color: #c4b5fd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: rgba(124, 58, 237, 0.4);
    color: #e2e8f0;
}

.btn-small {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #86efac;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: rgba(34, 197, 94, 0.4);
    color: #fff;
}

.command-list {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 15px;
}

.command-item {
    padding: 8px 0;
    border-bottom: 1px solid #334155;
    font-size: 0.9em;
}

.command-item:last-child {
    border-bottom: none;
}

.command-item strong {
    color: #c4b5fd;
}

.diagnostic-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    border: 1px solid #334155;
}

.diagnostic-section h4 {
    color: #e2e8f0;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.status-grid, .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.status-item, .metric-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
    border: 1px solid #475569;
}

.status-label, .metric-label {
    color: #cbd5e1;
    font-weight: 500;
}

.status-value, .metric-value {
    color: #94a3b8;
    font-weight: 600;
}

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

.test-btn {
    background: linear-gradient(135deg, #7c3aed, #3730a3);
    border: 1px solid #7c3aed;
    color: #e2e8f0;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    font-weight: 500;
}

.test-btn:hover {
    background: linear-gradient(135deg, #8b5cf6, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.audio-level-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.audio-meter {
    flex: 1;
    height: 20px;
    background: #1e293b;
    border-radius: 10px;
    border: 1px solid #475569;
    overflow: hidden;
}

.level-bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 10px;
}

.debug-console {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 15px;
    height: 200px;
    overflow-y: auto;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8em;
    color: #94a3b8;
    white-space: pre-wrap;
}

/* ================ MINIMAL/TRANSLUCENT STYLES ================ */

/* Session Actions in Header */
.session-actions-top {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-session-minimal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    backdrop-filter: blur(10px);
}

.btn-session-minimal:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-session-minimal.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-icon-minimal {
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.btn-session-minimal:hover .btn-icon-minimal {
    opacity: 1;
}

/* Voice Controls Minimal */
.voice-controls-minimal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.voice-status-minimal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.status-text-minimal {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.6);
    font-weight: 400;
}

.timer-minimal {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-label-minimal {
    font-size: 0.75rem;
    color: rgba(100, 116, 139, 0.5);
    font-weight: 500;
}

.journal-timer-minimal {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: rgba(124, 58, 237, 0.6);
    font-weight: 600;
    background: rgba(124, 58, 237, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(124, 58, 237, 0.1);
}

.voice-buttons-minimal {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-voice-minimal {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    backdrop-filter: blur(10px);
}

.btn-voice-minimal:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-voice-minimal.record:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-voice-minimal.record:not(:disabled) {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.15);
}

.btn-voice-minimal.stop {
    background: rgba(234, 179, 8, 0.05);
    border-color: rgba(234, 179, 8, 0.15);
}

.btn-voice-minimal.pause {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.15);
}

.btn-voice-minimal:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

/* About Section */
.about-section {
    margin-top: 24px;
    width: 100%;
}


.info-box {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(168, 85, 247, 0.08));
    border: 2px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    margin-top: 12px;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.15);
    backdrop-filter: blur(15px);
}

.about-link {
    display: inline-block;
    margin-top: 1rem;
    color: rgba(168, 85, 247, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
}

.about-link:hover {
    color: #a855f7;
    border-bottom-color: #a855f7;
    transform: translateX(3px);
}

/* Header Controls Layout */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.voice-controls-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.7);
}

.status-text-header {
    font-weight: 400;
}

.journal-timer-header {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: rgba(124, 58, 237, 0.7);
    font-weight: 600;
    background: rgba(124, 58, 237, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.voice-buttons-header {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-voice-header {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    backdrop-filter: blur(10px);
}

.btn-voice-header:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-voice-header.record:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-voice-header.record:not(:disabled) {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

.btn-voice-header.stop {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.15);
}

.btn-voice-header.pause {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.15);
}

.btn-voice-header:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.modal-footer {
    padding: 20px 30px;
    background: #1e293b;
    border-top: 1px solid #334155;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed, #3730a3);
    border: 1px solid #7c3aed;
    color: #e2e8f0;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #8b5cf6, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
    background: rgba(71, 85, 105, 0.2);
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(71, 85, 105, 0.4);
    color: #e2e8f0;
}

/* Enhanced Voice Selector Styles */
.voice-selector-group {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.voice-controls {
    margin-bottom: 20px;
}

.voice-search {
    width: 100%;
    padding: 12px 16px;
    background: #1e293b;
    border: 2px solid #475569;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
}

.voice-search:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.voice-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
}

.voices-grid {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    margin-bottom: 15px;
}

.loading-voices {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-style: italic;
}

.voice-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.voice-card:hover {
    background: rgba(124, 58, 237, 0.1);
}

.voice-card.selected {
    background: rgba(124, 58, 237, 0.2);
    border-left: 4px solid #7c3aed;
}

.voice-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.voice-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 14px;
}

.voice-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.voice-language {
    display: flex;
    align-items: center;
    gap: 4px;
}

.voice-gender {
    display: flex;
    align-items: center;
    gap: 4px;
}

.voice-quality {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quality-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.quality-premium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.quality-neural {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
}

.quality-standard {
    background: rgba(71, 85, 105, 0.6);
    color: #cbd5e1;
}

.voice-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.voice-play-btn {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #86efac;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.voice-play-btn:hover {
    background: rgba(34, 197, 94, 0.4);
    color: #fff;
}

.voice-play-btn.playing {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fecaca;
}

.voice-favorite-btn {
    background: transparent;
    border: 1px solid #475569;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.voice-favorite-btn:hover {
    color: #fbbf24;
    border-color: #fbbf24;
}

.voice-favorite-btn.favorited {
    color: #fbbf24;
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.selected-voice-display {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(79, 70, 229, 0.1));
    border: 1px solid #7c3aed;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.no-voice-selected {
    text-align: center;
    color: #64748b;
    font-style: italic;
}

.selected-voice-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.selected-voice-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.selected-voice-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 16px;
}

.selected-voice-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #94a3b8;
}

.voice-testing-panel {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.test-text {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 15px;
}

.test-text:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.test-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.btn-test {
    background: linear-gradient(135deg, #059669, #047857);
    border: 1px solid #059669;
    color: #e2e8f0;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-test:hover {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-test:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.voice-comparison-panel {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.voice-comparison-panel.hidden {
    display: none;
}

.comparison-voices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.comparison-voice-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.comparison-voice-name {
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.comparison-voice-details {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
}

.comparison-play-btn {
    background: linear-gradient(135deg, #7c3aed, #3730a3);
    border: 1px solid #7c3aed;
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    width: 100%;
}

.comparison-play-btn:hover {
    background: linear-gradient(135deg, #8b5cf6, #4338ca);
}

.legacy-selector {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #334155;
}

.legacy-selector summary {
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 10px;
    user-select: none;
}

.legacy-selector summary:hover {
    color: #cbd5e1;
}

.no-voices-found {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.no-voices-found-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.voice-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #334155;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        justify-content: center;
    }
    
    .status-grid, .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .test-buttons, .voice-filters {
        grid-template-columns: 1fr;
    }
    
    .comparison-voices {
        grid-template-columns: 1fr;
    }
    
    .voice-details {
        flex-direction: column;
        gap: 4px;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Monaco', 'Cascadia Code', system-ui, monospace;
    background: #0a0e1a;
    color: #e2e8f0;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
    overflow-y: hidden;
}

.app-layout {
    display: grid;
    grid-template-columns: 16.67% 66.66% 16.67%; /* Exact 1/6, 2/3, 1/6 */
    height: 100vh;
    gap: 1rem;
    padding: 1rem;
    background: 
        radial-gradient(circle at 25% 25%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #0a0e1a 0%, #1a1b2e 25%, #16213e 50%, #0f3460 75%, #0a0e1a 100%);
}

.left-sidebar {
    /* Reserved for future content */
}

.chat-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1rem;
}

.right-sidebar {
    padding: 1rem 12% 1rem 1rem;
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.right-sidebar * {
    box-sizing: border-box;
}

.left-sidebar {
    padding: 1rem;
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    min-height: 100vh;
    background: 
        radial-gradient(circle at 25% 25%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #0a0e1a 0%, #1a1b2e 25%, #16213e 50%, #0f3460 75%, #0a0e1a 100%);
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* Header */
.chat-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1.5rem 1.5rem 0 0;
    backdrop-filter: blur(25px);
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.3));
    border: 2px solid rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    position: relative;
    flex-shrink: 0;
}

.ai-avatar::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #a855f7, #7c3aed, #ec4899, #06b6d4);
    border-radius: 12px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 20%, #ec4899 40%, #06b6d4 60%, #10b981 80%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.status-indicators {
    display: flex;
    gap: 1rem;
    font-size: 0.85em;
}

.mode-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.mode-indicator.chill {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.mode-indicator.full-power {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(79, 70, 229, 0.15));
    border-color: rgba(147, 51, 234, 0.4);
    color: #8b5cf6;
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.3);
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from {
        box-shadow: 0 0 15px rgba(147, 51, 234, 0.3);
    }
    to {
        box-shadow: 0 0 20px rgba(147, 51, 234, 0.5);
    }
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.status-dot.connected {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.controls {
    display: flex;
    gap: 0.75rem;
}

.btn-admin, .btn-clear, .btn-login, .btn-dashboard {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.btn-admin:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.4);
    color: #a855f7;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.btn-login:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.btn-dashboard:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    padding-bottom: 3rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-top: none;
    backdrop-filter: blur(25px);
    scroll-behavior: smooth;
    max-height: calc(100vh - 200px);
}

.message {
    margin-bottom: 0.1rem;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    margin-left: auto;
    text-align: right;
}

.user-message .message-content {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(14, 165, 233, 0.8));
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 1.5rem 1.5rem 0.375rem 1.5rem;
    display: inline-block;
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.2);
}

.ai-message .message-content {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 1.5rem 1.5rem 1.5rem 0.375rem;
    border-left: 4px solid #a855f7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.ai-message .message-content strong {
    color: #a855f7;
    font-weight: 700;
}

/* AI name gradient styling for web chat responses - matches header */
.ai-name {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 20%, #ec4899 40%, #06b6d4 60%, #10b981 80%, #f59e0b 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    display: inline;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (background-clip: text) or not (-webkit-background-clip: text) {
    .ai-name {
        color: #a855f7;
        background: none;
    }
}

/* Message text formatting */
.message-text {
    margin-top: 0.5rem;
    line-height: 1.6;
}

.message-text p {
    margin: 0.3rem 0; /* Reduce from 1rem for tighter paragraph spacing */
}

.message-text p:last-child {
    margin-bottom: 0;
}

/* List formatting - improved spacing and hierarchy */
.list-item {
    margin: 0.2rem 0; /* Reduce from 0.5rem for tighter spacing */
    display: flex;
    align-items: flex-start;
    line-height: 1.4; /* Slightly tighter line height */
}

.list-item.numbered-item {
    margin-left: 0.5rem;
}

.list-item.bullet-item {
    margin-left: 0.5rem;
}

/* Style for sub-list items (+ items) */
.list-item.sub-item {
    margin-left: 2rem;
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
    font-size: 0.9em;
    color: #94a3b8; /* Slightly muted color for sub-items */
}

.list-number {
    color: #60a5fa;
    font-weight: 600;
    margin-right: 0.25rem; /* Tighter spacing */
    min-width: 2rem;
    flex-shrink: 0;
}

.bullet {
    color: #60a5fa;
    font-weight: bold;
    margin-right: 0.25rem; /* Tighter spacing */
    flex-shrink: 0;
}

/* Paragraph spacing in formatted content */
.message-text br + br {
    display: block;
    margin: 0.5rem 0;
    content: "";
}

/* Thinking animation for Zin processing indicator */
.thinking-animation {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-radius: 50%;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #a855f7, #06b6d4) padding-box, 
                linear-gradient(135deg, #7c3aed, #ec4899, #06b6d4) border-box;
    animation: thinkingPulse 1.2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.thinking-animation .ai-glyph {
    font-size: 20px;
    position: absolute;
    z-index: 2;
    user-select: none;
    animation: glyphPulse 1.2s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.7;
    }
    50% { 
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes glyphPulse {
    0%, 100% { 
        transform: scale(0.9);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1);
        opacity: 1;
    }
}

.thinking-container {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.thinking-text {
    margin-left: 1rem;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.9rem;
}

.message-time {
    font-size: 0.75em;
    color: #64748b;
    margin-top: 0.5rem;
    opacity: 0.7;
    font-family: 'Monaco', 'Cascadia Code', monospace;
}

.user-message .message-time {
    text-align: right;
}

/* Input Section */
.input-section {
    position: sticky;
    bottom: 0;
    z-index: 99;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 0 0 1.5rem 1.5rem;
    backdrop-filter: blur(25px);
    padding: 1.5rem;
    border-top: none;
    margin-top: auto;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
}

.stats-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 1rem;
    max-height: fit-content;
}

.stats-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-bottom: 0.75rem;
}

.stats-card .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.stats-card .stat-item:last-child {
    border-bottom: none;
}

.stats-card .stat-label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

.stats-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #06b6d4;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.stat-item {
    text-align: center;
    font-size: 0.85rem;
}

.stat-label {
    color: #94a3b8;
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-weight: 800;
    color: #06b6d4;
    font-size: 1.5em;
    font-family: 'Monaco', 'Cascadia Code', monospace;
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
    margin-top: 0.25rem;
}

.voice-toggle-section {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.voice-controls-toggle {
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    color: #e2e8f0;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.voice-controls-toggle:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.4);
    color: #a855f7;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.toggle-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.toggle-arrow.rotated {
    transform: rotate(180deg);
}

.voice-controls {
    margin-bottom: 1rem;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.voice-controls.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.voice-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
}

.voice-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.voice-speed, .voice-pitch, .voice-volume, .voice-timeout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 120px;
}

.voice-speed label, .voice-pitch label, .voice-volume label, .voice-timeout label {
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 50px;
}

.speed-slider, .pitch-slider, .volume-slider {
    -webkit-appearance: none;
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: rgba(100, 116, 139, 0.4);
    outline: none;
    transition: all 0.3s ease;
}

.speed-slider::-webkit-slider-thumb, .pitch-slider::-webkit-slider-thumb, .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
}

.speed-slider::-webkit-slider-thumb:hover, .pitch-slider::-webkit-slider-thumb:hover, .volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}

.speed-slider::-moz-range-thumb, .pitch-slider::-moz-range-thumb, .volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

#speedValue, #pitchValue, #volumeValue {
    color: #7c3aed;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 35px;
}

.timeout-dropdown {
    padding: 0.5rem 0.75rem;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.375rem;
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s ease;
    min-width: 110px;
}

.timeout-dropdown:focus {
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.voice-test {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn-test-voice, .btn-voice-settings {
    padding: 0.6rem 1.2rem;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-test-voice:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-voice-settings:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.4);
    color: #a855f7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.voice-dropdown {
    flex: 1;
    max-width: 300px;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.voice-dropdown:focus {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.voice-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #cbd5e1;
    font-weight: 600;
    user-select: none;
}

.voice-toggle input {
    display: none;
}

.toggle-slider-mini {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(100, 116, 139, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.toggle-slider-mini:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.voice-toggle input:checked + .toggle-slider-mini {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(124, 58, 237, 0.4));
    border-color: rgba(168, 85, 247, 0.5);
}

.voice-toggle input:checked + .toggle-slider-mini:before {
    transform: translateX(20px);
}

.input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#messageInput {
    flex: 1;
    width: 100%;
    min-height: 40px;
    max-height: 120px; /* Limit to ~6 lines */
    padding: 12px 16px;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    backdrop-filter: blur(10px);
    font-family: inherit;
    word-wrap: break-word;
    overflow-y: auto;
    resize: none;
}

#messageInput:focus {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
    background: rgba(30, 41, 59, 0.8);
}

#messageInput::placeholder {
    color: #64748b;
}

.btn-voice, .btn-send {
    width: 60px;
    height: 60px;
    border: 2px solid;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.btn-voice {
    background: linear-gradient(135deg, #a855f7, #06b6d4) padding-box,
                linear-gradient(135deg, #7c3aed, #ec4899, #06b6d4) border-box;
    border: 2px solid transparent;
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-voice:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

.btn-voice.listening {
    background: linear-gradient(135deg, #a855f7, #06b6d4) padding-box,
                linear-gradient(135deg, #7c3aed, #ec4899, #06b6d4) border-box;
    animation: voicePulse 1.5s infinite;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
}

.btn-voice.listening::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #ec4899, #06b6d4);
    z-index: -1;
    animation: voicePulse 1.5s infinite;
}

@keyframes voicePulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 0 0 40px rgba(6, 182, 212, 0.6);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    }
}

.btn-send {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(124, 58, 237, 0.9));
    border-color: rgba(168, 85, 247, 0.5);
    color: white;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
    border-color: rgba(168, 85, 247, 0.8);
}

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

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-btn {
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.quick-btn:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

/* Voice Indicator */
.voice-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(25px);
    color: #e2e8f0;
    padding: 4rem;
    border-radius: 2rem;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    width: 450px;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
}

.voice-indicator.hidden {
    display: none;
}

.voice-animation {
    width: 120px;
    height: 120px;
    border: 6px solid transparent;
    border-radius: 50%;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #a855f7, #06b6d4) padding-box,
                linear-gradient(135deg, #7c3aed, #ec4899, #06b6d4) border-box;
    animation: voicePulse 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.voice-animation .ai-glyph {
    font-size: 48px;
    position: absolute;
    z-index: 2;
    user-select: none;
    animation: voiceGlyphPulse 1.5s ease-in-out infinite;
}

@keyframes voiceGlyphPulse {
    0%, 100% { 
        transform: scale(0.9);
        opacity: 0.85;
    }
    50% { 
        transform: scale(1.05);
        opacity: 1;
    }
}

.voice-indicator p {
    font-size: 2.2rem;
    font-weight: 600;
    color: #06b6d4;
    margin-bottom: 1rem;
}

.voice-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.voice-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.voice-status {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 1rem;
    font-style: italic;
}

@keyframes voicePulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 40px rgba(6, 182, 212, 0.5);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(6, 182, 212, 0.4));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(6, 182, 212, 0.6));
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        min-height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
        padding: 1rem;
    }
    
    .chat-container, .input-section {
        padding: 1rem;
    }
    
    .ai-info {
        gap: 0.75rem;
    }
    
    .ai-details h1 {
        font-size: 1.5rem;
    }
    
    .status-indicators {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .left-sidebar {
        order: 2;
        display: none; /* Hide on mobile for now */
    }
    
    .chat-main {
        order: 1;
        padding: 0.5rem;
    }
    
    .right-sidebar {
        order: 3;
        padding: 0.5rem;
    }
    
    .stats-card {
        position: static;
        margin-top: 1rem;
    }
    
    .input-section {
        position: fixed;
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        margin-top: 0;
        border-radius: 1rem;
    }
    
    .quick-actions {
        justify-content: center;
    }
    
    .message {
        max-width: 95%;
    }
    
    .btn-voice, .btn-send {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .input-section {
        border-radius: 0;
    }
}

/* Animation for message appearance */
.message {
    animation: slideIn 0.3s ease-out;
}

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

/* Loading indicator for AI responses */
.message.loading .message-content::after {
    content: "●●●";
    animation: loadingDots 1.5s infinite;
    color: #64748b;
}

@keyframes loadingDots {
    0%, 20% { color: #64748b; }
    40% { color: #a855f7; }
    60% { color: #06b6d4; }
    80%, 100% { color: #64748b; }
}

/* Stats toggle */
.stats-toggle {
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    color: #e2e8f0;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.stats-toggle:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.4);
    color: #06b6d4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3);
}

.stats-card.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    margin-bottom: 0;
}

.stats-card:not(.collapsed) {
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    margin-bottom: 1rem;
}

/* Voice controls in right sidebar */
.right-sidebar .voice-toggle-section {
    margin-top: 1rem;
}

.right-sidebar .voice-controls-toggle {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    justify-content: center;
}

.right-sidebar .voice-controls {
    margin-bottom: 0;
}

.right-sidebar .voice-settings .voice-row {
    flex-direction: column;
    gap: 0.75rem;
}

.right-sidebar .voice-settings .voice-row .voice-speed,
.right-sidebar .voice-settings .voice-row .voice-pitch,
.right-sidebar .voice-settings .voice-row .voice-volume {
    width: 100%;
}

.right-sidebar .voice-settings .voice-row .voice-timeout {
    width: 100%;
}

.right-sidebar .voice-dropdown {
    max-width: 100%;
    width: 100%;
    font-size: 0.8rem;
    box-sizing: border-box;
}

.right-sidebar .voice-test {
    flex-direction: column;
    gap: 0.5rem;
}

.right-sidebar .btn-test-voice,
.right-sidebar .btn-voice-settings {
    width: 100%;
    font-size: 0.8rem;
    padding: 0.5rem;
}

/* ========================================
   Threshold Meter Styles
   ======================================== */

/* Horizontal progress bar positioned directly below message input */
.threshold-meter {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 4px 0;
    overflow: hidden;
    position: relative;
}

.threshold-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, 
        #00ff88 0%,     /* Green start */
        #00ccff 25%,    /* Blue */
        #6644ff 50%,    /* Purple */
        #ff44e9 75%,    /* Pink */
        #d300ff 100%    /* Magenta end */
    );
}

.threshold-critical {
    animation: pulse-warning 1s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Threshold Dialog Overlay */
.threshold-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.threshold-dialog {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    color: white;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.dialog-header h3 {
    margin: 0 0 10px 0;
    color: #ff4488;
    font-size: 1.5rem;
}

.dialog-header p {
    margin: 0 0 20px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.dialog-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.refresh-option {
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
}

.refresh-option:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
}

.refresh-option small {
    display: block;
    opacity: 0.7;
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: normal;
}

.full-refresh:hover {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.partial-refresh:hover {
    border-color: #6644ff;
    background: rgba(102, 68, 255, 0.1);
}

.zip-refresh:hover {
    border-color: #ff4488;
    background: rgba(255, 68, 136, 0.1);
}

/* Threshold meter tooltip */
.threshold-meter::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.threshold-meter:hover::after {
    opacity: 1;
}

/* Notification System Styles */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 350px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}