/* ==========================================================================
   Design Tokens & Root Setup
   ========================================================================== */
:root {
    /* Color Palette - Default (Dark) */
    --bg-primary: #0a0c10;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-surface-hover: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    
    --text-primary: #ffffff;
    --text-secondary: #8a8f98;
    --text-tertiary: #525866;
    
    /* Background Elements */
    --bg-header: rgba(10, 12, 16, 0.6);
    --bg-modal: rgba(20, 24, 33, 0.95);
    --bg-input: rgba(255, 255, 255, 0.03);
    
    /* Brand Accents */
    --accent-purple: #833ab4;
    --accent-indigo: #5d5fef;
    --accent-gradient: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    --purple-glow: rgba(131, 58, 180, 0.15);
    
    /* Core Action Colors */
    --color-blue: #007aff;
    --color-red: #ff3b30;
    --color-purple: #af52de;
    --color-green: #34c759;
    
    /* Fonts & Easing */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ease-3d: cubic-bezier(0.25, 0.8, 0.25, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
body.light-theme {
    --bg-primary: #f5f6f8;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-surface-hover: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.09);
    --border-highlight: rgba(255, 255, 255, 0.95);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    --bg-header: rgba(245, 246, 248, 0.65);
    --bg-modal: rgba(255, 255, 255, 0.96);
    --bg-input: rgba(0, 0, 0, 0.04);
    
    --purple-glow: rgba(131, 58, 180, 0.06);
}

/* ==========================================================================
   Reset & Document Settings
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   Animated Mesh Glows
   ========================================================================== */
.mesh-glow {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
    mix-blend-mode: screen;
}

.mesh-glow-1 {
    background: radial-gradient(circle, var(--accent-purple) 0%, rgba(0,0,0,0) 70%);
    top: -20%;
    left: -10%;
    animation: drift 25s infinite alternate ease-in-out;
}

.mesh-glow-2 {
    background: radial-gradient(circle, var(--accent-indigo) 0%, rgba(0,0,0,0) 70%);
    bottom: -20%;
    right: -10%;
    animation: drift 30s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 8vh) scale(1.1); }
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.main-header {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
    margin: 0 -24px 32px -24px;
    padding: 0 48px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    height: 32px;
    object-fit: contain;
}

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

/* Theme Toggle Button */
.btn-theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.1),
        inset 0 1px 0 var(--border-highlight);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s var(--ease-3d);
}

.btn-theme-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    transform: translateY(-1.5px) scale(1.05);
}

.theme-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.btn-theme-toggle:active .theme-icon {
    transform: rotate(20deg) scale(0.9);
}

/* Usage Ring Styles */
.usage-container {
    cursor: default;
    user-select: none;
}

.usage-ring-wrapper {
    position: relative;
    width: 38px;
    height: 38px;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.15),
        inset 0 1px 0 var(--border-highlight);
    border: 1px solid var(--border-color);
}

.usage-ring-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.usage-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 3.5;
}

.usage-ring-bar {
    fill: none;
    stroke: url(#accent-grad-ring); /* Fallback to stroke color in JS if URL gradient fails */
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s var(--ease-out);
}

/* Fallback stroke for rings */
.usage-ring-bar {
    stroke: #833ab4;
}

.usage-text {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-primary);
    z-index: 1;
}

.usage-text.infinite {
    font-size: 18px;
    line-height: 1;
    margin-top: -3px;
}

/* ==========================================================================
   Buttons (3D Treatment)
   ========================================================================== */
.btn {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s var(--ease-3d);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:focus {
    outline: none;
}

.btn:focus-visible {
    outline: 2px solid rgba(131, 58, 180, 0.5);
    outline-offset: 2px;
}

.btn-auth {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 var(--border-highlight);
}

.btn-auth:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-highlight);
    transform: translateY(-1.5px);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 
        0 6px 18px rgba(131, 58, 180, 0.35),
        inset 0 1.5px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 3px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 24px rgba(131, 58, 180, 0.45),
        inset 0 1.5px 0 rgba(255, 255, 255, 0.55),
        inset 0 -2px 3px rgba(0, 0, 0, 0.25);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Profile Dropdown
   ========================================================================== */
.profile-dropdown-wrapper {
    position: relative;
}

.profile-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1.5px 2px rgba(0, 0, 0, 0.25);
    transition: all 0.2s var(--ease-3d);
}

.profile-avatar-btn:hover {
    transform: translateY(-1.5px) scale(1.03);
}

.avatar-fallback {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: 50px;
    width: 220px;
    background: var(--bg-modal);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.25),
        inset 0 1px 0 var(--border-highlight);
    padding: 8px;
    display: none;
    transform-origin: top right;
    animation: scaleIn 0.2s var(--ease-out);
    z-index: 1000;
}

.profile-dropdown.show {
    display: block;
}

.dropdown-header {
    padding: 12px 14px;
}

.dropdown-email {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    background: var(--accent-gradient);
    padding: 2px 8px;
    border-radius: 8px;
    margin-top: 6px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

.dropdown-item {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 14px;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.dropdown-item.text-danger {
    color: #ff453a;
}

.dropdown-item.text-danger:hover {
    background: rgba(255, 69, 58, 0.08);
}

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

/* ==========================================================================
   Hero & Intro Elements
   ========================================================================== */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -1.5px;
    background: linear-gradient(180deg, #ffffff 0%, #a2a8b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================================================
   Interactive Dropzone
   ========================================================================== */
.dropzone-section {
    margin-bottom: 48px;
    display: flex;
    justify-content: center;
}

.dropzone {
    width: 100%;
    max-width: 680px;
    height: 280px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 28px;
    border: 1px dashed var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s var(--ease-3d);
}

.dropzone-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-purple) 0%, rgba(0,0,0,0) 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.dropzone:hover {
    border-color: var(--border-highlight);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.dropzone:hover .dropzone-glow {
    opacity: 0.6;
}

.dropzone.dragover {
    border-color: var(--accent-indigo);
    background: rgba(93, 95, 239, 0.08);
    box-shadow: 
        0 0 40px rgba(93, 95, 239, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.dropzone.dragover .upload-icon {
    transform: translateY(-6px) scale(1.1);
    color: var(--accent-indigo);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.icon-container-3d {
    position: relative;
    margin-bottom: 20px;
    width: 64px;
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-circle-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-gradient);
    opacity: 0.18;
    filter: blur(10px);
}

.dropzone-3d-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s var(--ease-3d);
}

.dropzone:hover .dropzone-3d-img {
    transform: scale(1.08) translateY(-2px);
}

.dropzone-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.dropzone-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.supported-formats {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.file-input {
    display: none;
}

/* ==========================================================================
   Presets Grid (3D Treatment)
   ========================================================================== */
.actions-grid-section {
    margin-bottom: 56px;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.preset-card {
    position: relative;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    padding: 24px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 
        0 10px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.35s var(--ease-3d);
}

.card-glow {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
    z-index: 1;
}

.preset-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 16px 36px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: var(--border-highlight);
}

.preset-card:hover .card-glow {
    opacity: 0.15;
}

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

.card-icon-container {
    width: 46px;
    height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s var(--ease-out);
}

.card-icon-3d {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.15));
    transition: transform 0.2s var(--ease-3d);
}

.preset-card:hover .card-icon-3d {
    transform: scale(1.08) translateY(-2px);
}

.card-text h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.card-text p {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Card Accent Varieties */
.card-blue .card-glow {
    background: var(--color-blue);
    right: -40px;
    bottom: -40px;
}

.card-red .card-glow {
    background: var(--color-red);
    right: -40px;
    bottom: -40px;
}

.card-purple .card-glow {
    background: var(--color-purple);
    right: -40px;
    bottom: -40px;
}

.card-green .card-glow {
    background: var(--color-green);
    right: -40px;
    bottom: -40px;
}

/* ==========================================================================
   Active File List
   ========================================================================== */
.files-section {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    animation: fadeIn 0.4s var(--ease-out);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-wrapper h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-stats {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-row {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 
        0 4px 14px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: slideUp 0.3s var(--ease-out);
}

.file-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.file-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.file-icon-box svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.file-details {
    min-width: 0;
}

.file-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.file-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.format-flow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

body.light-theme .format-flow {
    background: rgba(0, 0, 0, 0.02);
}

.format-badge {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.flow-arrow-svg {
    width: 10px;
    height: 10px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.format-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.format-select {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    border: none;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 18px 1px 6px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.15s ease;
}

.format-select:hover {
    background: rgba(139, 92, 246, 0.2);
}

.format-select-wrapper::after {
    content: "▼";
    font-size: 6px;
    color: var(--accent-purple);
    position: absolute;
    right: 6px;
    pointer-events: none;
}

/* Category Colors for File Icon Boxes */
.file-icon-box.category-image {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.2);
}
.file-icon-box.category-image svg { color: #a855f7; }

.file-icon-box.category-video {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}
.file-icon-box.category-video svg { color: #6366f1; }

.file-icon-box.category-audio {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}
.file-icon-box.category-audio svg { color: #3b82f6; }

.file-icon-box.category-document {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}
.file-icon-box.category-document svg { color: #22c55e; }

.file-icon-box.category-ebook {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.2);
}
.file-icon-box.category-ebook svg { color: #f97316; }

.file-icon-box.category-archive {
    background: rgba(120, 113, 108, 0.1);
    border-color: rgba(120, 113, 108, 0.2);
}
.file-icon-box.category-archive svg { color: #78716c; }

.file-icon-box.category-spreadsheet {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.2);
}
.file-icon-box.category-spreadsheet svg { color: #14b8a6; }

.file-icon-box.category-presentation {
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.2);
}
.file-icon-box.category-presentation svg { color: #ec4899; }

/* Progress bar inside file details */
.conversion-progress-container {
    margin-top: 8px;
    width: 100%;
    min-width: 240px;
    max-width: 320px;
}

.progress-bar-bg {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.2s ease;
}

.progress-stage {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Error message styling */
.conversion-error-msg {
    margin-top: 8px;
    font-size: 11px;
    color: var(--color-red);
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Queue Actions Bar at bottom */
.queue-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
    animation: fadeIn 0.3s ease;
}

.btn-convert-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
}

.btn-clear-queue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
}

.file-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

.status-processing {
    background: rgba(93, 95, 239, 0.1);
    color: var(--accent-indigo);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--color-green);
}

.status-failed {
    background: rgba(255, 59, 48, 0.1);
    color: var(--color-red);
}

.btn-file-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

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

/* Spinner Icon */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* ==========================================================================
   Auth Modal (Glassmorphism & Shadows)
   ========================================================================== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 6, 8, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 
        0 24px 60px rgba(0,0,0,0.3),
        inset 0 1px 0 var(--border-highlight);
    padding: 40px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s var(--ease-out);
}

.auth-modal-overlay.show .auth-modal-card {
    transform: translateY(0);
}

.btn-close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

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

.auth-card-icon-container {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card-icon-container svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
    z-index: 2;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.auth-header p {
    font-size: 13.5px;
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 2px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 48px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 16px 0 42px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    transition: all 0.2s var(--ease-3d);
}

.input-wrapper input:focus {
    outline: none;
    border-color: rgba(131, 58, 180, 0.5);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(131, 58, 180, 0.15);
}

.btn-submit {
    height: 48px;
    width: 100%;
    margin-top: 10px;
}

.auth-toggle {
    margin-top: 24px;
    text-align: center;
}

.auth-toggle p {
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-toggle a {
    color: var(--accent-indigo);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.auth-toggle a:hover {
    color: var(--accent-purple);
}

.error-msg {
    color: #ff453a;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: rgba(255, 69, 58, 0.08);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 69, 58, 0.15);
    display: none;
}

/* ==========================================================================
   Animations & Media Queries
   ========================================================================== */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

@media (max-width: 768px) {
    .main-header {
        padding: 0 24px;
    }
    
    .hero-title {
        font-size: 38px;
    }
    
    .presets-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-modal-card {
        padding: 24px;
    }
}

/* ==========================================================================
   Light Mode Overrides
   ========================================================================== */
body.light-theme .mesh-glow {
    opacity: 0.09;
    mix-blend-mode: multiply;
}

body.light-theme .hero-title {
    background: linear-gradient(180deg, #0f172a 0%, #3b4252 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .preset-card, 
body.light-theme .dropzone,
body.light-theme .file-row {
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 var(--border-highlight);
}

body.light-theme .preset-card:hover,
body.light-theme .dropzone:hover {
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 var(--border-highlight);
}

body.light-theme .auth-modal-overlay {
    background: rgba(245, 246, 248, 0.85);
}

body.light-theme .usage-ring-bg {
    stroke: rgba(0, 0, 0, 0.03);
}

body.light-theme .file-icon-box {
    background: rgba(0, 0, 0, 0.015);
}

/* ==========================================================================
   Sidebar & Desktop Layout
   ========================================================================== */
.main-viewport {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.btn-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 12px;
}

.btn-menu-toggle:hover {
    background: var(--bg-surface-hover);
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 24px 16px;
}

.app-sidebar.active {
    transform: translateX(0);
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-header {
    margin-bottom: 32px;
    padding: 0 8px;
}

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

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-item svg {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.sidebar-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.sidebar-item:hover svg {
    color: var(--text-primary);
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(93, 95, 239, 0.15) 0%, rgba(131, 58, 180, 0.15) 100%);
    color: #ffffff;
    border-color: rgba(131, 58, 180, 0.3);
    box-shadow: 0 4px 12px rgba(131, 58, 180, 0.15);
}

.sidebar-item.active svg {
    color: #5d5fef;
}

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

.sidebar-profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.profile-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
}

.profile-meta-small {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.profile-email-small {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

body.light-theme .app-sidebar {
    background: rgba(255, 255, 255, 0.9) !important;
    border-right-color: var(--border-color);
}
body.light-theme .sidebar-profile-item {
    background: rgba(0, 0, 0, 0.03);
}

@media (min-width: 769px) {
    .app-container {
        max-width: 1440px;
        display: flex;
        flex-direction: row;
        padding: 0;
        gap: 0;
    }
    .main-viewport {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        padding: 0 40px 80px 40px;
        overflow-y: auto;
        position: relative;
    }
    .main-header {
        margin: 0 -40px 32px -40px !important;
        padding: 0 40px !important;
    }
    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(0);
        background: rgba(10, 12, 16, 0.4);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .btn-menu-toggle {
        display: none !important;
    }
}

/* ==========================================================================
   Conversations (AI Chat with Documents) Styles
   ========================================================================== */
.view-panel {
    display: none;
    animation: fadeInView 0.3s ease-out forwards;
}

.view-panel.active {
    display: block !important;
}

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

.conversations-section {
    width: 100%;
}

.section-header-row {
    margin-bottom: 24px;
}

.section-title-wrapper h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.conversations-container {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    min-height: 500px;
    height: calc(100vh - 220px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

@media (min-width: 769px) {
    .conversations-container {
        grid-template-columns: 280px 1fr;
    }
}

/* Documents Pane */
.chat-docs-pane {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .chat-docs-pane {
    background: rgba(0, 0, 0, 0.01);
}

.chat-docs-pane .pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    min-height: 56px;
}

.chat-docs-pane .pane-header h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0;
}

.btn-add-doc-chat {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, background 0.3s;
}

.btn-add-doc-chat:hover {
    transform: translateY(-1.5px) scale(1.02);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

.btn-add-doc-chat:active {
    transform: translateY(0);
}

.btn-add-doc-chat svg {
    color: inherit;
}

.chat-docs-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-docs-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1.5;
}

/* Chat Document Row Item */
.chat-doc-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 40px 12px 12px !important;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
}

.btn-chat-doc-delete {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-doc-item:hover .btn-chat-doc-delete {
    opacity: 0.8;
    transform: translateY(-50%) scale(1);
}

.chat-doc-item .btn-chat-doc-delete:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

@media (max-width: 768px) {
    .chat-doc-item .btn-chat-doc-delete {
        opacity: 0.7;
        transform: translateY(-50%) scale(1);
    }
}

.chat-doc-item:hover {
    background: var(--bg-surface-hover);
}

.chat-doc-item.active {
    background: rgba(93, 95, 239, 0.1);
    border-color: rgba(93, 95, 239, 0.3);
}

.chat-doc-item.converting-state {
    cursor: default;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px dashed var(--border-color) !important;
    transition: none !important;
}

body.light-theme .chat-doc-item.converting-state {
    background: rgba(0, 0, 0, 0.02) !important;
}

.chat-doc-item.converting-state .doc-icon-wrapper {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
}

.doc-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(131, 58, 180, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-indigo);
    font-size: 16px;
    flex-shrink: 0;
}

body.light-theme .doc-icon-wrapper {
    background: rgba(93, 95, 239, 0.08);
}

.doc-meta {
    overflow: hidden;
}

.doc-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-bottom: 2px;
}

.doc-size-date {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Chat Conversation Pane */
.chat-conversation-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-conversation-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
}

.chat-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-chat-back {
    display: none;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--accent-purple);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px 6px 0;
    margin-right: 12px;
    transition: transform 0.2s, color 0.2s;
}

.btn-chat-back:hover {
    transform: translateX(-3px);
    color: var(--color-primary-hover);
}

.btn-chat-back svg {
    color: inherit;
}

.active-doc-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.active-doc-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-messages-box {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.05);
}

/* Chat Message Bubbles */
.chat-message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: messagePop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes messagePop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-message.message-ai {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

body.light-theme .chat-message.message-ai {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chat-message.message-user {
    background: var(--accent-gradient);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(131, 58, 180, 0.15);
}

.message-time {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 6px;
    text-align: right;
}

.chat-message.message-user .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Chat Input Bar */
.chat-input-bar {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
}

body.light-theme .chat-input-bar {
    background: rgba(255, 255, 255, 0.4);
}

.chat-input-bar input {
    flex: 1;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    padding: 0 16px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.chat-input-bar input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.15);
}

.chat-input-bar input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-send-message {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-send-message:hover {
    transform: scale(1.03);
}

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

/* ==========================================================================
   Profile & Stats View Styles
   ========================================================================== */
.profile-layout-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

/* User Card */
.profile-user-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.profile-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
}

.profile-user-details {
    flex: 1;
}

.profile-user-details h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-user-details p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.badge-plan-status {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--color-blue);
    border: 1px solid rgba(0, 122, 255, 0.2);
}

body.light-theme .badge-plan-status {
    background: rgba(0, 122, 255, 0.08);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: var(--color-red);
}

.btn-danger-outline:hover {
    background: rgba(255, 59, 48, 0.05);
    border-color: var(--color-red);
}

/* Stats Cards Grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 576px) {
    .profile-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

/* Settings Group Card */
.settings-group-card {
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    overflow: hidden;
}

.settings-group-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.05);
}

.settings-group-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-rows-list {
    display: flex;
    flex-direction: column;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.settings-row:last-child {
    border-bottom: none;
}

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

.row-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.row-value {
    font-size: 14px;
    color: var(--text-primary);
}

.btn-secondary-small {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

/* ==========================================================================
   Landing Mode Page Layout Overrides (Home Page)
   ========================================================================== */
@media (min-width: 1024px) {
    .app-container.landing-mode {
        flex-direction: column !important;
        max-width: 1200px !important;
        padding: 0 24px 80px 24px !important;
        margin: 0 auto !important;
    }
    
    .app-container.landing-mode .main-header {
        margin: 0 0 32px 0 !important;
        padding: 0 !important;
    }
}

/* ==========================================================================
   Dashboard Layout & Collapsible Sidebar Styles
   ========================================================================== */
.app-sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@media (min-width: 1024px) {
    /* Dock container to screen edges by removing max-width on dashboard */
    .app-container:not(.landing-mode) {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Collapsed Sidebar State */
    .app-container.collapsed .app-sidebar {
        width: 80px !important;
        padding: 24px 8px !important;
    }
    
    /* Collapsed Brand Logo */
    .app-container.collapsed .brand-logo {
        display: none !important;
    }
    
    .app-container.collapsed .collapsed-logo-emblem {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 0 auto;
        background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
        border-radius: 10px;
        color: #fff;
        font-size: 20px;
        font-weight: 800;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
    }
    
    /* Collapsed Navigation Items */
    .app-container.collapsed .sidebar-item {
        justify-content: center !important;
        padding: 12px !important;
        margin: 6px 0 !important;
        width: 48px;
        height: 48px;
        margin-left: auto !important;
        margin-right: auto !important;
        border-radius: 12px;
    }
    
    .sidebar-item span {
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s ease;
        opacity: 1;
        max-width: 150px;
        display: inline-block;
        vertical-align: middle;
        overflow: hidden;
        white-space: nowrap;
    }

    .app-container.collapsed .sidebar-item span {
        opacity: 0 !important;
        max-width: 0 !important;
        margin-left: 0 !important;
        pointer-events: none !important;
    }
    
    .app-container.collapsed .sidebar-item svg {
        margin-right: 0 !important;
        width: 22px;
        height: 22px;
    }
    
    /* Collapsed Footer Profile */
    .app-container.collapsed .sidebar-profile-item {
        justify-content: center !important;
        padding: 8px 0 !important;
    }
    
    .profile-meta-small {
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 1;
        max-width: 150px;
        overflow: hidden;
        white-space: nowrap;
    }

    .app-container.collapsed .profile-meta-small {
        opacity: 0 !important;
        max-width: 0 !important;
        pointer-events: none !important;
    }
    
    .app-container.collapsed .profile-avatar-small {
        margin-right: 0 !important;
    }
    
    /* Force menu toggle button visible on desktop dashboard for collapse feature */
    .app-container:not(.landing-mode) .btn-menu-toggle {
        display: flex !important;
        margin-left: 8px;
    }
}

/* ==========================================================================
   Workspace Converter Panel (Dashboard Only)
   ========================================================================== */
.workspace-header {
    margin-bottom: 24px;
}

.workspace-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.workspace-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.dashboard-workspace-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .dashboard-workspace-container.has-files {
        grid-template-columns: 420px 1fr;
    }
}

.workspace-col-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Compact Dropzone */
.compact-dropzone {
    padding: 32px 20px !important;
    min-height: 200px !important;
    border-radius: 16px !important;
}

.compact-icon-3d {
    width: 60px !important;
    height: 60px !important;
    margin-bottom: 12px !important;
}

.compact-icon-3d .dropzone-3d-img {
    width: 44px !important;
    height: 44px !important;
}

/* Options Card */
.workspace-options-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.options-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.select-wrapper {
    position: relative;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
    transition: border-color 0.2s;
}

.select-wrapper:hover::after {
    border-color: var(--text-primary);
}

/* Slider Wrapper */
.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.4);
    transition: transform 0.1s;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Light theme specific overrides */
body.light-theme .form-select {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .form-range {
    background: rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Sidebar Collapse Button & Header Refinements
   ========================================================================== */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 8px;
    position: relative;
}

.btn-sidebar-collapse {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sidebar-collapse:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-sidebar-collapse svg {
    transition: transform 0.3s ease;
}

/* Hide header menu toggle button on desktop dashboard, since collapse is in the sidebar */
@media (min-width: 1024px) {
    .app-container:not(.landing-mode) #menuToggleBtn {
        display: none !important;
    }
}

/* Hide sidebar collapse button on mobile */
@media (max-width: 1023px) {
    #sidebarCollapseBtn {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .app-container.collapsed .btn-sidebar-collapse svg {
        transform: rotate(180deg);
    }
    
    .app-container.collapsed .sidebar-header {
        flex-direction: column !important;
        gap: 12px;
        justify-content: center !important;
        padding: 0 !important;
    }
    
    .app-container.collapsed #sidebarCollapseBtn {
        margin-top: 4px;
    }
}

/* ==========================================================================
   Persistent Queue Box & Empty State Card
   ========================================================================== */
.workspace-col-right.files-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.workspace-col-right .section-header-row {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    width: 100%;
}

.workspace-col-right .section-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.workspace-col-right .section-title-wrapper h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.queue-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    text-align: center;
    background: rgba(10, 12, 16, 0.2);
    margin-top: 10px;
    flex: 1;
    min-height: 280px;
}

.queue-empty-icon {
    width: 72px;
    height: 72px;
    background: rgba(168, 85, 247, 0.06);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1);
}

.queue-empty-state h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.queue-empty-state p {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 260px;
    line-height: 1.5;
}

@media (min-width: 1024px) {
    .dashboard-workspace-container {
        grid-template-columns: 1fr 1fr !important;
        min-height: 520px;
    }
}

body.light-theme .queue-empty-state {
    background: rgba(0, 0, 0, 0.02);
}

/* Option Help Text Under Select Inputs */
.option-help-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 6px;
    display: block;
    opacity: 0.75;
}

/* ==========================================================================
   Premium 3D Edge Bevel Treatment Overrides
   ========================================================================== */
.dropzone,
.compact-dropzone,
.workspace-options-card,
.workspace-col-right.files-section,
.file-row,
.btn-sidebar-collapse {
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Make sure hover states retain beveled highlights */
.dropzone:hover,
.compact-dropzone:hover,
.file-row:hover,
.btn-sidebar-collapse:hover {
    box-shadow: 
        0 14px 35px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3) !important;
}

/* Light Theme 3D Bevel Highlight */
body.light-theme .dropzone,
body.light-theme .compact-dropzone,
body.light-theme .workspace-options-card,
body.light-theme .workspace-col-right.files-section,
body.light-theme .file-row,
body.light-theme .btn-sidebar-collapse {
    box-shadow: 
        0 10px 24px rgba(10, 15, 30, 0.08),
        0 2px 5px rgba(10, 15, 30, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    background: #ffffff !important;
}

body.light-theme .dropzone:hover,
body.light-theme .compact-dropzone:hover,
body.light-theme .file-row:hover,
body.light-theme .btn-sidebar-collapse:hover {
    box-shadow: 
        0 14px 30px rgba(10, 15, 30, 0.12),
        0 4px 8px rgba(10, 15, 30, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* ==========================================================================
   Premium Website Animations & Micro-interactions
   ========================================================================== */

/* 1. Floating 3D image animation for dropzone & empty state icons */
@keyframes dropzone3DFloat {
    0% { transform: translateY(0) scale(1) rotate(0deg); }
    50% { transform: translateY(-8px) scale(1.03) rotate(2deg); }
    100% { transform: translateY(0) scale(1) rotate(0deg); }
}

.dropzone-3d-img {
    animation: dropzone3DFloat 6s ease-in-out infinite;
    transform-origin: center bottom;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15));
}

/* 2. Page entry animations for dashboard components */
@keyframes mainViewSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panelSlideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes panelSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.main-viewport {
    animation: mainViewSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.workspace-options-card {
    animation: panelSlideInRight 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.workspace-col-right.files-section {
    animation: panelSlideInLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 3. Hover Micro-animations */
.sidebar-item {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s, color 0.25s, border-color 0.25s !important;
}

.sidebar-item:hover {
    transform: translateX(6px) scale(1.02);
}

.app-container.collapsed .sidebar-item:hover {
    transform: scale(1.08) !important;
}

.file-row {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, border-color 0.25s !important;
}

.file-row:hover {
    transform: scale(1.012) translateY(-2px);
    border-color: rgba(168, 85, 247, 0.3) !important;
}

body.light-theme .file-row:hover {
    border-color: rgba(168, 85, 247, 0.4) !important;
}

/* Buttons interactivity and pulsing active click state */
.btn-primary, .btn-secondary, .btn-action {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, background 0.3s !important;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 24px rgba(168, 85, 247, 0.3) !important;
}

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

/* 4. Theme Toggle rotation */
.btn-theme-toggle svg {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-theme-toggle:hover svg {
    transform: rotate(45deg) scale(1.15);
}

/* 5. Smooth animated backgrounds */
@keyframes bgGlowPulse {
    0% { opacity: 0.15; }
    50% { opacity: 0.25; }
    100% { opacity: 0.15; }
}

.bg-glow-pulse {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(0,0,0,0) 70%);
    top: -10%;
    right: -10%;
    pointer-events: none;
    z-index: 0;
    animation: bgGlowPulse 8s ease-in-out infinite;
}

body.light-theme .bg-glow-pulse {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.04) 0%, rgba(59, 130, 246, 0.02) 50%, rgba(0,0,0,0) 70%);
}

/* ==========================================================================
   SVG Icon Motion Animations (Micro-interactions)
   ========================================================================== */

/* 1. Sidebar Nav Icons: Scale, rotate and light up on hover */
.sidebar-item svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s, filter 0.3s !important;
    transform-origin: center;
}

.sidebar-item:hover svg {
    transform: scale(1.22) rotate(-8deg);
    filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.3));
}

.sidebar-item.active svg {
    filter: drop-shadow(0 2px 8px rgba(93, 95, 239, 0.4));
}

/* 2. File list row category icons: bounce and rotate slightly on row hover */
.file-icon-box svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s !important;
    transform-origin: center;
}

.file-row:hover .file-icon-box svg {
    transform: scale(1.2) rotate(8deg);
    filter: drop-shadow(0 2px 6px rgba(168, 85, 247, 0.25));
}

/* 3. Action icons (convert all, clear queue, checkmarks, delete buttons): swell on hover */
.btn-action svg, 
.file-right button svg {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.btn-action:hover svg, 
.file-right button:hover svg {
    transform: scale(1.2);
}

/* 4. Dropdown selector arrow animations */
.select-wrapper::after {
    transition: border-color 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.select-wrapper:hover::after {
    transform: translateY(-50%) rotate(45deg) scale(1.15) translate(1px, 1px);
}

.format-select-wrapper::after {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s !important;
}

.format-select-wrapper:hover::after {
    transform: translateY(2px) scale(1.1);
    color: var(--color-primary);
}

/* 5. Dropzone hover active image float/pulse */
@keyframes dropzoneHoverPulse {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.05); }
}

.dropzone:hover .dropzone-3d-img {
    animation: dropzoneHoverPulse 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) infinite alternate;
}

/* 6. Responsive Mobile AI Conversations View Toggle */
@media (max-width: 768px) {
    /* Reset main-viewport padding on mobile so content can go edge-to-edge */
    .app-container:not(.landing-mode) .main-viewport {
        padding: 0 !important;
    }
    
    /* Re-align main header on mobile for edge-to-edge dashboard layout */
    .app-container:not(.landing-mode) .main-header {
        padding: 0 16px !important;
        margin: 0 0 16px 0 !important;
        height: 64px !important;
        border-bottom: 1px solid var(--border-color);
        background: rgba(10, 12, 16, 0.6) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    body.light-theme .app-container:not(.landing-mode) .main-header {
        background: rgba(255, 255, 255, 0.8) !important;
    }
    
    /* Lock the body and HTML element to prevent viewport elastic scrolling on iOS/Android */
    body:has(#conversationsView.active) {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
    }

    /* If conversationsView is active, prevent the main viewport from scrolling so only the chat list scrolls */
    .app-container:not(.landing-mode):has(#conversationsView.active) .main-viewport {
        overflow: hidden !important;
        height: calc(100vh - 64px) !important;
    }
    
    /* Remove margin from header when conversations are active */
    .app-container:not(.landing-mode):has(#conversationsView.active) .main-header {
        margin: 0 !important;
    }
    
    /* Keep padding on standard dashboard sections so they don't hit the screen edges */
    .converter-section,
    .profile-section {
        padding: 0 16px 80px 16px !important;
    }

    /* Conversations section goes completely edge-to-edge full page */
    .conversations-section {
        padding: 0 !important;
        height: 100% !important;
        display: flex;
        flex-direction: column;
        margin: 0 !important;
    }
    
    /* Hide the big desktop section headers to maximize chat area */
    .conversations-section .section-header-row {
        display: none !important;
    }

    .conversations-container {
        display: flex !important;
        flex-direction: column;
        flex: 1;
        height: 100% !important;
        min-height: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        background: var(--bg-surface) !important;
        box-shadow: none !important;
        margin: 0 !important;
    }

    /* By default, show Docs Pane and hide Chat Pane */
    .conversations-container:not(.chat-active) .chat-docs-pane {
        display: flex !important;
        width: 100% !important;
        height: 100% !important;
        background: var(--bg-surface) !important;
    }

    .conversations-container:not(.chat-active) .chat-conversation-pane {
        display: none !important;
    }

    /* When a chat is active, hide Docs Pane and show Chat Pane */
    .conversations-container.chat-active .chat-docs-pane {
        display: none !important;
    }

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

    .conversations-container.chat-active .chat-conversation-pane {
        display: flex !important;
        width: 100% !important;
        height: 100% !important;
        flex: 1;
        animation: slideInFromRightChat 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    /* Display back button only in active chat on mobile */
    .btn-chat-back {
        display: flex !important;
    }
    
    /* Compact chat inputs and headers on mobile device screen sizes */
    .chat-conversation-header {
        padding: 12px 16px !important;
    }
    
    .chat-messages-box {
        padding: 16px !important;
        gap: 12px !important;
    }
    
    .chat-input-bar {
        padding: 12px 16px !important;
        background: var(--bg-surface) !important;
    }
    
    /* Style document list items as flat rows for native mobile canvas feel */
    .chat-docs-list {
        padding: 0 !important;
    }
    
    .chat-doc-item {
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        margin: 0 !important;
        padding: 16px 20px !important;
        background: transparent !important;
    }
    
    .chat-doc-item.active {
        background: rgba(93, 95, 239, 0.08) !important;
    }
}

/* Canvas Toggle Button styling */
.btn-chat-canvas-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.btn-chat-canvas-toggle:hover {
    background: rgba(168, 85, 247, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.btn-chat-canvas-toggle svg {
    color: #a855f7;
    transition: transform 0.25s ease;
}

.btn-chat-canvas-toggle:hover svg {
    transform: rotate(15deg) scale(1.1);
}

/* Chat Canvas Pane layout and styles */
.chat-canvas-pane {
    display: none;
    flex-direction: column;
    background: var(--bg-surface-secondary);
    border-left: 1px solid var(--border-color);
    position: relative;
    height: 100%;
}

.conversations-container.canvas-active .chat-canvas-pane {
    display: flex;
}

.canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.canvas-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 70%;
}

.canvas-header-icon {
    color: #a855f7;
    flex-shrink: 0;
}

.canvas-word-count {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

body.light-theme .canvas-word-count {
    background: rgba(0, 0, 0, 0.04);
}

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

.btn-canvas-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

#btnCanvasSave {
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.05);
}

#btnCanvasSave:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
}

.canvas-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-surface);
}

#canvasTextArea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    padding: 0;
}

.canvas-composer-bar {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    gap: 12px;
}

#canvasInstructionField {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

#canvasInstructionField:focus {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.15);
}

.btn-canvas-rewrite {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.btn-canvas-rewrite:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.5);
}

.btn-canvas-rewrite:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

@media (min-width: 992px) {
    .conversations-container.canvas-active {
        grid-template-columns: 280px 1fr 1.2fr;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .conversations-container.canvas-active {
        grid-template-columns: 240px 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .conversations-container.canvas-active .chat-conversation-pane {
        display: none !important;
    }
    
    .conversations-container.canvas-active .chat-canvas-pane {
        display: flex !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* Unified Composer Rewrite Button styling */
.btn-chat-composer-rewrite {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-chat-composer-rewrite:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.2);
    transform: scale(1.05);
}

.btn-chat-composer-rewrite:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px !important;
}

/* Force padding 0 to prevent icons from getting squished by general .btn styles */
.btn-send-message,
.btn-chat-composer-rewrite {
    padding: 0 !important;
}

/* Clear Chat Button styling */
.btn-chat-clear {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.btn-chat-clear:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-chat-clear svg {
    color: #ef4444;
}









