/* DeepAgents Web - Modern CSS Styles */

:root {
    /* Color Palette - Light Theme (Default) */
    --primary: #2563eb;       /* Blue 600 */
    --primary-rgb: 37, 99, 235; /* Blue 600 RGB */
    --primary-dark: #1d4ed8;  /* Blue 700 */
    --primary-light: #3b82f6; /* Blue 500 */
    --secondary: #059669;     /* Emerald 600 */
    --accent: #d97706;        /* Amber 600 */
    --danger: #dc2626;        /* Red 600 */
    
    --bg-dark: #f8fafc;       /* Slate 50 */
    --bg-darker: #f1f5f9;     /* Slate 100 */
    --bg-card: #ffffff;       /* White */
    --bg-card-hover: #f1f5f9; /* Slate 100 */
    --bg-input: #f8fafc;      /* Slate 50 */
    --bg-message-user: #eff6ff; /* Blue 50 */
    --bg-hover: rgba(0, 0, 0, 0.05); /* Generic hover */
    --bg-glass: rgba(255, 255, 255, 0.7);
    
    --text-primary: #1e293b;   /* Slate 800 */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94a3b8;     /* Slate 400 */
    
    --border-color: #e2e8f0;   /* Slate 200 */
    --border-light: #cbd5e1;   /* Slate 300 */
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    
    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 72px; /* Mini sidebar width */
    --header-height: 60px;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme - Cyberpunk Dark */
[data-theme="default"], [data-theme="dark"] {
    /* Deep, rich blacks with vibrant neon accents */
    --primary: #8b5cf6;       /* Violet 500 */
    --primary-rgb: 139, 92, 246; /* Violet 500 RGB */
    --primary-dark: #7c3aed;  /* Violet 600 */
    --primary-light: #a78bfa; /* Violet 400 */
    --secondary: #10b981;     /* Emerald 500 */
    --accent: #f59e0b;        /* Amber 500 */
    --danger: #ef4444;        /* Red 500 */
    
    --bg-dark: #050505;       /* Almost Black */
    --bg-darker: #000000;     /* Pure Black */
    --bg-card: #121212;       /* Dark Grey */
    --bg-card-hover: #1e1e1e; /* Lighter Grey */
    --bg-input: #121212;      /* Dark Grey */
    --bg-message-user: #2e1065; /* Violet 950 */
    --bg-hover: rgba(255, 255, 255, 0.05); /* Generic hover */
    --bg-glass: rgba(18, 18, 18, 0.7);
    
    --text-primary: #f4f4f5;   /* Zinc 100 */
    --text-secondary: #a1a1aa; /* Zinc 400 */
    --text-muted: #52525b;     /* Zinc 600 */
    
    --border-color: #27272a;   /* Zinc 800 */
    --border-light: #3f3f46;   /* Zinc 700 */
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.8);
}

/* Ocean Theme - Deep Blue */
[data-theme="ocean"] {
    --primary: #0ea5e9;       /* Sky 500 */
    --primary-rgb: 14, 165, 233; /* Sky 500 RGB */
    --primary-dark: #0284c7;  /* Sky 600 */
    --primary-light: #38bdf8; /* Sky 400 */
    --secondary: #06b6d4;     /* Cyan 500 */
    --accent: #f59e0b;        /* Amber 500 */
    --danger: #ef4444;        /* Red 500 */
    
    --bg-dark: #0f172a;       /* Slate 900 */
    --bg-darker: #020617;     /* Slate 950 */
    --bg-card: #1e293b;       /* Slate 800 */
    --bg-card-hover: #334155; /* Slate 700 */
    --bg-input: #1e293b;      /* Slate 800 */
    --bg-message-user: #075985; /* Sky 800 */
    --bg-hover: rgba(255, 255, 255, 0.05); /* Generic hover */
    --bg-glass: rgba(30, 41, 59, 0.7);
    
    --text-primary: #f0f9ff;   /* Sky 50 */
    --text-secondary: #cbd5e1; /* Slate 300 */
    --text-muted: #64748b;     /* Slate 500 */
    
    --border-color: #334155;   /* Slate 700 */
    --border-light: #475569;   /* Slate 600 */
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal), transform var(--transition-normal);
    z-index: 100;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.hidden-sidebar {
    width: 0 !important;
    border-right: none !important;
    overflow: hidden !important;
    min-width: 0 !important;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid transparent;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0px); }
}

.tech-text {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.1em;
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #e0e7ff 40%,
        #00fff9 50%,
        #6366f1 60%,
        #ffffff 100%
    );
    background-size: 200% auto;
    color: #fff;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 6s linear infinite;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.sidebar.collapsed .tech-text {
    display: none;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding: 0 0.75rem;
}

.sidebar.collapsed .nav-title {
    display: none;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.25rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: var(--transition-fast);
    text-align: left;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.nav-btn i {
    width: 1.25rem;
    text-align: center;
    opacity: 0.8;
}

.nav-btn.active i {
    opacity: 1;
    color: var(--primary-light);
}

.sidebar.collapsed .nav-btn span {
    display: none;
}

.sidebar.collapsed .nav-btn {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .user-info > div:nth-child(2) {
    display: none !important;
}

.sidebar.collapsed .user-info {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: row; /* Changed from column to row for side-panel layout */
    min-width: 0;
    position: relative;
    background: var(--bg-dark);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1; /* Allow it to shrink/grow */
    min-width: 0; /* Prevent overflow */
    width: auto; /* Let flex handle width */
}

.chat-header {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2rem 160px 2rem; /* Added bottom padding for floating input */
    /* scroll-behavior: smooth;  <-- Removed to prevent scrolling lag during streaming */
}

/* Chat Input Area */
.chat-input-container {
    padding: 0 2rem 2rem 2rem;
    /* Floating positioning */
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to top, var(--bg-dark) 20%, transparent 100%);
    pointer-events: none; /* Let clicks pass through empty areas */
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    pointer-events: auto; /* Re-enable clicks */
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    background: var(--bg-card); /* Solid background on focus for better contrast */
    box-shadow: 0 12px 40px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-2px);
}

#chatInput {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    min-height: 1.5em;
    max-height: 300px;
    padding: 0;
    font-family: inherit;
    line-height: 1.5;
}

#chatInput:focus {
    outline: none;
    box-shadow: none;
    background: transparent;
    border-color: transparent;
}

/* Voice Visualizer */
.voice-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 1.5em; /* Match input height */
    width: 100%;
    color: var(--primary);
}

.voice-wave-bar {
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    animation: voice-bar 1s ease-in-out infinite;
}

.voice-wave-bar:nth-child(1) { animation-delay: 0.0s; height: 40%; }
.voice-wave-bar:nth-child(2) { animation-delay: 0.1s; height: 70%; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.2s; height: 100%; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.3s; height: 70%; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.4s; height: 40%; }

@keyframes voice-bar {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

.voice-text {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    animation: pulse 1.5s infinite;
}

.input-wrapper.voice-mode {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

/* Hide input when voice active */
.input-wrapper.voice-mode #chatInput {
    display: none;
}

/* Show visualizer when voice active */
.input-wrapper.voice-mode #voiceVisualizer {
    display: flex !important;
}

/* Hide original voice wave in button when active (since we show it in box) */
.input-wrapper.voice-mode .voice-btn .voice-wave-container {
    display: none;
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.input-tools-left, .input-tools-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.upload-btn, .send-btn, .stop-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    /* Fixed size for circular buttons */
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent shrinking */
}

.upload-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Voice Input Button (Kimi Style) */
.voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
    overflow: visible; /* Allow waves to spread out */
    flex-shrink: 0;
}

.voice-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.voice-btn.recording {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.voice-wave-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
}

.voice-btn.recording .voice-wave-container {
    display: block;
}

.voice-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.3);
    opacity: 0;
    z-index: -1;
}

.voice-btn.recording .voice-wave:nth-child(1) {
    animation: wave-animation 1.5s infinite;
}

.voice-btn.recording .voice-wave:nth-child(2) {
    animation: wave-animation 1.5s infinite 0.5s;
}

.voice-btn.recording .voice-wave:nth-child(3) {
    animation: wave-animation 1.5s infinite 1.0s;
}

@keyframes wave-animation {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }
    100% {
        width: 250%;
        height: 250%;
        opacity: 0;
    }
}

.send-btn {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.2);
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 10px rgba(139, 92, 246, 0.3);
}

.stop-btn {
    color: var(--danger);
    border: 1px solid var(--danger);
    background: rgba(239, 68, 68, 0.05);
    position: relative;
    overflow: hidden;
    animation: pulse-red-shadow 2s infinite;
}

.stop-btn:hover {
    background: var(--danger);
    color: white;
    animation: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

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

@keyframes pulse-red-shadow {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
        border-color: rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
        border-color: var(--danger);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
        border-color: rgba(239, 68, 68, 0.4);
    }
}

.input-hints {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.voice-sheet {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
    z-index: 1200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
    padding: 1rem;
}

.voice-sheet.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.voice-sheet-panel {
    width: 100%;
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-lg);
    padding: 1.25rem;
}

.voice-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.voice-sheet-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.voice-sheet-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.voice-hold-btn {
    width: 100%;
    height: 56px;
    border-radius: 28px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
    transition: var(--transition-fast);
}

.voice-hold-btn:active {
    transform: scale(0.98);
}

#voiceSheet[data-state="recording"] .voice-hold-btn {
    background: var(--primary-dark);
}

#voiceSheet[data-state="cancel"] .voice-hold-btn {
    background: var(--danger);
}

#voiceSheet[data-state="processing"] .voice-hold-btn {
    background: var(--bg-card-hover);
    color: var(--text-muted);
    cursor: default;
}

.voice-sheet-transcript {
    margin-top: 0.75rem;
    min-height: 52px;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-darker);
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

kbd {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.1rem 0.3rem;
    font-family: monospace;
}

/* Welcome Message */
.welcome-message {
    max-width: 950px;
    margin: 4rem auto;
    text-align: center;
    animation: fadeIn 0.5s ease;
    padding: 0 1rem;
}

.welcome-message h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.feature-card i {
    font-size: 1.5rem;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Hero Card */
.hero-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.hero-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.hero-card i {
    font-size: 2.5rem;
}

/* Game Hall */
.game-hall-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg-dark);
}

.game-hall-header {
    margin-bottom: 2rem;
    text-align: center;
}

.game-hall-header h2 {
    font-size: 2rem;
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.game-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background: var(--bg-card);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.game-cover {
    height: 160px;
    background: linear-gradient(45deg, #2e1065, #4c1d95);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.game-cover i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.2);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.play-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.game-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-info h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

.game-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    flex: 1;
}

.game-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.coming-soon {
    opacity: 0.7;
    cursor: default;
}

.coming-soon:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
}

/* Hint Text */
.hint {
    margin-top: 3rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.6;
    letter-spacing: 0.05em;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 1.5rem;
    max-width: 950px;
    margin: 0 auto 2rem auto; /* Increased spacing */
    width: 100%;
    animation: fadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px; /* Slightly larger */
    height: 36px;
    border-radius: 12px; /* Smooth rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.message-content {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 0;
    line-height: 1.7;
}

.message.user .message-content {
    background: var(--primary);
    border: none;
    border-radius: 1.25rem 1.25rem 0.25rem 1.25rem; /* Standard modern chat bubble */
    padding: 0.85rem 1.25rem;
    max-width: 80%;
    margin-left: auto;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.25);
    color: white;
    position: relative;
    font-weight: 400;
    line-height: 1.6;
}

/* Remove the cheap shine effect */
.message.user .message-content::before {
    display: none;
}

/* Tool Calls Styling */
.tool-call {
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bg-card);
    width: 100%;
    max-width: 100%;
    /* Add subtle shadow */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.tool-call:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ... (existing styles) */

/* Modern Component System */

/* 1. Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    line-height: 1.2;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 10px -1px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.96);
}

/* Secondary/Cancel Button */
.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
    color: white;
}

/* Danger Button */
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4);
}

/* Danger Outline Button */
.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* 2. Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.2rem;
}

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.input:hover {
    border-color: var(--border-light);
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    background: var(--bg-card);
}

.input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* 3. Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

/* 4. Modals (Enhanced) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show,
.modal.open {
    display: flex; /* Flex when shown */
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 500px;
    border-radius: 1.2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-darker);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-darker);
}

/* Animations */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.tool-call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: var(--transition-fast);
}

.tool-call-header:hover {
    background: var(--bg-card-hover);
}

/* Tool icon and name */
.tool-call-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.tool-call-name i {
    color: var(--primary-light);
    width: 1.2em;
    text-align: center;
}

.tool-call-time {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
}

.tool-call-toggle {
    color: var(--text-muted);
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.tool-call.expanded .tool-call-toggle {
    transform: rotate(180deg);
}

.tool-call.expanded .tool-call-header {
    border-bottom-color: var(--border-color);
    background: var(--bg-darker);
}

.tool-call-body {
    padding: 1rem;
    background: var(--bg-darker);
    /* border-top handled by header border-bottom */
    font-family: monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    display: none;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-call.expanded .tool-call-body {
    display: block;
}

.tool-call-section {
    margin-bottom: 1rem;
}

.tool-call-section:last-child {
    margin-bottom: 0;
}

.tool-call-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.tool-call-section pre {
    margin: 0;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.05);
}

.tool-call-section code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    color: var(--text-secondary);
}

/* Modern Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    line-height: 1.2;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 8px -1px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626; /* Darker red */
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(239, 68, 68, 0.4);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
}

.btn-text:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Modern Input Fields */
input[type="text"], 
input[type="password"], 
input[type="email"],
input[type="number"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    background: var(--bg-card);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Modal Enhancements */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.2rem; /* Softer corners */
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.5), 
        0 8px 10px -6px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    background: var(--bg-card);
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-darker); /* Subtle contrast for footer */
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Close Button refinement */
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

#authModal {
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
}

/* Auth Modal Styling (Adaptive Theme) */
#authModal .auth-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: 
        var(--shadow-lg),
        0 0 0 1px rgba(var(--primary-rgb), 0.1);
    max-width: 380px;
    width: 90%;
    overflow: hidden;
    position: relative;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Header Section */
.auth-header {
    text-align: center;
    padding: 2.5rem 2rem 1rem 2rem;
    position: relative;
    background: radial-gradient(circle at top, var(--bg-card-hover), transparent 70%);
}

.auth-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--bg-darker);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    font-size: 1.75rem;
    color: var(--primary);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.auth-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

#authModal .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: var(--bg-hover);
    border-radius: 50%;
    transition: all 0.2s;
    color: var(--text-muted);
    border: 1px solid transparent;
}

#authModal .modal-close:hover {
    background: var(--bg-card-hover);
    transform: rotate(90deg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Body Section */
.auth-body {
    padding: 1rem 2rem 2.5rem 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Simplified Form Styling */
.simple-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.simple-form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

.simple-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.simple-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.simple-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    background: var(--bg-card);
}

/* Fallback for focus ring */
.simple-input:focus {
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Error Message */
.auth-error {
    display: none; /* JS will toggle this */
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

/* Success Message Override */
.auth-error.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--secondary);
    color: var(--secondary);
}

.auth-error[style*="display: block"] {
    display: flex !important;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--primary-dark);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

/* Footer */
.auth-footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    margin-left: 0.25rem;
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: transparent; /* Initially transparent */
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent; /* Hide thumb by default */
    border-radius: 3px;
    transition: background 0.3s ease;
}

/* Show scrollbar on hover */
*:hover::-webkit-scrollbar-thumb {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        height: 100%;
        width: 80%;
        max-width: 300px;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .side-panel {
        position: fixed;
        right: -100%;
        height: 100%;
        width: 100%;
        z-index: 101;
    }
    
    .side-panel.open {
        right: 0;
        width: 100%;
    }
    
    .message {
        max-width: 100%;
    }
}

/* Rich File Card Styling */
.rich-file-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin: 1rem 0;
    overflow: hidden;
    transition: border-color 0.2s;
    position: relative;
}

.rich-file-card:hover {
    border-color: var(--primary);
}

.file-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.rich-file-card:hover .file-card-header {
    border-bottom-color: var(--border-color);
}

/* Removed .file-icon-wrapper styles */

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn.primary {
    color: var(--primary);
}

.action-btn.primary:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-dark);
}

.file-preview-content {
    padding: 1rem;
    background: var(--bg-darker); /* Slightly darker for contrast */
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 200px; /* Increased height slightly */
    overflow: hidden;
    position: relative;
    border-top: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-break: break-all;
}

.file-preview-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--bg-darker));
    pointer-events: none;
}

/* Removed .preview-tag */

/* Add these to end of style.css */

/* Markdown Preview Styles within File Card */
.file-preview-content.markdown-preview {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.file-preview-content.markdown-preview h1,
.file-preview-content.markdown-preview h2,
.file-preview-content.markdown-preview h3,
.file-preview-content.markdown-preview h4,
.file-preview-content.markdown-preview h5,
.file-preview-content.markdown-preview h6 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
}

.file-preview-content.markdown-preview h1 { font-size: 1.1rem; }
.file-preview-content.markdown-preview h2 { font-size: 1rem; }
.file-preview-content.markdown-preview h3 { font-size: 0.95rem; }

.file-preview-content.markdown-preview p {
    margin-bottom: 0.5rem;
}

.file-preview-content.markdown-preview ul,
.file-preview-content.markdown-preview ol {
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
}

.file-preview-content.markdown-preview code {
    background-color: rgba(110, 118, 129, 0.4);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 85%;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

.file-preview-content.markdown-preview pre {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

.file-preview-content.markdown-preview pre code {
    background-color: transparent;
    padding: 0;
    font-size: 100%;
}

.file-preview-content.markdown-preview blockquote {
    margin: 0 0 0.5rem;
    padding: 0 1em;
    color: var(--text-muted);
    border-left: 0.25em solid var(--border-color);
}

/* Side Panel Styles - Restored */
.side-panel {
    width: 0;
    min-width: 0; /* Ensure it can collapse fully */
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    z-index: 90;
    height: 100%;
}

.side-panel.open {
    width: 400px; /* Default width */
}

.panel-header {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    white-space: nowrap;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.panel-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-width: 0; /* Changed from 300px to avoid layout issues */
}
