/* ==========================================================================
   VK AIGC Studio — Global Style Sheet (Vanilla CSS)
   Aesthetics: Deep Space Dark Mode, Neon Highlights, Glassmorphism
   ========================================================================== */

/* 1. CSS Variables & Tokens */
:root {
    color-scheme: dark;
    --bg-main: #070913;
    --bg-darker: #04050a;
    --bg-sidebar: rgba(10, 11, 24, 0.7);
    --bg-card: rgba(255, 255, 255, 0.02);
    --border-color: rgba(255, 255, 255, 0.07);
    
    --primary: #8b5cf6;          /* Aurora Violet */
    --primary-glow: rgba(139, 92, 246, 0.35);
    
    --secondary-pink: #d946ef;   /* Cyber Pink */
    --secondary-cyan: #06b6d4;   /* Neon Cyan */
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #475569;
    
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    
    --sidebar-width: 260px;
    --header-height: 80px;
    --glass-blur: blur(20px);
    
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Reset & General Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea {
    font-family: inherit;
    color: inherit;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 3. App Shell Structure */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-brand {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: padding 0.3s ease, justify-content 0.3s ease;
}

.sidebar.collapsed .sidebar-brand {
    padding: 22px 0;
    justify-content: center;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary-pink));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 0 15px var(--primary-glow);
    flex-shrink: 0;
}

.brand-name {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #d8b4fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .brand-name {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
    flex-grow: 1;
}

.sidebar.collapsed .sidebar-nav {
    padding: 10px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
}

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

.nav-item svg {
    opacity: 0.7;
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--text-main);
    background: linear-gradient(to right, rgba(139, 92, 246, 0.15), transparent);
    border-left: 3px solid var(--primary);
    padding-left: 13px; /* balance offset */
}

.sidebar.collapsed .nav-item.active {
    padding-left: 0;
}

.nav-item.active svg {
    color: var(--primary);
    opacity: 1;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    transition: padding 0.3s ease, justify-content 0.3s ease;
}

.sidebar.collapsed .sidebar-footer {
    padding: 15px 0;
    display: flex;
    justify-content: center;
}

.version {
    font-size: 0.8rem;
    color: var(--text-dark);
}

.sidebar.collapsed .version {
    display: none;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.main-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(7, 9, 19, 0.4);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    z-index: 5;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.standalone-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 16px;
}

.standalone-nav .nav-link {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.standalone-nav .nav-link::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
    opacity: 0.6;
    transition: var(--transition);
}

.standalone-nav .nav-link:hover {
    color: var(--text-main);
    background-color: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.standalone-nav .nav-link:hover::before {
    background-color: var(--primary-light);
    opacity: 1;
    box-shadow: 0 0 6px var(--primary-light);
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-toggle-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.page-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.header-right-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.activation-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.key-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    height: 42px;
    width: 280px;
    padding: 0 16px 0 42px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
}

.input-wrapper button {
    height: 42px;
    padding: 0 18px;
    background: var(--primary);
    border: none;
    border-radius: 0 8px 8px 0;
    margin-left: -8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.input-wrapper button:hover {
    background-color: #7c3aed;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.key-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-dark);
}

.key-status-indicator.active .status-dot {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

.key-status-indicator.invalid .status-dot {
    background-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.balance-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 16px;
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.balance-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.balance-unit {
    font-size: 1.1rem;
}

.refresh-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.refresh-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.refresh-btn.spinning svg {
    animation: rotate 1s linear infinite;
}

/* 4. View Viewport */
.content-viewport {
    flex-grow: 1;
    padding: 16px;
    position: relative;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-view {
    display: none;
    height: 100%;
}

.tab-view.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.35s ease-out;
}

/* 5. Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 20px;
}

/* Split Layouts (Control panel Left, Output display Right) */
.split-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    height: 100%;
    align-items: stretch;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-layout.history-collapsed {
    grid-template-columns: 0px 1fr;
    gap: 0;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    height: 100%;
}

.display-panel {
    display: flex;
    flex-direction: column;
    min-width: 0; /* fixes flex grid blowout */
    height: 100%;
    overflow-y: auto;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    border-left: 4px solid var(--primary);
    padding-left: 12px;
    white-space: nowrap;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input[type="text"], 
.form-group textarea {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: var(--transition);
    resize: none;
}

.form-group input[type="text"]:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    background-color: rgba(255, 255, 255, 0.04);
}

.form-help-text {
    font-size: 0.75rem;
    color: var(--text-dark);
}

.select-dropdown-mock {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.select-dropdown-mock::after {
    content: "▼";
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Custom Checkbox Toggle Switches */
.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-label input:checked + .toggle-slider {
    background-color: var(--primary);
}

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

/* Global Select & Option Styling */
select, .admin-select {
    color-scheme: dark;
    background-color: #0b0f19 !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}
select:focus, .admin-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}
select option {
    background-color: #0b0f19 !important;
    color: var(--text-main) !important;
    padding: 10px;
}

/* Buttons */
.primary-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
    transition: var(--transition);
}

/* Small Primary Button overrides to prevent wrapping */
.primary-btn.text-sm {
    width: auto !important;
    height: 38px !important;
    font-size: 0.85rem !important;
    padding: 0 20px !important;
    white-space: nowrap !important;
}

/* Small action buttons for table rows */
.btn-action-sm {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.btn-action-sm:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
}
.btn-action-sm.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}
.btn-action-sm.primary:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    color: #d8b4fe;
}
.btn-action-sm.warning:hover {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--accent-orange);
    color: #fbd5c0;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.primary-btn:active {
    transform: translateY(1px);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.pill-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3px;
    width: 100%;
}

.pill-item {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.pill-item.active {
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.action-link-btn {
    background: transparent;
    border: none;
    color: var(--secondary-pink);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.action-link-btn:hover {
    color: #f472b6;
    text-shadow: 0 0 8px rgba(244, 114, 182, 0.4);
}

/* Quota Info Box */
.quota-info-card {
    background-color: rgba(139, 92, 246, 0.03);
    border: 1px dashed rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    padding: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.quota-info-card span {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 6px;
}

.quota-info-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Drag-Drop Zones */
.file-drag-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: var(--transition);
}

.file-drag-zone:hover {
    border-color: var(--primary);
    background-color: rgba(139, 92, 246, 0.02);
    color: var(--text-main);
}

.selected-file-indicator {
    padding: 8px 12px;
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--accent-green);
    margin-top: 4px;
}

/* ==========================================================================
   6. Module Specific Styles
   ========================================================================== */

/* --- 6.1 CHAT VIEW --- */
/* 历史会话侧边栏 */
.chat-history-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    opacity: 1;
}

.split-layout.history-collapsed .chat-history-sidebar {
    width: 0;
    padding: 0;
    opacity: 0;
    border: none;
    pointer-events: none;
    overflow: hidden;
}

.new-chat-btn {
    width: 100%;
    height: 38px;
    background: transparent;
    border: 1px dashed var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.new-chat-btn:hover {
    background-color: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.history-list-title {
    font-size: 0.72rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 600;
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid transparent;
    transition: var(--transition);
}

.history-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.history-item-content svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.history-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
}

.history-item.active {
    background-color: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.15);
}

.history-item.active .history-item-content {
    color: var(--text-main);
}

.history-item.active .history-item-content svg {
    color: var(--primary);
    opacity: 1;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: var(--transition);
}

.history-item:hover .history-actions,
.history-item.active .history-actions {
    opacity: 1;
}

.history-item.starred .history-actions {
    opacity: 1;
}

.history-actions button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-star-btn {
    color: var(--text-muted);
}
.history-item.starred .history-star-btn {
    color: #eab308;
    text-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
}
.history-star-btn:hover {
    color: #facc15 !important;
}

.history-rename-btn {
    color: var(--text-muted);
    opacity: 0.7;
}
.history-rename-btn:hover {
    color: var(--primary) !important;
    opacity: 1;
}

.history-delete-btn {
    color: var(--text-muted);
    opacity: 0.7;
}
.history-delete-btn:hover {
    color: var(--accent-red) !important;
    opacity: 1;
}

/* 聊天面板头部 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.history-toggle-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.chat-header-title {
    font-size: 0.92rem;
    font-weight: 600;
}

.chat-header-configs {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mini-model-select {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
}

.mini-model-select:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.04);
}

.mini-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.mini-toggle input {
    display: none;
}

.mini-toggle-slider {
    position: relative;
    width: 30px;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: var(--transition);
}

.mini-toggle-slider::before {
    content: "";
    position: absolute;
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
}

.mini-toggle input:checked + .mini-toggle-slider {
    background-color: var(--primary);
}

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

.chat-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.chat-messages {
    flex-grow: 1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.message.assistant {
    align-self: flex-start;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--secondary-cyan));
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--secondary-pink), #ec4899);
    box-shadow: 0 0 8px rgba(217, 70, 239, 0.3);
}

.message-content {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.message.assistant .message-content {
    border-top-left-radius: 2px;
}

.message.user .message-content {
    background-color: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
    border-top-right-radius: 2px;
}

/* Thinking Box in Chat */
.thinking-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-left: 2px solid var(--text-dark);
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.thinking-title {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.thinking-title::before {
    content: "▶";
    font-size: 0.55rem;
    transition: var(--transition);
}

.thinking-box.expanded .thinking-title::before {
    transform: rotate(90deg);
}

.thinking-content {
    display: none;
    margin-top: 6px;
    line-height: 1.4;
    white-space: pre-wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 6px;
    color: #64748b;
}

.thinking-box.expanded .thinking-content {
    display: block;
}

.chat-input-area {
    padding: 14px 20px 20px 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(7, 9, 19, 0.3);
}

.preview-files-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.preview-file-card {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-file-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-file-card .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.input-box-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px 12px;
}

.input-box-wrapper textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    color: var(--text-main);
    line-height: 1.5;
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background-color: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: var(--transition);
}

.send-btn:hover {
    background-color: #7c3aed;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* --- 6.2 MUSIC VIEW --- */
.sub-tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    flex-shrink: 0;
}

.sub-tab-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-tab-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.03);
}

.sub-tab-item.active {
    color: var(--primary);
    background-color: rgba(139, 92, 246, 0.08);
    font-weight: 600;
}

.music-sub-view {
    display: none;
    flex-grow: 1;
    overflow: hidden;
    min-height: 0;
}

.music-sub-view.active {
    display: flex;
    flex-direction: column;
}

.music-creation-panel, .music-library-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
}

.creation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.creation-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex-grow: 1;
    min-height: 0;
}

.creation-style-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
    box-sizing: border-box;
}

/* Custom sleek scrollbar for creation-style-col */
.creation-style-col::-webkit-scrollbar {
    width: 6px;
}
.creation-style-col::-webkit-scrollbar-track {
    background: transparent;
}
.creation-style-col::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}
.creation-style-col::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.creation-lyrics-col {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.creation-lyrics-col .form-group {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.creation-lyrics-col textarea {
    flex-grow: 1;
    min-height: 200px;
    font-family: inherit;
}

.creation-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.music-library-panel .music-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}
.tag-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    max-height: 260px;
    overflow-y: auto;
}

/* Custom sleek scrollbar for tag-categories */
.tag-categories::-webkit-scrollbar {
    width: 6px;
}
.tag-categories::-webkit-scrollbar-track {
    background: transparent;
}
.tag-categories::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}
.tag-categories::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tag-category {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.category-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 44px;
    text-align: right;
    border-right: 1px solid var(--border-color);
    padding-right: 10px;
    margin-top: 4px;
    flex-shrink: 0;
    height: 16px;
    line-height: 16px;
}

.tag-category .tag-pool {
    margin-top: 0;
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.style-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.style-tag:hover, .style-tag.active {
    color: var(--primary);
    border-color: var(--primary);
    background-color: rgba(139, 92, 246, 0.05);
}

.music-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
    overflow-y: auto;
}

.music-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.music-card:hover {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.12);
}

.music-card.active {
    background-color: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.25);
}

.track-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.card-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1.4;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.track-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    flex-shrink: 0;
    align-items: center;
}

.play-small-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    cursor: pointer;
}

.cover-quick-btn {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    color: var(--secondary-pink);
    cursor: pointer;
}

.track-time {
    font-size: 0.8rem;
    color: var(--text-dark);
    margin-top: 3px;
}

/* Generating music card state */
.music-card.generating {
    border-style: dashed;
    border-color: rgba(217, 70, 239, 0.4);
    background-color: rgba(217, 70, 239, 0.01);
}

.disc-animation {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.disc {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px double rgba(217, 70, 239, 0.5);
    animation: rotate 3s linear infinite;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar-fill {
    height: 100%;
    width: 45%; /* mock */
    background: linear-gradient(to right, var(--primary), var(--secondary-pink));
    border-radius: 2px;
}

/* Mini Player at bottom (Global Dock) */
.mini-player {
    min-height: 80px;
    padding: 12px 28px;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(20, 22, 45, 0.92), rgba(10, 11, 25, 0.96));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 16px 16px 16px;
    flex-shrink: 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.08);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-info:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.player-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.player-tag {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
    justify-content: center;
    max-width: 500px;
    padding: 0 20px;
}

.ctrl-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary-pink, #d946ef));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ctrl-btn:hover {
    transform: scale(1.1) translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #7c3aed, #c084fc);
}

.player-progress-bar {
    height: 6px;
    flex-grow: 1;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-progress-bar::before {
    content: "";
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: 0;
    right: 0;
    z-index: 5;
}

.player-progress-bar:hover {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.15);
}

.player-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary-pink, #d946ef));
    border-radius: 3px;
    position: relative;
}

.player-progress-fill::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8), 0 2px 4px rgba(0,0,0,0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 6;
}

.player-progress-bar:hover .player-progress-fill::after {
    transform: translateY(-50%) scale(1.1);
}

.player-duration {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.download-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}


/* --- 6.3 IMAGE VIEW --- */
.style-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.style-preset-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.style-preset-badge:hover, .style-preset-badge.active {
    color: var(--secondary-pink);
    border-color: var(--secondary-pink);
    background-color: rgba(217, 70, 239, 0.05);
}

.ratio-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.ratio-btn {
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.ratio-btn:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.ratio-btn.active {
    border-color: var(--primary);
    background-color: rgba(139, 92, 246, 0.05);
    color: var(--text-main);
}

.ratio-box {
    border: 2px solid var(--text-muted);
    border-radius: 3px;
    background: transparent;
    opacity: 0.7;
}

.ratio-btn.active .ratio-box {
    border-color: var(--primary);
    opacity: 1;
}

.r-1-1 { width: 20px; height: 20px; }
.r-16-9 { width: 28px; height: 16px; }
.r-9-16 { width: 16px; height: 28px; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover img {
    transform: scale(1.05);
}

.gallery-card-hover {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    padding-bottom: 20px;
    transition: var(--transition);
}

.gallery-card:hover .gallery-card-hover {
    opacity: 1;
}

.gallery-action-btn {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.gallery-action-btn:hover {
    background-color: white;
    color: black;
}

/* --- 6.4 VIDEO VIEW --- */
.camera-joystick-panel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.02);
    border: 2px solid var(--border-color);
    position: relative;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-center-dot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-cyan), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.cam-btn {
    position: absolute;
    background: transparent;
    border: none;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 6px 10px;
    border-radius: 4px;
}

.cam-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.cam-btn.active {
    color: var(--secondary-cyan);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.btn-up { top: 12px; }
.btn-down { bottom: 12px; }
.btn-left { left: 12px; }
.btn-right { right: 12px; }
.btn-zoom-in { top: 40px; right: 40px; }
.btn-zoom-out { bottom: 40px; left: 40px; }

.joystick-value-indicator {
    text-align: center;
    font-size: 0.75rem;
    color: var(--secondary-cyan);
    margin-top: 8px;
    font-weight: 500;
}

.duration-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.duration-selector .ratio-btn {
    flex-direction: row;
    justify-content: space-between;
}

.video-queue {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-grow: 1;
    text-align: center;
    padding: 40px;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 300px;
    line-height: 1.5;
}

.video-task-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.task-id {
    font-weight: 600;
    color: var(--text-muted);
}

.task-status {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-status.processing {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--secondary-cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.task-status.completed {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.task-status.failed {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.task-prompt {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-main);
}

.video-output-wrapper {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border-color);
}

.video-output-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- 6.5 QUERY VIEW --- */
.single-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
}

.query-search-row {
    display: flex;
    gap: 16px;
    width: 100%;
}

.query-search-row input {
    flex-grow: 1;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 20px;
    font-size: 1rem;
}

.query-search-row input:focus {
    border-color: var(--primary);
}

.query-search-row button {
    width: 140px;
}

.query-results-summary {
    animation: fadeIn 0.4s ease-out;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-val {
    font-size: 1.4rem;
    font-weight: 700;
}

.stat-val.status-green {
    color: var(--accent-green);
}

.text-sm {
    font-size: 0.95rem;
    font-weight: 500;
}

.query-logs-table-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.01);
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.logs-table th, .logs-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.logs-table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-muted);
}

.logs-table tr:last-child td {
    border-bottom: none;
}

.table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.amount-red {
    color: var(--accent-red);
    font-weight: 600;
}

.amount-green {
    color: var(--accent-green);
    font-weight: 600;
}

/* ==========================================================================
   7. Modals / Backdrop
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(4, 5, 10, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease-out;
}

.modal-content-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.modal-content-wrapper img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-info-panel {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 24px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.modal-info-panel p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   8. Keyframes & Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

/* ==========================================================================
   9. AI Image Expanded Layout & Dropdown Aspect Ratio Selector
   ========================================================================== */
.split-layout.image-split-layout {
    grid-template-columns: 1fr 1fr;
}

.custom-dropdown {
    position: relative;
    width: 100%;
    user-select: none;
}

.dropdown-trigger {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.04);
}

.custom-dropdown.open .dropdown-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.dropdown-arrow {
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background-color: rgba(22, 25, 48, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    padding: 6px;
    animation: slideDownMenu 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-option:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-option.active {
    color: var(--primary);
    background-color: rgba(139, 92, 246, 0.08);
    font-weight: 600;
}

/* Ratio Indicator Icons */
.ratio-indicator-box {
    width: 16px;
    height: 16px;
    border: 1px solid currentColor;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    opacity: 0.85;
    flex-shrink: 0;
}

.auto-box {
    border-style: dashed;
}

.r-1-1 {
    width: 14px;
    height: 14px;
}

.r-16-9 {
    width: 18px;
    height: 10px;
}

.r-9-16 {
    width: 10px;
    height: 18px;
}

.r-3-2 {
    width: 16px;
    height: 11px;
}

.r-2-3 {
    width: 11px;
    height: 16px;
}

.r-21-9 {
    width: 20px;
    height: 9px;
}

.r-4-3 {
    width: 16px;
    height: 12px;
}

.r-3-4 {
    width: 12px;
    height: 16px;
}

.custom-box {
    border: none;
    font-size: 10px;
}

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

.split-layout.video-split-layout {
    grid-template-columns: 1fr 1fr;
}

/* Standalone Pages Brand Styles */
.standalone-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
}

/* Animated Equalizer Visualizer & Card Styling Improvements */
.playing-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 18px;
    height: 18px;
}
.playing-equalizer span {
    width: 3px;
    background-color: #fff;
    border-radius: 1px;
    animation: eq-bar 0.8s ease-in-out infinite alternate;
}
.playing-equalizer span:nth-child(1) { height: 30%; animation-delay: 0.1s; }
.playing-equalizer span:nth-child(2) { height: 60%; animation-delay: 0.3s; }
.playing-equalizer span:nth-child(3) { height: 90%; animation-delay: 0s; }

@keyframes eq-bar {
    0% { height: 20%; }
    100% { height: 100%; }
}

.music-card {
    position: relative;
    overflow: hidden;
}

.music-card.active {
    background-color: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.12);
}

.music-card.playing {
    border-color: rgba(217, 70, 239, 0.4);
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.15);
}

.play-small-btn {
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.play-small-btn:hover {
    transform: scale(1.15);
    background-color: #a78bfa;
}

.cover-quick-btn {
    transition: color 0.2s ease, transform 0.2s ease;
}
.cover-quick-btn:hover {
    color: #f472b6;
    text-decoration: underline;
}

.view-prompt-btn, .view-lyrics-btn, .rename-track-btn {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-prompt-btn:hover {
    color: var(--primary);
    background-color: rgba(139, 92, 246, 0.08);
}

.view-lyrics-btn:hover {
    color: var(--secondary-pink);
    background-color: rgba(217, 70, 239, 0.08);
}

.rename-track-btn:hover {
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.08);
}

/* ==========================================================================
   Activation Bar Input Wrapper Optimization
   ========================================================================== */
.activation-bar .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
    overflow: hidden;
}

.activation-bar .input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
}

.activation-bar .input-wrapper .key-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.activation-bar .input-wrapper input {
    height: 40px; /* 42px parent height - 2px borders */
    width: 280px;
    padding: 0 16px 0 42px;
    background-color: transparent !important;
    border: none !important;
    border-radius: 8px 0 0 8px !important;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none !important;
    box-shadow: none !important;
}

.activation-bar .input-wrapper button {
    height: 40px;
    padding: 0 18px;
    background: var(--primary);
    border: none;
    border-radius: 0;
    margin-left: 0 !important;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

/* ==========================================================================
   Global Floating AI Assistant Widget
   ========================================================================== */
#global-ai-assistant-fab {
    position: fixed;
    bottom: 95px; /* Above the mini-player bar which is 80px high */
    right: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary-pink, #d946ef));
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 99999;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
    user-select: none;
}

#global-ai-assistant-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.5), 0 0 12px rgba(217, 70, 239, 0.3);
}

#global-ai-assistant-fab:active {
    transform: scale(0.95);
}

#global-ai-assistant-fab .fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.68rem;
    background: #ef4444;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    animation: bounce 2.5s infinite;
}

#global-ai-assistant-panel {
    position: fixed;
    bottom: 160px; /* Above the FAB */
    right: 24px;
    width: 360px;
    height: 480px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(20, 22, 45, 0.95), rgba(10, 11, 25, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 92, 246, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 99998;
    overflow: hidden;
    backdrop-filter: blur(15px);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.1, 0.8, 0.2, 1);
    transform-origin: bottom right;
}

#global-ai-assistant-panel .assistant-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

#global-ai-assistant-panel .assistant-header .header-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
}

#global-ai-assistant-panel .assistant-header .assistant-spark {
    color: #c084fc;
    animation: pulse 2s infinite;
}

#global-ai-assistant-panel .assistant-header #assistant-minimize-btn {
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
    padding: 0 4px;
}

#global-ai-assistant-panel .assistant-header #assistant-minimize-btn:hover {
    color: white;
}

#global-ai-assistant-panel .assistant-chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.15);
}

#global-ai-assistant-panel .assistant-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
}

#global-ai-assistant-panel .assistant-msg.assistant {
    align-self: flex-start;
}

#global-ai-assistant-panel .assistant-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

#global-ai-assistant-panel .assistant-msg .msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    color: white;
    font-size: 0.72rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#global-ai-assistant-panel .assistant-msg.user .msg-avatar {
    background: linear-gradient(135deg, #f472b6, #db2777);
}

#global-ai-assistant-panel .assistant-msg .msg-content {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-all;
    white-space: pre-wrap;
}

#global-ai-assistant-panel .assistant-msg.assistant .msg-content {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.95);
}

#global-ai-assistant-panel .assistant-msg.user .msg-content {
    background-color: var(--primary);
    color: white;
}

#global-ai-assistant-panel .assistant-msg .msg-content code {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    color: #e9d5ff;
}

#global-ai-assistant-panel .assistant-msg .msg-content pre {
    background-color: rgba(0, 0, 0, 0.35);
    padding: 8px 10px;
    border-radius: 6px;
    font-family: monospace;
    color: #e9d5ff;
    display: block;
    margin: 6px 0;
    overflow-x: auto;
}

#global-ai-assistant-panel .assistant-input-area {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.01);
    align-items: flex-end;
}

#global-ai-assistant-panel #assistant-textarea {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    color: white;
    padding: 8px 10px;
    font-size: 0.82rem;
    resize: none;
    height: 34px;
    max-height: 80px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
    line-height: 1.35;
}

#global-ai-assistant-panel #assistant-textarea:focus {
    border-color: var(--primary);
}

#global-ai-assistant-panel #assistant-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s, transform 0.1s;
}

#global-ai-assistant-panel #assistant-send-btn:hover {
    background-color: #7c3aed;
}

#global-ai-assistant-panel #assistant-send-btn:active {
    transform: scale(0.95);
}

#global-ai-assistant-panel #assistant-send-btn:disabled {
    background-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

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

/* ==========================================================================
   Music Player Details Overlay & Lyric sync scrolling
   ========================================================================== */
.player-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 7, 20, 0.88);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10005;
    animation: detailsFadeIn 0.3s ease-out;
}

@keyframes detailsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.player-details-container {
    width: 900px;
    height: 580px;
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(20, 22, 45, 0.95), rgba(10, 11, 25, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.2);
    position: relative;
    display: flex;
    overflow: hidden;
    animation: detailsSlideUp 0.35s cubic-bezier(0.1, 0.8, 0.2, 1);
}

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

.player-details-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.player-details-close:hover {
    color: white;
    transform: rotate(90deg);
}

.player-details-left {
    width: 45%;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    position: relative;
}

.vinyl-wrapper {
    position: relative;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.vinyl-arm {
    position: absolute;
    top: -10px;
    right: 10px;
    width: 80px;
    height: 120px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 120' fill='none'%3E%3Cpath d='M60 10 L60 40 L20 90 L25 95 L65 42 L65 10' stroke='rgba%28200,200,200,0.85%29' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='60' cy='10' r='8' fill='gray'/%3E%3Crect x='15' y='90' width='12' height='20' rx='2' fill='darkgray' transform='rotate%2815, 20, 100%29'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transform-origin: 60px 10px;
    transform: rotate(-25deg);
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 3;
    pointer-events: none;
}

.vinyl-arm.playing {
    transform: rotate(3deg);
}

.vinyl-record {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, #2c2c2c 4%, #111 5%, #111 25%, #050505 26%, #1c1c1c 38%, #070707 39%, #151515 50%, #0a0a0a 51%, #111111 65%, #020202 66%, #0d0d0d 85%, #000 86%);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.vinyl-disc-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.03) 40deg,
        transparent 80deg,
        transparent 180deg,
        rgba(255, 255, 255, 0.03) 220deg,
        transparent 260deg,
        transparent 360deg
    );
    z-index: 1;
    pointer-events: none;
}

.vinyl-record.spinning {
    animation: spinRecord 12s linear infinite;
}

@keyframes spinRecord {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.vinyl-center-cover {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary-pink, #d946ef));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    border: 3px solid #000;
    user-select: none;
    z-index: 2;
    overflow: hidden;
}

.vinyl-center-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-details-meta {
    text-align: center;
    max-width: 100%;
}

.player-details-meta h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: white;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-tags {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.player-details-right {
    width: 55%;
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.15);
}

.lyrics-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.lyrics-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.lyrics-container {
    flex-grow: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 160px 0;
    box-sizing: border-box;
    position: relative;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.2) 10%,
        rgba(0, 0, 0, 1) 35%,
        rgba(0, 0, 0, 1) 65%,
        rgba(0, 0, 0, 0.2) 90%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.2) 10%,
        rgba(0, 0, 0, 1) 35%,
        rgba(0, 0, 0, 1) 65%,
        rgba(0, 0, 0, 0.2) 90%,
        transparent 100%
    );
}

.lyrics-container::-webkit-scrollbar {
    display: none;
}
.lyrics-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.lyrics-line {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    margin: 16px 0;
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: scale(0.95);
    user-select: none;
}

.lyrics-line.active {
    font-size: 1.35rem;
    font-weight: 600;
    color: #a78bfa;
    transform: scale(1.05);
    text-shadow: 0 0 16px rgba(167, 139, 250, 0.45);
}

.lyrics-line.header-tag {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    padding: 2px 8px;
    display: inline-block;
    margin: 20px auto 10px auto;
    width: fit-content;
    display: flex;
    justify-content: center;
}

/* Details Player Controls */
.details-player-controls {
    width: 100%;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.details-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transition: all 0.2s ease;
}

.details-play-btn:hover {
    transform: scale(1.08);
    background: #7c3aed;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.6);
}

.details-play-btn svg {
    width: 20px;
    height: 20px;
}

.details-progress-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    user-select: none;
}

.details-slider-container {
    flex-grow: 1;
    height: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.details-slider-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    position: relative;
    transition: background 0.2s;
}

.details-slider-container:hover .details-slider-track {
    background: rgba(255, 255, 255, 0.25);
}

.details-slider-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary-pink, #d946ef));
    border-radius: 2px;
    position: absolute;
    left: 0;
    top: 0;
    width: 0%;
}

.details-slider-thumb {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s;
    pointer-events: none;
}

.details-slider-container:hover .details-slider-thumb {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Hide bottom nav on desktop */
.mobile-bottom-nav {
    display: none;
}

/* ==========================================================================
   Mobile Responsive Styles (H5 Upgrade)
   ========================================================================== */
@media (max-width: 768px) {
    /* Shell Structure */
    .sidebar {
        display: none !important;
    }
    
    .sidebar-toggle-btn {
        display: none !important;
    }
    
    .main-content {
        width: 100vw !important;
        height: 100vh;
    }
    
    .content-viewport {
        padding: 10px 10px 80px 10px !important; /* Bottom padding to avoid player overlap */
        height: calc(100vh - var(--header-height) - 60px) !important;
    }

    /* Header Adjustments */
    .main-header {
        padding: 0 12px !important;
    }
    
    .header-right-controls {
        gap: 10px !important;
    }
    
    .activation-bar .input-wrapper {
        display: none !important; /* Hide key input box on mobile header */
    }

    /* Mobile Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(180deg, rgba(15, 17, 35, 0.95), rgba(7, 9, 20, 0.98));
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding: 0 8px;
        box-sizing: border-box;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
    }
    
    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 500;
        padding: 6px 0;
        cursor: pointer;
        flex: 1;
        height: 100%;
        border-left: none !important; /* Overrides desktop active border */
        border-radius: 0;
        transition: all 0.2s ease;
    }
    
    .mobile-bottom-nav .nav-item svg {
        width: 20px;
        height: 20px;
        opacity: 0.7;
        transition: all 0.2s ease;
    }
    
    .mobile-bottom-nav .nav-item.active {
        color: var(--primary-light, #c084fc) !important;
        background: transparent !important;
    }
    
    .mobile-bottom-nav .nav-item.active svg {
        color: var(--primary-light, #c084fc) !important;
        opacity: 1;
        filter: drop-shadow(0 0 5px var(--primary-glow));
    }

    /* Global Floating Mini Player */
    .mini-player {
        position: fixed !important;
        bottom: 68px !important;
        left: 10px !important;
        right: 10px !important;
        z-index: 999 !important;
        margin: 0 !important;
        min-height: 68px !important;
        padding: 8px 16px !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.15) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .mini-player .player-info {
        max-width: 120px;
    }
    
    .mini-player .player-title {
        font-size: 0.85rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mini-player .player-controls {
        flex-grow: 1;
        margin: 0 10px !important;
        gap: 6px !important;
    }
    
    .mini-player .player-duration {
        font-size: 0.68rem !important;
    }
    
    .mini-player .download-btn {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
    }

    /* Chat Tab Drawer Layout */
    #chat-split-layout {
        position: relative !important;
        height: 100% !important;
        overflow: hidden !important;
        display: block !important;
    }
    
    #chat-split-layout .chat-history-sidebar {
        position: absolute !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 280px !important;
        z-index: 100 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
        opacity: 0;
        pointer-events: none;
        border-radius: 0 12px 12px 0 !important;
        border-right: 1px solid var(--border-color) !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5) !important;
    }
    
    #chat-split-layout:not(.history-collapsed) .chat-history-sidebar {
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    #chat-split-layout .chat-panel {
        width: 100% !important;
        height: 100% !important;
        border-radius: 8px !important;
    }
    
    .drawer-backdrop {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 99;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    #chat-split-layout:not(.history-collapsed) .drawer-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    /* Split Grid Stacked Layouts */
    .split-layout.image-split-layout,
    .split-layout.video-split-layout {
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        height: 100% !important;
        gap: 16px;
    }
    
    .split-layout.image-split-layout .control-panel,
    .split-layout.image-split-layout .display-panel,
    .split-layout.video-split-layout .control-panel,
    .split-layout.video-split-layout .display-panel {
        height: auto !important;
        overflow-y: visible !important;
        flex-shrink: 0;
    }
    
    .creation-grid-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Floating FAB Assistant Widget */
    #global-ai-assistant-fab {
        bottom: 146px !important; /* Above bottom-nav (60px) + mini-player (68px) + space */
        right: 16px !important;
        width: 48px !important;
        height: 48px !important;
    }

    /* Key Status & Model Name Overrides */
    .key-status-indicator .status-text {
        display: none !important;
    }
    
    .key-status-indicator {
        padding: 6px !important;
        border-radius: 50% !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        background-color: rgba(255, 255, 255, 0.04) !important;
    }
    
    .mini-model-select {
        display: none !important;
    }

    /* Query Page Responsive Overrides */
    .query-search-row {
        gap: 8px !important;
    }
    .query-search-row input {
        padding: 0 12px !important;
        font-size: 0.9rem !important;
        height: 44px !important;
    }
    .query-search-row button {
        width: auto !important;
        padding: 0 16px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        height: 44px !important;
        font-size: 0.9rem !important;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .stat-card {
        padding: 12px 16px !important;
        gap: 4px !important;
    }
    .stat-val {
        font-size: 1.15rem !important;
    }
    
    .query-logs-table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .logs-table {
        min-width: 600px !important;
    }
    .logs-table th, .logs-table td {
        padding: 10px 12px !important;
        font-size: 0.82rem !important;
        white-space: nowrap !important;
    }

    /* Global Floating AI Assistant Mobile Styles */
    #global-ai-assistant-panel {
        width: calc(100% - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        bottom: 72px !important; /* Positioned above the mobile bottom nav bar (60px) + 12px space */
        top: auto !important;
        height: 420px !important;
        max-height: calc(100dvh - 140px) !important; /* Shrink dynamically when virtual keyboard opens */
        max-height: calc(100vh - 140px) !important; /* Fallback */
        border-radius: 12px !important;
        transform-origin: bottom center !important;
    }

    #global-ai-assistant-panel .assistant-header {
        cursor: default !important; /* Disable move cursor on mobile */
    }

    #global-ai-assistant-panel .assistant-msg {
        max-width: 90% !important; /* More space for message bubbles on small screens */
    }
}

/* Global Drawer Backdrop Layout fix */
.drawer-backdrop {
    display: none;
}

/* Sidebar Brand anchor styling */
a.sidebar-brand {
    text-decoration: none;
    color: inherit;
}

/* Premium Header Home Link styling */
.header-home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s, background-color 0.2s;
    margin-right: 12px;
    padding: 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.header-home-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.header-home-link svg {
    width: 16px;
    height: 16px;
}



