/* CSS Design System for Rank Tester AI */
:root {
    /* Color Palette */
    --bg-primary: #0f0d0c;
    --bg-secondary: #1a1514;
    --bg-tertiary: #26201e;
    --accent-cyan: #f97316;    /* Primary Orange */
    --accent-purple: #eab308;  /* Primary Gold */
    --accent-magenta: #ef4444; /* Crimson Red */
    --accent-green: #22c55e;   /* Success Green */
    
    /* Text Colors */
    --text-primary: #fafaf9;
    --text-secondary: #d6d3d1;
    --text-muted: #78716c;
    
    /* UI Styling */
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(26, 21, 20, 0.65);
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

h1, h2, h3, h4, .brand h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Background Canvas & Fluid Animation */
#fluid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    filter: blur(120px) saturate(180%);
    opacity: 0.75;
}

.glow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: radial-gradient(circle at 50% 50%, transparent 20%, var(--bg-primary) 85%);
    pointer-events: none;
}

/* App Container Layout */
#app-container {
    position: relative;
    z-index: 3;
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Icons */
.lucide {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Buttons */
.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

/* Fonts and Badges */
.font-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.badge-gpu, .badge-server, .badge-success {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-gpu {
    background: rgba(0, 240, 255, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.badge-server {
    background: rgba(157, 0, 255, 0.15);
    color: #df9eff;
    border: 1px solid rgba(157, 0, 255, 0.3);
}

.badge-success {
    background: rgba(0, 255, 102, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 102, 0.3);
}

.text-cyan { color: var(--accent-cyan) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-green { color: var(--accent-green) !important; }

/* ==========================================================================
   Sidebar Styling
   ========================================================================== */
.sidebar {
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
    transition: width var(--transition-smooth), transform var(--transition-smooth);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 0;
    border-right: none;
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
}

.brand-text h1 {
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.new-chat-btn {
    margin: 16px 20px;
    background: linear-gradient(135deg, var(--accent-purple), #7900c4);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(157, 0, 255, 0.3);
    transition: var(--transition-fast);
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 0, 255, 0.45), 0 0 10px rgba(0, 240, 255, 0.2);
}

.new-chat-btn:active {
    transform: translateY(0);
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

/* Custom Scrollbar for Sidebar & Chat */
.sidebar-scroll::-webkit-scrollbar,
.messages-list::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover,
.messages-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

.nav-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 8px 8px 8px;
}

.chat-list {
    list-style: none;
}

.chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
    margin-bottom: 4px;
    gap: 10px;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.chat-item.active {
    background: rgba(157, 0, 255, 0.1);
    border-left: 3px solid var(--accent-purple);
    color: var(--text-primary);
}

.chat-title-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-session-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.chat-item:hover .delete-session-btn {
    opacity: 1;
}

.delete-session-btn:hover {
    color: var(--accent-magenta);
}

/* Grid Status Card */
.grid-status-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    margin: 10px 8px 24px 8px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.status-indicator-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.status-dot.pulsing {
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 12px var(--accent-green); }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.grid-status-card h3 {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.status-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.status-row .label {
    color: var(--text-secondary);
}

.status-row .value {
    color: var(--text-primary);
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: var(--transition-fast);
}

.footer-action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.user-profile-container {
    width: 100%;
    margin-top: 8px;
}

.google-login-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.google-login-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.google-icon {
    width: 16px;
    height: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
    object-fit: cover;
    border: 1.5px solid rgba(0, 240, 255, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.username {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-badge {
    background: rgba(255, 0, 122, 0.12);
    border: 1px solid rgba(255, 0, 122, 0.25);
    color: var(--accent-magenta);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 0 5px rgba(255, 0, 122, 0.15);
    display: inline-block;
    flex-shrink: 0;
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    color: var(--accent-magenta);
    background: rgba(255, 0, 122, 0.06);
}

.logout-btn svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.app-header {
    height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(8, 6, 15, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Model Selector Dropdown */
.model-selector-wrapper {
    position: relative;
}

.model-select-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.model-select-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-hover);
}

.model-select-btn .chevron {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.model-select-btn.active .chevron {
    transform: rotate(180deg);
}

.model-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-glow);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
}

.model-dropdown.show {
    display: flex;
}

.dropdown-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item.active {
    background: rgba(157, 0, 255, 0.1);
    border: 1px solid rgba(157, 0, 255, 0.25);
}

.dropdown-item .item-title {
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-item .item-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.performance-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 102, 0.08);
    border: 1px solid rgba(0, 255, 102, 0.2);
    color: var(--accent-green);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==========================================================================
   Chat Window Styling
   ========================================================================== */
.chat-screen {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

/* Welcome Screen */
.welcome-screen {
    max-width: 800px;
    width: 100%;
    margin: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 20px;
}

.welcome-logo-container {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    background: rgba(13, 11, 24, 0.8);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.25);
    margin-bottom: 12px;
    animation: float 4s ease-in-out infinite;
}

.welcome-logo {
    width: 60px;
    height: 60px;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.welcome-screen h2 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #a09cb0, #00f0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-screen .subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 580px;
    line-height: 1.5;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    width: 100%;
    margin-top: 36px;
}

.suggestion-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggestion-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.suggestion-card h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.suggestion-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Messages Thread */
.messages-list {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 80px;
}

.message-wrapper {
    display: flex;
    gap: 16px;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-wrapper.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.message-wrapper.user .message-avatar {
    background: linear-gradient(135deg, var(--accent-magenta), var(--accent-purple));
    color: white;
}

.message-wrapper.assistant .message-avatar {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.message-bubble {
    max-width: calc(100% - 70px);
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message-wrapper.user .message-bubble {
    background: linear-gradient(135deg, rgba(157, 0, 255, 0.15), rgba(157, 0, 255, 0.05));
    border: 1px solid rgba(157, 0, 255, 0.2);
    border-top-right-radius: 4px;
}

.message-wrapper.assistant .message-bubble {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-top-left-radius: 4px;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Chat Input Footer Styling */
.chat-footer {
    padding: 0 24px 20px 24px;
    z-index: 5;
    background: linear-gradient(to top, var(--bg-primary) 80%, transparent);
}

.input-panel {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background: rgba(19, 16, 36, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-glow);
    transition: var(--transition-fast);
}

.input-panel:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(157, 0, 255, 0.15);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    max-height: 200px;
    min-height: 24px;
    line-height: 1.5;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.send-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.send-btn:hover {
    background: white;
    transform: scale(1.05);
}

.send-btn.disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: scale(1) !important;
}

.footer-privacy-notice {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.footer-privacy-notice .lucide {
    width: 12px;
    height: 12px;
}

/* ==========================================================================
   Modal Dialog Settings
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
    from { transform: scale(0.9) translateY(20px); }
    to { transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    gap: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.setting-control {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.setting-control:focus {
    border-color: var(--accent-cyan);
}

.toggle-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.toggle-control {
    appearance: none;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid var(--glass-border);
}

.toggle-control:checked {
    background: var(--accent-cyan);
}

.toggle-control::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: var(--transition-fast);
}

.toggle-control:checked::before {
    transform: translateX(20px);
}

.info-alert {
    background: rgba(0, 240, 255, 0.07);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    color: #e0faff;
    font-size: 0.82rem;
    display: flex;
    gap: 10px;
    line-height: 1.4;
}

.info-alert .lucide {
    flex-shrink: 0;
    color: var(--accent-cyan);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--text-primary);
    border: none;
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: white;
    transform: translateY(-1px);
}

/* ==========================================================================
   Responsive UI Adaptations
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.show-mobile {
        transform: translateX(0);
        width: 280px;
    }
    
    .toggle-sidebar-btn {
        display: flex !important;
    }
}

/* ==========================================================================
   Animated SVG Logo Styling
   ========================================================================== */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-container.small {
    width: 32px;
    height: 32px;
}

.gv-logo-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Vault Shield Path drawing animation */
.vault-shield {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawVaultShield 3.5s cubic-bezier(0.4, 0, 0.2, 1) forwards, pulseGlow 3s ease-in-out infinite 3.5s;
}

@keyframes drawVaultShield {
    0% {
        stroke-dashoffset: 300;
        filter: drop-shadow(0 0 0 rgba(0, 240, 255, 0));
    }
    100% {
        stroke-dashoffset: 0;
        filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.45));
    }
}

@keyframes pulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.35)) drop-shadow(0 0 8px rgba(157, 0, 255, 0.2));
        opacity: 0.9;
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6)) drop-shadow(0 0 16px rgba(157, 0, 255, 0.4));
        opacity: 1;
    }
}

/* Rotating core */
.vault-core {
    transform-origin: 50px 50px;
    animation: rotateCore 15s linear infinite;
    stroke-dasharray: 10 5;
}

@keyframes rotateCore {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.vault-core-dot {
    animation: blinkCore 2s ease-in-out infinite;
    transform-origin: 50px 50px;
}

@keyframes blinkCore {
    0%, 100% { 
        opacity: 0.7; 
        transform: scale(0.9);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1);
    }
}

/* Pulsing grid nodes */
.grid-node {
    fill: rgba(0, 240, 255, 0.4);
    animation: pulseNode 3s ease-in-out infinite;
    transform-origin: 50px 50px;
}

/* Add delays to nodes for random server activity look */
.logo-grid-nodes .node-1 { animation-delay: 0.2s; transform-origin: 20px 20px; }
.logo-grid-nodes .node-2 { animation-delay: 0.8s; transform-origin: 50px 20px; }
.logo-grid-nodes .node-3 { animation-delay: 0.4s; transform-origin: 80px 20px; }
.logo-grid-nodes .node-4 { animation-delay: 1.2s; transform-origin: 20px 50px; }
.logo-grid-nodes .node-5 { animation-delay: 0.6s; transform-origin: 80px 50px; }
.logo-grid-nodes .node-6 { animation-delay: 1.4s; transform-origin: 20px 80px; }
.logo-grid-nodes .node-7 { animation-delay: 0.9s; transform-origin: 50px 80px; }
.logo-grid-nodes .node-8 { animation-delay: 1.6s; transform-origin: 80px 80px; }

@keyframes pulseNode {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
        fill: rgba(0, 240, 255, 0.3);
    }
    50% {
        transform: scale(1.4);
        opacity: 1;
        fill: var(--accent-magenta);
        filter: drop-shadow(0 0 2px var(--accent-magenta));
    }
}

/* ==========================================================================
   Model Loading Panel Styling
   ========================================================================== */
.model-loading-panel {
    max-width: 800px;
    width: 100%;
    margin: 0 auto 12px auto;
    background: rgba(13, 11, 24, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.08);
    animation: slideUpFade 0.3s ease-out forwards;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.loading-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.animate-spin {
    animation: spin 1.2s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-percentage {
    color: var(--accent-cyan);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 3px;
    box-shadow: 0 0 8px var(--accent-cyan);
    transition: width 0.2s ease-out;
}

/* Cache Status Indicator Badges */
.model-status-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cache-status-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
}

.cache-status-badge.cached {
    background: rgba(0, 255, 102, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 102, 0.2);
}

.cache-status-badge.not-cached {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cache-status-badge.checking {
    background: rgba(0, 240, 255, 0.06);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.12);
}

/* ---- Model Action Buttons ---- */
.model-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.download-model-btn,
.use-model-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    letter-spacing: 0.03em;
}

.download-model-btn {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(0, 240, 255, 0.05));
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.download-model-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.28), rgba(0, 240, 255, 0.12));
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
    transform: translateY(-1px);
}

.download-model-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.use-model-btn {
    background: linear-gradient(135deg, rgba(0, 255, 102, 0.15), rgba(0, 255, 102, 0.05));
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 102, 0.3);
}

.use-model-btn:hover {
    background: linear-gradient(135deg, rgba(0, 255, 102, 0.28), rgba(0, 255, 102, 0.12));
    box-shadow: 0 0 14px rgba(0, 255, 102, 0.2);
    transform: translateY(-1px);
}

.download-model-btn svg,
.use-model-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* Spinning animation for loader icon during download */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.download-model-btn:disabled svg {
    animation: spin 1s linear infinite;
}

/* ---- Enhanced Loading Panel ---- */
.loading-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.loading-panel-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.loading-panel-title svg {
    width: 14px;
    height: 14px;
}

.loading-model-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
}

.loading-numbers {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-mb {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.loading-tip {
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.35));
    font-style: italic;
}

/* ---- Inline Download Progress Bar (inside dropdown) ---- */
.inline-dl-progress {
    margin-top: 8px;
    width: 100%;
}

.inline-dl-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.76rem;
}

.inline-dl-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-cyan);
    font-weight: 600;
}

.inline-dl-spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(0, 240, 255, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.inline-dl-nums {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-dl-mb {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
}

.inline-dl-pct {
    color: var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.78rem;
    min-width: 36px;
    text-align: right;
}

.inline-dl-track {
    width: 100%;
    height: 5px;
    background: rgba(0, 240, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.inline-dl-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), #00ff88);
    border-radius: 3px;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

/* ---- Firebase Sync Status Badge ---- */
.db-sync-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    transition: all 0.3s ease;
}

.db-sync-status.synced {
    background: rgba(0, 255, 102, 0.06);
    border-color: rgba(0, 255, 102, 0.15);
    color: var(--accent-green);
}

.db-sync-status.offline {
    background: rgba(255, 193, 7, 0.06);
    border-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.db-sync-status.error {
    background: rgba(255, 107, 138, 0.06);
    border-color: rgba(255, 107, 138, 0.15);
    color: #ff6b8a;
}

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #888;
    display: inline-block;
    transition: all 0.3s ease;
}

.db-sync-status.synced .sync-dot {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
    animation: pulseSync 2s infinite;
}

.db-sync-status.offline .sync-dot {
    background: #ffc107;
    box-shadow: 0 0 6px #ffc107;
}

.db-sync-status.error .sync-dot {
    background: #ff6b8a;
    box-shadow: 0 0 6px #ff6b8a;
}

@keyframes pulseSync {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px var(--accent-green); }
    100% { transform: scale(1); opacity: 0.9; }
}

/* ---- Teach AI Button ---- */
.teach-ai-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(157, 0, 255, 0.08);
    border: 1px solid rgba(157, 0, 255, 0.15);
    color: #c470ff;
    padding: 3.5px 9px;
    border-radius: 6px;
    font-size: 0.66rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.teach-ai-btn:hover:not(:disabled) {
    background: rgba(157, 0, 255, 0.18);
    border-color: rgba(157, 0, 255, 0.35);
    box-shadow: 0 0 8px rgba(157, 0, 255, 0.2);
}

.teach-ai-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.teach-ai-btn svg {
    width: 11px;
    height: 11px;
}

/* ==========================================================================
   Custom Neural Network Playground Styles
   ========================================================================== */
.vocab-words-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 4px;
    max-height: 220px;
    overflow-y: auto;
}

.vocab-word-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    transition: var(--transition-fast);
}

.vocab-word-tag:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 240, 255, 0.2);
    background: rgba(0, 240, 255, 0.03);
}

.playground-dashboard {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    height: calc(100vh - 70px);
    padding: 24px;
    overflow-y: auto;
    z-index: 5;
    position: relative;
}

@media (max-width: 1024px) {
    .playground-dashboard {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.dashboard-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow-glow);
}

.dashboard-card.main-test-panel {
    min-height: 480px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.header-title-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title-icon h3 {
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.card-subtitle-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.test-input-group, .epochs-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-input-group label, .epochs-input-group label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.input-action-wrapper {
    display: flex;
    gap: 12px;
    width: 100%;
}

.input-action-wrapper input, .epochs-input-group input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
    outline: none;
    transition: var(--transition-fast);
}

.input-action-wrapper input:focus, .epochs-input-group input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), #00a8ff);
    color: #050409;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(157, 0, 255, 0.1);
    color: #df9eff;
    border: 1px solid rgba(157, 0, 255, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(157, 0, 255, 0.2);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(157, 0, 255, 0.2);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Prediction Output Area */
.prediction-output-box {
    background: rgba(0, 240, 255, 0.02);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.output-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.confidence-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.confidence-badge.high {
    background: rgba(0, 255, 102, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 102, 0.2);
}

.confidence-badge.medium {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.confidence-badge.low {
    background: rgba(255, 107, 138, 0.12);
    color: #ff6b8a;
    border: 1px solid rgba(255, 107, 138, 0.2);
}

.output-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.output-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.output-val {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.output-val.font-black {
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}

.progress-bar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sandbox-hints-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: auto;
}

@media (max-width: 600px) {
    .sandbox-hints-grid {
        grid-template-columns: 1fr;
    }
}

.hint-card {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: 12px;
}

.hint-card svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.hint-card h5 {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.hint-card p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Model Training Box */
.training-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.training-setup-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: flex-end;
    gap: 16px;
}

.training-status-box {
    background: #04020a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    margin-top: 10px;
    min-height: 250px;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 16px;
}

.status-indicator-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
    display: inline-block;
}

.status-dot.success {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.status-dot.warning {
    background: #ffc107;
    box-shadow: 0 0 8px #ffc107;
}

.status-dot.danger {
    background: #ff6b8a;
    box-shadow: 0 0 8px #ff6b8a;
}

.pulsing {
    animation: consolePulse 1.5s infinite ease-in-out;
}

@keyframes consolePulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 0.6; }
}

.console-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.console-output {
    flex: 1;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #00ff66;
    overflow-y: auto;
    line-height: 1.5;
    white-space: pre-wrap;
    background: #04020a;
}

/* Spinner */
.inline-dl-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: rotateSpinner 0.8s linear infinite;
    display: inline-block;
}

@keyframes rotateSpinner {
    to { transform: rotate(360deg); }
}

.loading-placeholder {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 10px;
    text-align: center;
}

/* ==========================================================================
   Tab Navigation & Multi-Panel Sandbox Layouts
   ========================================================================== */
.nav-tabs-list {
    list-style: none;
    padding: 10px 0;
}

.nav-tab-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 6px 0;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.nav-tab-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-tab-item.active {
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.15);
    font-weight: 600;
}

.nav-tab-item svg {
    width: 18px;
    height: 18px;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

/* Dataset Builder Panel & Table Styles */
.dataset-editor-form textarea {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    resize: none;
    transition: var(--transition-fast);
}

.dataset-editor-form textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.dataset-table-wrapper {
    overflow-y: auto;
    max-height: 480px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.dataset-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.1);
}

.dataset-table th, .dataset-table td {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.82rem;
}

.dataset-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dataset-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    vertical-align: middle;
}

.dataset-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.btn-danger-icon {
    background: transparent;
    border: none;
    color: #ff6b8a;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-danger-icon:hover {
    background: rgba(255, 107, 138, 0.15);
    color: #ff4770;
}

.btn-danger-icon svg {
    width: 16px;
    height: 16px;
}

/* Dynamic Interactive SVG Network Map Visualizer */
.nn-visualizer-card {
    min-height: 480px;
    flex: 1.1;
}

.nn-viz-container {
    width: 100%;
    height: 420px;
    background: #04020a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.nn-viz-node {
    transition: all 0.3s ease;
    cursor: pointer;
}

.nn-viz-edge {
    transition: all 0.3s ease;
    stroke-linecap: round;
}

.nn-viz-label {
    font-size: 0.6rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    pointer-events: none;
}

/* Training Loss Line Chart Grid Styles */
.loss-chart-container {
    width: 100%;
    height: 280px;
    background: #04020a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loss-grid-line {
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 1;
}

.loss-axis {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1.5;
}

.loss-line-path {
    fill: none;
    stroke: url(#loss-gradient-line);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

.loss-axis-text {
    font-size: 0.55rem;
    fill: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Hyperparameters & Dropdowns Grid */
.hyperparameter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .hyperparameter-grid {
        grid-template-columns: 1fr;
    }
}

.dropdown-select {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropdown-select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.dropdown-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Bulk Normalizer runner textareas */
#batch-textarea {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    resize: none;
    transition: var(--transition-fast);
    font-family: 'JetBrains Mono', monospace;
}

#batch-textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.batch-results-wrapper {
    animation: fadeIn 0.4s ease;
}

/* ==========================================================================
   Chat Interface & Session Layouts
   ========================================================================== */
.chat-container-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    padding: 12px 24px 8px 24px;
    position: relative;
}

.chat-messages-box {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
    padding-right: 8px;
}

.chat-message {
    max-width: 85%;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.bot {
    align-self: flex-start;
    flex-direction: row;
}

.chat-message .message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, rgba(157, 0, 255, 0.15), rgba(0, 240, 255, 0.1));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.18) !important;
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 32px 0 rgba(0, 240, 255, 0.05);
}

.chat-message.bot .message-bubble {
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    color: var(--text-primary);
    border-top-left-radius: 4px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.chat-message .message-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.chat-message.user .message-meta {
    text-align: right;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sidebar Chat Sessions list */
.chat-sessions-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.chat-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin: 4px 0;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.chat-session-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.chat-session-item.active {
    background: rgba(0, 240, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.15);
    color: var(--accent-cyan);
    font-weight: 600;
}

.delete-session-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-fast);
    padding: 2px;
}

.chat-session-item:hover .delete-session-btn {
    opacity: 1;
}

.delete-session-btn:hover {
    color: #ff6b8a;
}

/* Settings Card styling */
.settings-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-key-input-wrapper {
    display: flex;
    gap: 6px;
}

.api-key-input-wrapper input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 0.75rem;
    outline: none;
}

.api-key-input-wrapper input:focus {
    border-color: var(--accent-cyan);
}

.api-key-input-wrapper button {
    background: var(--accent-cyan);
    border: none;
    color: #000;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.api-key-input-wrapper button:hover {
    background: #00d2e0;
}

.api-key-input-wrapper button svg {
    width: 14px;
    height: 14px;
}

.settings-hint {
    font-size: 0.58rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Admin Toggle Button */
.btn-admin-toggle {
    width: 100%;
    background: rgba(157, 0, 255, 0.1);
    border: 1px solid rgba(157, 0, 255, 0.25);
    color: #df9eff;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    transition: var(--transition-fast);
}

.btn-admin-toggle:hover {
    background: rgba(157, 0, 255, 0.18);
    border-color: rgba(157, 0, 255, 0.4);
    box-shadow: 0 0 12px rgba(157, 0, 255, 0.15);
}

.btn-admin-toggle svg {
    width: 16px;
    height: 16px;
}

/* Chat inputs wrapper */
.chat-input-bar-container {
    padding: 8px 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 6px 12px;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.chat-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    padding: 8px 4px;
}

/* Authorization Modal Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 2, 10, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.modal-header svg {
    width: 22px;
    height: 22px;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-body p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
}

.modal-body input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    outline: none;
}

.modal-body input:focus {
    border-color: var(--accent-cyan);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   Admin Console Content Areas & Dialog Transcripts
   ========================================================================== */
.admin-tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
}

.admin-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.admin-tab-btn:hover {
    color: var(--text-primary);
}

.admin-tab-btn.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-cyan);
}

.admin-tab-content {
    animation: fadeIn 0.3s ease;
}

.admin-sessions-list {
    list-style: none;
    padding: 0;
    max-height: 380px;
    overflow-y: auto;
}

.admin-session-row {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.8rem;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.admin-session-row:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.admin-session-row.active {
    background: rgba(0, 240, 255, 0.05);
    border-left: 3px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.admin-chat-transcript-box {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
    padding: 16px;
    background: #04020a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Teacher logs scroll area */
.teacher-dialogues-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 24px;
}

.teacher-dialogue-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.teacher-dialogue-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.teacher-bubble {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    margin: 6px 0;
    line-height: 1.4;
}

.teacher-bubble.grid-msg {
    background: rgba(157, 0, 255, 0.06);
    border: 1px solid rgba(157, 0, 255, 0.15);
    color: #df9eff;
}

.teacher-bubble.gemini-msg {
    background: rgba(0, 255, 102, 0.06);
    border: 1px solid rgba(0, 255, 102, 0.15);
    color: #a3ffc7;
}

/* Typing bounce circles */
.typing-indicator-wrapper {
    display: flex;
    align-items: center;
    padding: 8px 16px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
    margin: 0 2px;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ==========================================================================
   Welcome Dashboard Styles & Micro-Animations
   ========================================================================== */
.welcome-dashboard {
    max-width: 820px;
    margin: 4vh auto;
}

@keyframes logoPulse {
    0% {
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.05);
        border-color: rgba(0, 240, 255, 0.15);
    }
    100% {
        box-shadow: 0 0 40px rgba(0, 240, 255, 0.25), 0 0 10px rgba(157, 0, 255, 0.2);
        border-color: rgba(0, 240, 255, 0.4);
    }
}

.welcome-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.welcome-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.welcome-card:active {
    transform: translateY(-1px);
}

/* Custom glow effects for each card based on category */
.welcome-card:nth-child(1):hover {
    border-color: rgba(0, 240, 255, 0.3) !important;
    box-shadow: 0 8px 30px rgba(0, 240, 255, 0.06);
}

.welcome-card:nth-child(2):hover {
    border-color: rgba(157, 0, 255, 0.3) !important;
    box-shadow: 0 8px 30px rgba(157, 0, 255, 0.06);
}

.welcome-card:nth-child(3):hover {
    border-color: rgba(0, 255, 102, 0.3) !important;
    box-shadow: 0 8px 30px rgba(0, 255, 102, 0.06);
}

.welcome-card:nth-child(4):hover {
    border-color: rgba(255, 0, 122, 0.3) !important;
    box-shadow: 0 8px 30px rgba(255, 0, 122, 0.06);
}

.welcome-logo-area svg {
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.15));
}

/* ==========================================================================
   Daily Study Targets Widget Styles
   ========================================================================== */
.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    animation: slideInFast 0.25s ease;
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 240, 255, 0.15);
}

.todo-item.completed {
    background: rgba(0, 255, 102, 0.02);
    border-color: rgba(0, 255, 102, 0.1);
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-checkbox {
    cursor: pointer;
    accent-color: var(--accent-cyan);
    width: 14px;
    height: 14px;
}

.todo-text {
    flex: 1;
    margin: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.todo-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.todo-delete-btn:hover {
    color: var(--accent-magenta);
    background: rgba(255, 0, 122, 0.1);
}

@keyframes slideInFast {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Visual Glassmorphism Tables & Timetables
   ========================================================================== */
.visual-table-container {
    margin: 12px 0;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(13, 11, 24, 0.45);
    box-shadow: var(--shadow-glow);
}

.visual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
    color: var(--text-primary);
}

.visual-table th {
    background: linear-gradient(90deg, rgba(157, 0, 255, 0.1), rgba(0, 240, 255, 0.05));
    border-bottom: 2px solid rgba(0, 240, 255, 0.2);
    color: var(--accent-cyan);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    padding: 10px 14px;
}

.visual-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.visual-table tr:last-child td {
    border-bottom: none;
}

.visual-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

/* ==========================================================================
   Mermaid.js Flowcharts & Mind Maps
   ========================================================================== */
.mermaid-container {
    margin: 14px 0;
    padding: 16px;
    background: rgba(13, 11, 24, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.mermaid-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
    padding-bottom: 6px;
}

.mermaid-svg-wrapper {
    max-width: 100%;
    display: flex;
    justify-content: center;
}

.mermaid svg {
    max-width: 100% !important;
    height: auto !important;
}

/* ==========================================================================
   KaTeX Mathematical Custom Styling
   ========================================================================== */
.katex-display {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px;
    margin: 8px 0;
    overflow-x: auto;
}

.katex {
    font-size: 0.95em !important;
    color: #ffd8a8; /* soft peach math display */
}

/* Message hover actions styles */
.chat-message.bot:hover .message-actions-bar {
    opacity: 1 !important;
}

.msg-action-btn:hover {
    color: var(--accent-cyan) !important;
}

.msg-action-btn.flag-incorrect-btn:hover {
    color: var(--accent-magenta) !important;
}

/* Interactive Math Graph Styling */
.math-graph-container {
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin: 12px 0;
}

.graph-header {
    background: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
/* Voice typing waveform bounce animation */
@keyframes bounceWave {
    0% {
        transform: scaleY(0.3);
    }
    100% {
        transform: scaleY(1.4);
    }
}

/* Rank Tester Animated Logo Styles */
.brand-logo-svg {
    transition: transform var(--transition-smooth);
}
.brand:hover .brand-logo-svg,
.header-brand:hover .brand-logo-svg {
    animation: logo-float 2.5s ease-in-out infinite;
}

.logo-bar {
    transform-origin: bottom;
    transform-box: fill-box;
    opacity: 0;
    animation: logo-bar-rise 1.0s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.logo-bar-1 { animation-delay: 1.3s; }
.logo-bar-2 { animation-delay: 1.45s; }
.logo-bar-3 { animation-delay: 1.6s; }
.logo-bar-4 { animation-delay: 1.75s; }

.logo-arrow {
    transform-origin: 23px 70px;
    transform-box: view-box;
    opacity: 0;
    animation: logo-arrow-shoot 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 2.1s;
}

.logo-book-page {
    transform-box: view-box;
    opacity: 0;
}

.logo-book-left-1, .logo-book-left-2, .logo-book-left-3 {
    transform-origin: 50px 90px;
    animation: logo-left-page-open 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.logo-book-right-1, .logo-book-right-2, .logo-book-right-3 {
    transform-origin: 50px 90px;
    animation: logo-right-page-open 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.logo-book-left-1, .logo-book-right-1 { animation-delay: 0.1s; }
.logo-book-left-2, .logo-book-right-2 { animation-delay: 0.3s; }
.logo-book-left-3, .logo-book-right-3 { animation-delay: 0.5s; }

@keyframes logo-float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}

@keyframes logo-bar-rise {
    0% { transform: scaleY(0); opacity: 0; }
    100% { transform: scaleY(1); opacity: 1; }
}

@keyframes logo-arrow-shoot {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes logo-left-page-open {
    0% { transform: rotate(35deg); opacity: 0; }
    100% { transform: rotate(0deg); opacity: 1; }
}

@keyframes logo-right-page-open {
    0% { transform: rotate(-35deg); opacity: 0; }
    100% { transform: rotate(0deg); opacity: 1; }
}
