/* Reverted: remove mobile bottom-sheet and handle added recently */


/* Veo 3 Prompt Guide - Enhanced Styles with RAOGY Branding */

:root {
    /* Colors */
    --primary: #6366f1;
    --secondary: #10b981;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --raogy-brand: #3b82f6;
    /* Light Theme */
    --bg-primary-light: #ffffff;
    --bg-secondary-light: #f8fafc;
    --bg-tertiary-light: #f1f5f9;
    --text-primary-light: #1e293b;
    --text-secondary-light: #64748b;
    --border-light: #e2e8f0;
    /* Dark Theme */
    --bg-primary-dark: #1a1a1a;
    --bg-secondary-dark: #2d2d2d;
    --bg-tertiary-dark: #3a3a3a;
    --text-primary-dark: #ffffff;
    --text-secondary-dark: #e0e0e0;
    --border-dark: #4a4a4a;
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    /* Default theme variables */
    --bg-primary: var(--bg-primary-light);
    --bg-secondary: var(--bg-secondary-light);
    --bg-tertiary: var(--bg-tertiary-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --border-color: var(--border-light);
}


/* Toggle Input Styles */

.toggle-input {
    width: 40px;
    height: 22px;
    appearance: none;
    background: var(--border-color);
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: .25s;
}

.toggle-input:checked {
    background: var(--primary);
}

.toggle-input:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: .25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-input:checked:before {
    transform: translateX(18px);
}


/* Sub panels */

.sheet-sub {
    background: var(--bg-primary);
    position: absolute;
    inset: 0;
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    animation: subSlide .3s ease;
}

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

.sheet-sub.hidden {
    display: none;
}

.sub-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.sub-select,
.sub-textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 0.75rem;
    padding: 0.65rem 0.8rem;
    font-size: 0.8rem;
    font-family: inherit;
    resize: vertical;
}

.sub-textarea {
    min-height: 90px;
}

.sub-select:focus,
.sub-textarea:focus {
    outline: 2px solid var(--primary);
    border-color: var(--primary);
}

.sub-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.sub-actions button {
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.65rem;
    color: var(--text-primary);
    cursor: pointer;
}

.sub-actions .apply {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.sub-actions .sub-back {
    background: var(--bg-secondary);
}

.sub-actions button:active {
    transform: scale(.96);
}

@media (min-width: 769px) {
    .mobile-controls-bar {
        display: none;
    }
    #mobileGeminiBar,
    #mobileToolsSheet {
        display: none !important;
    }
}

[data-theme="dark"] {
    --bg-primary: var(--bg-primary-dark);
    --bg-secondary: var(--bg-secondary-dark);
    --bg-tertiary: var(--bg-tertiary-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --border-color: var(--border-dark);
    --primary: #8b92f8;
    --secondary: #34d399;
    --raogy-brand: #60a5fa;
}


/* Tailwind-class overrides for dark mode where hard-coded colors are used */

[data-theme="dark"] .bg-white {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .bg-slate-50 {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-slate-700 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-slate-600,
[data-theme="dark"] .text-slate-500 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .border-slate-300 {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.45) !important;
}


/* Ensure main textarea respects theme on desktop too */

[data-theme="dark"] #userInput {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #4a4a4a !important;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}


/* General Link Styles with Dark Mode Support */

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--raogy-brand);
    text-decoration: underline;
}


/* Dark mode link improvements */

[data-theme="dark"] a {
    color: #60a5fa;
    /* Brighter blue for better visibility in dark mode */
}

[data-theme="dark"] a:hover {
    color: #93c5fd;
}


/* Results Section Dark Mode */

[data-theme="dark"] .results-section {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .scene-card {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .scene-card:hover {
    background: #3f3f3f;
    border-color: #5a5a5a;
}

[data-theme="dark"] .scene-number {
    background: #4f46e5;
    color: white;
}

[data-theme="dark"] .visual-prompt,
[data-theme="dark"] .dialogue-text,
[data-theme="dark"] .character-description {
    color: var(--text-primary);
}

[data-theme="dark"] .prompt-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .copy-btn {
    background: #374151;
    color: white;
}

[data-theme="dark"] .copy-btn:hover {
    background: #4b5563;
}

[data-theme="dark"] .results-controls button {
    background: #374151;
    color: white;
    border-color: var(--border-color);
}

[data-theme="dark"] .results-controls button:hover {
    background: #4b5563;
}


/* Character Cards Styles */

.character-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    transition: all var(--transition);
}

.character-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary);
}

.character-card h5 {
    color: var(--secondary);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.character-card .character-prompt {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.character-actions {
    display: flex;
    justify-content: flex-end;
}

.character-copy-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.character-copy-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}


/* Scene Characters Display */

.scene-characters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.scene-character-tag {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.scene-character-tag i {
    font-size: 0.7rem;
}

.no-characters {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-md);
    padding-bottom: 120px;
    /* Space for footer */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Cross-browser consistency */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
}


/* Specific container adjustments for the main page */

.main-page .container {
    justify-content: center;
    padding-top: 10vh;
    /* Reduced padding for better space usage */
}


/* Ensure proper spacing for other pages */

.about-section,
.contact-section,
.policy-section {
    margin-top: var(--space-lg);
}


/* Fix page layout for non-main pages */

.about-section,
.contact-section,
.policy-section {
    flex: 1;
    margin-bottom: var(--space-xl);
}


/* Main content area adjustments */

.main-content {
    flex: 1;
    width: 100%;
}


/* Main input generation container spacing */

.w-full.max-w-4xl {
    margin-bottom: 3rem;
    /* Ensure space between input area and results */
}


/* Specific spacing for the main script generation container */

.w-full.max-w-4xl.mx-auto {
    margin-bottom: 3rem;
    /* Reduced space before results section */
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}


/* Dark mode override for main container */

[data-theme="dark"] .w-full.max-w-4xl.mx-auto {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}


/* Fix textarea layout */

#userInput {
    width: 100% !important;
    min-height: 200px !important;
    max-height: 400px !important;
    padding: 1rem !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 0.75rem !important;
    resize: vertical !important;
    transition: all 0.3s ease !important;
}

[data-theme="dark"] #userInput {
    background: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #4a4a4a !important;
}

#userInput:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

[data-theme="dark"] #userInput:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(139, 146, 248, 0.2) !important;
}


/* Results Section Spacing */

#resultsSection {
    margin-top: 4rem;
    padding-top: 3rem;
    /* Match input container styling */
    max-width: 896px;
    /* Same as max-w-4xl */
    width: 100%;
    /* Same as w-full */
    margin-left: auto;
    /* Same as mx-auto */
    margin-right: auto;
    /* Same as mx-auto */
    background: var(--bg-primary);
    /* Use theme-aware background */
    border-radius: 1rem;
    /* Same as rounded-2xl */
    box-shadow: var(--shadow-lg);
    /* Use theme shadow */
    padding: 1.5rem;
    /* Same as p-6 */
    border: 1px solid var(--border-color);
}

[data-theme="dark"] #resultsSection {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

@media (min-width: 768px) {
    #resultsSection {
        padding: 2rem;
        /* Same as md:p-8 */
    }
}


/* Header */

.header {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    position: relative;
}


/* Logo link styles */

.logo a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.logo a:hover {
    color: var(--primary);
}


/* Dark mode improvements for logo link */

[data-theme="dark"] .logo a {
    color: #f8fafc;
    /* Bright white for better visibility */
}

[data-theme="dark"] .logo a:hover {
    color: #60a5fa;
    /* Bright blue on hover */
}


/* Visual Header Section */

.visual-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
}

[data-theme="dark"] .visual-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-color: #475569;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.visual-header-content {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-xl);
    align-items: start;
}

.header-tag {
    display: inline-block;
    background: #e9d5ff;
    color: #7c3aed;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    grid-column: 1 / -1;
}

[data-theme="dark"] .header-tag {
    background: #581c87;
    color: #c084fc;
}

.main-heading {
    display: none;
    margin-bottom: var(--space-lg);
    grid-column: 1 / -1;
}

.heading-part {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    display: block;
}

[data-theme="dark"] .heading-part {
    color: #f1f5f9;
}

.heading-highlight {
    font-size: 2.5rem;
    font-weight: 700;
    color: #7c3aed;
    display: block;
}

[data-theme="dark"] .heading-highlight {
    color: #a855f7;
}

.heading-mobile {
    display: none;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

[data-theme="dark"] .heading-mobile {
    color: #f1f5f9;
}

.heading-mobile .highlight {
    color: #7c3aed;
}

[data-theme="dark"] .heading-mobile .highlight {
    color: #a855f7;
}

.compact-heading {
    display: block;
    grid-column: 1;
    grid-row: 2;
    text-align: center;
    margin-bottom: var(--space-md);
}

.compact-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

[data-theme="dark"] .compact-title {
    color: #f1f5f9;
}

.compact-highlight {
    color: #7c3aed;
}

[data-theme="dark"] .compact-highlight {
    color: #a855f7;
}

.info-box {
    background: rgba(147, 197, 253, 0.1);
    border: 1px solid rgba(147, 197, 253, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    grid-column: 1;
}

[data-theme="dark"] .info-box {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.2);
}

.info-icon {
    color: #7c3aed;
    font-size: 1.2rem;
    margin-top: 0.2rem;
}

[data-theme="dark"] .info-icon {
    color: #a855f7;
}

.info-content {
    flex: 1;
}

.info-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

[data-theme="dark"] .info-title {
    color: #f1f5f9;
}

.info-description {
    color: #6b7280;
    line-height: 1.6;
    font-size: 0.95rem;
}

[data-theme="dark"] .info-description {
    color: #cbd5e1;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    grid-column: 2;
    grid-row: 2 / 4;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    animation: floatUpDown 3s ease-in-out infinite;
}

.feature-item:nth-child(1) {
    animation-delay: 0s;
}

.feature-item:nth-child(2) {
    animation-delay: 1s;
}

.feature-item:nth-child(3) {
    animation-delay: 2s;
}

@keyframes floatUpDown {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

[data-theme="dark"] .feature-item {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.1), transparent);
    transition: left 0.5s ease;
}

[data-theme="dark"] .feature-item::before {
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.2), transparent);
}

.feature-item:hover::before {
    left: 100%;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
    border-color: #7c3aed;
}

[data-theme="dark"] .feature-item:hover {
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
    border-color: #a855f7;
}

.feature-item i {
    color: #7c3aed;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .feature-item i {
    color: #a855f7;
}

.feature-item:hover i {
    transform: scale(1.1);
}

.feature-item span {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

[data-theme="dark"] .feature-item span {
    color: #e2e8f0;
}

.feature-item:hover span {
    color: #7c3aed;
}

[data-theme="dark"] .feature-item:hover span {
    color: #a855f7;
}

.stats-section {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    grid-column: 1;
    grid-row: 3;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #22c55e;
    line-height: 1;
}

[data-theme="dark"] .stat-number {
    color: #4ade80;
}

.stat-highlight {
    font-size: 1.2rem;
    font-weight: 600;
    color: #22c55e;
    line-height: 1;
}

[data-theme="dark"] .stat-highlight {
    color: #4ade80;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .stat-label {
    color: #cbd5e1;
}


/* Sidebar styles for blog and tutorial pages */

.page-container {
    display: flex;
    min-height: 100vh;
}

.page-sidebar {
    width: 64px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: width 0.3s ease-in-out;
}

.page-sidebar.open {
    width: 240px;
}

.page-content {
    flex: 1;
    margin-left: 64px;
    transition: margin-left 0.3s ease-in-out;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-sidebar.open+.page-content {
    margin-left: 240px;
}


/* Blog and tutorial page header adjustments */

.blog-page .header,
.tutorial-page .header {
    margin: 0 0 2rem 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    border-top: none;
}


/* Article container adjustments */

.article-container,
.tutorial-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}


/* Mobile responsive for visual header */

@media(max-width: 768px) {
    .page-sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1000;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
    }
    .page-sidebar.mobile-open {
        transform: translateX(0);
    }
    .page-content {
        margin-left: 0;
        width: 100%;
        position: relative;
    }
    .page-sidebar.open+.page-content {
        margin-left: 0;
    }
    /* Ensure no content appears outside the main container */
    body {
        overflow-x: hidden;
    }
    /* Hide any potential stray content */
    body::before,
    body::after,
    .page-container::before,
    .page-container::after {
        content: "";
        display: none;
    }
    /* Clean mobile layout */
    .blog-page,
    .tutorial-page {
        position: relative;
    }
    .blog-page::before,
    .tutorial-page::before {
        content: "";
        display: none;
    }
    .visual-header {
        padding: var(--space-md);
        margin: var(--space-md) 0 var(--space-lg) 0;
    }
    .visual-header-content {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    .header-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
        margin-bottom: var(--space-sm);
    }
    .main-heading {
        display: block;
        margin-bottom: var(--space-md);
        grid-column: 1 / -1;
    }
    .heading-part {
        display: none;
    }
    .heading-highlight {
        display: none;
    }
    .heading-mobile {
        display: block;
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: var(--space-md);
    }
    .compact-heading {
        display: none;
    }
    .info-box {
        padding: var(--space-sm);
        margin-bottom: var(--space-sm);
    }
    .info-title {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    .info-description {
        font-size: 0.85rem;
    }
    .feature-list {
        grid-column: 1;
        grid-row: auto;
        order: 3;
        gap: 0.3rem;
    }
    .feature-item {
        min-width: auto;
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
    }
    .feature-item i {
        font-size: 0.8rem;
    }
    .feature-item span {
        font-size: 0.8rem;
    }
    .stats-section {
        display: none;
    }
    /* Add gap between visual header and main input section */
    .main-input-section {
        margin-top: var(--space-lg);
    }
}

@media(max-width: 480px) {
    .visual-header {
        padding: var(--space-sm);
        margin: var(--space-sm) 0 var(--space-md) 0;
    }
    .visual-header-content {
        gap: var(--space-sm);
    }
    .header-tag {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
        margin-bottom: 0.5rem;
    }
    .heading-mobile {
        font-size: 1.3rem;
        margin-bottom: var(--space-sm);
    }
    .info-box {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    .info-title {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }
    .info-description {
        font-size: 0.8rem;
    }
    .feature-item {
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
    }
    .feature-item i {
        font-size: 0.7rem;
    }
    .feature-item span {
        font-size: 0.75rem;
    }
    /* Add gap between visual header and main input section */
    .main-input-section {
        margin-top: var(--space-md);
    }
}

.logo {
    flex: 1;
    min-width: 0;
}

.logo h1 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    text-align: left;
}

.logo h1 i {
    color: var(--primary);
    font-size: 1rem;
}

.by-raogy {
    background: linear-gradient(135deg, var(--raogy-brand), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    background-origin: border-box;
    position: relative;
    font-size: 0.85rem;
}

.by-raogy::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(135deg, var(--raogy-brand), var(--secondary));
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    -webkit-mask-composite: xor;
    z-index: -1;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.2rem 0 0 0;
    font-style: italic;
    line-height: 1.2;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.about-btn,
.header-link {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    gap: 0.3rem;
    white-space: nowrap;
    min-height: 36px;
}


/* Dark mode improvements for header links */

[data-theme="dark"] .header-link {
    color: #e2e8f0;
    /* Brighter text for better visibility */
    border-color: #475569;
}

[data-theme="dark"] .header-link:hover {
    color: #ffffff;
    /* Pure white on hover */
    background: var(--primary);
}

.about-btn:hover,
.header-link:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

.about-btn.active {
    background: var(--primary);
    color: var(--text-inverse);
}

.about-btn i {
    font-size: 0.9rem;
}


/* Theme Toggle Button - Fresh Start */

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
    font-family: inherit;
    width: 36px;
    height: 36px;
    padding: 0;
    flex-shrink: 0;
    min-height: 36px;
}

.theme-toggle:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: scale(1.05);
}

.theme-toggle i {
    font-size: 0.9rem;
    transition: all var(--transition);
}

.theme-toggle:hover i {
    color: var(--text-inverse);
}

.api-status,
.dialogue-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    min-height: 36px;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.api-status .status-dot {
    animation: pulse 2s infinite;
}

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


/* About Section */

.about-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--raogy-brand);
    animation: slideDown 0.3s ease-out;
}

.about-content h2 {
    color: var(--raogy-brand);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.about-card {
    background: var(--bg-tertiary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.about-card h3 {
    color: var(--primary);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.about-card ul,
.about-card ol {
    padding-left: 1.5rem;
}

.about-card li {
    margin-bottom: 0.5rem;
}

.about-footer {
    text-align: center;
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-lg);
    color: var(--text-secondary);
}


/* How to Use Section */

.how-to-use-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--success);
    animation: slideDown 0.3s ease-out;
}

.how-to-use-content h2 {
    color: var(--success);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.steps-container {
    margin: var(--space-lg) 0;
}

.step-card {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: 2rem;
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.step-number {
    background: linear-gradient(135deg, var(--raogy-brand), var(--primary));
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h3 {
    color: var(--primary);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pro-tip,
.warning-box {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.pro-tip {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: var(--success);
}

.warning-box {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger);
}

.example-box {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-family: monospace;
    border: 1px solid var(--border-color);
}

.feature-grid,
.tips-grid,
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.feature-item,
.tip-card,
.faq-item {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.feature-item h4,
.tip-card h4,
.faq-item h4 {
    margin-top: 0;
    color: var(--primary);
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.export-option {
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.export-option h4 {
    margin-top: 0;
    color: var(--secondary);
}

.tips-section,
.troubleshooting-section,
.next-steps-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.next-steps-content {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.1));
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.how-to-use-footer {
    text-align: center;
    padding: var(--space-lg);
    margin-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.how-to-use-footer a {
    color: var(--raogy-brand);
    text-decoration: none;
}

.how-to-use-footer a:hover {
    text-decoration: underline;
}


/* Cross-browser compatibility fixes */

* {
    box-sizing: border-box;
}


/* Browser reset for consistent rendering */

html,
body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* Flexbox prefixes for older browser support */

.flex {
    display: flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
}

.items-center {
    align-items: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
}

.justify-center {
    justify-content: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
}


/* Main Input Section */

.main-input-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
    /* Browser-specific fixes */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

[data-theme="dark"] .main-input-section {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

.main-input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--raogy-brand), var(--primary), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%,
    100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
}


/* Character & Environment Manager Dropdown */

.character-env-dropdown {
    margin-top: var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: visible;
    background: var(--bg-tertiary);
    position: relative;
    z-index: 10;
}

.dropdown-toggle {
    width: 100%;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border: none;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-toggle:hover {
    background: linear-gradient(135deg, var(--primary), var(--raogy-brand));
    color: var(--text-inverse);
}

.dropdown-toggle.active {
    background: linear-gradient(135deg, var(--primary), var(--raogy-brand));
    color: var(--text-inverse);
}

.dropdown-toggle span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-arrow {
    transition: transform var(--transition);
    font-size: 0.9rem;
}

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

.dropdown-content {
    display: none;
    padding: 1rem;
    background: var(--bg-primary);
    animation: slideDown 0.3s ease-out;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    max-height: 70vh;
    overflow-y: auto;
}

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

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


/* Professional Note */

.professional-note {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1));
    border: 1px solid var(--secondary);
    border-left: 4px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease-out;
}

.professional-note i {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.professional-note span {
    line-height: 1.5;
    font-weight: 500;
}

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

.dropdown-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.dropdown-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
}

.dropdown-btn:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    max-width: 100%;
}


/* Character fields specific horizontal layout */

.dropdown-content .dropdown-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}


/* Compact character input fields */

.dropdown-grid .dropdown-field {
    min-height: auto;
}

.dropdown-grid .dropdown-field textarea,
.dropdown-grid .dropdown-field select {
    min-height: 36px;
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
}

.dropdown-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}


/* Horizontal layout optimization for character fields */

.characters-tab .dropdown-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    max-width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

.characters-tab .dropdown-field label {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.characters-tab .dropdown-field textarea,
.characters-tab .dropdown-field select {
    min-height: 34px;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}


/* Ensure character section doesn't get cut off */

.characters-tab .dropdown-content {
    margin-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    position: relative;
    top: 0;
}

.characters-tab .dropdown-field textarea,
.characters-tab .dropdown-field select {
    min-height: 34px;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.dropdown-field label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.dropdown-field label i {
    color: var(--primary);
    width: 16px;
}

.dropdown-field textarea,
.dropdown-field select {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all var(--transition);
    resize: vertical;
    min-height: 2.5rem;
}


/* Ensure dark mode visibility for input fields */

[data-theme="dark"] .dropdown-field textarea,
[data-theme="dark"] .dropdown-field select,
[data-theme="dark"] #userInput,
[data-theme="dark"] .character-input,
[data-theme="dark"] .mobile-textarea {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #4a4a4a;
}

[data-theme="dark"] .dropdown-field textarea:focus,
[data-theme="dark"] .dropdown-field select:focus,
[data-theme="dark"] #userInput:focus,
[data-theme="dark"] .character-input:focus,
[data-theme="dark"] .mobile-textarea:focus {
    background: #333333;
    color: #ffffff;
    border-color: var(--primary);
}

.dropdown-field textarea:focus,
.dropdown-field select:focus {
    outline: 2px solid var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dropdown-field select {
    min-height: 45px;
    cursor: pointer;
}


/* Compact dropdown options for all select elements in dropdown fields */

.dropdown-field select option {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
    height: 28px;
    margin: 1px 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
}


/* Settings panel specific compact options */

#settings-dropdown .dropdown-field select {
    min-height: 28px;
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
}

#settings-dropdown .dropdown-field select option {
    padding: 0.2rem 0.3rem;
    font-size: 0.7rem;
    line-height: 1.1;
    height: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}


/* Compact settings panel */

#settings-dropdown {
    max-height: 70vh;
    overflow-y: auto;
}

#settings-dropdown select {
    min-height: 28px;
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
}

#settings-dropdown label {
    font-size: 0.7rem;
    margin-bottom: 0.1rem;
}


/* Mobile optimizations for dropdown panels */

@media (max-width: 768px) {
    .dropdown-content {
        padding: 0.75rem;
        max-width: 100%;
        position: relative;
        top: 0;
        margin-top: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        max-height: 60vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    /* Mobile settings panel */
    #settings-dropdown {
        width: 90vw !important;
        max-width: 280px;
        max-height: 65vh;
        padding: 0.5rem;
    }
    #settings-dropdown .space-y-2>div {
        margin-bottom: 0.3rem;
    }
    #settings-dropdown select {
        min-height: 24px;
        padding: 0.2rem 0.3rem;
        font-size: 0.7rem;
    }
    #settings-dropdown label {
        font-size: 0.65rem;
    }
    .dropdown-panel {
        width: 95vw !important;
        max-width: 350px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        position: relative;
        margin-top: 0.5rem;
        z-index: 100;
    }
    .dropdown-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    .dropdown-field textarea,
    .dropdown-field select {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
    /* Mobile character section compact layout */
    .characters-tab .dropdown-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 0.4rem;
    }
    .characters-tab .dropdown-field textarea,
    .characters-tab .dropdown-field select {
        min-height: 30px;
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
    }
    .characters-tab .dropdown-field label {
        font-size: 0.7rem;
        margin-bottom: 0.1rem;
    }
    /* Compact options for mobile dropdown fields */
    .dropdown-field select option {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
        line-height: 1.1;
        height: 22px;
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    .dropdown-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    .dropdown-controls {
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }
    .professional-note {
        padding: 0.6rem;
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    .dropdown-content {
        padding: 0.5rem;
    }
    .dropdown-field {
        gap: 0.3rem;
    }
    .dropdown-field label {
        font-size: 0.8rem;
    }
    .dropdown-field textarea,
    .dropdown-field select {
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
        min-height: 28px;
    }
    /* Extra compact character fields for small screens */
    .characters-tab .dropdown-grid {
        grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
        gap: 0.3rem;
    }
    .characters-tab .dropdown-field textarea,
    .characters-tab .dropdown-field select {
        min-height: 26px;
        padding: 0.25rem 0.3rem;
        font-size: 0.65rem;
    }
    .characters-tab .dropdown-field label {
        font-size: 0.65rem;
        margin-bottom: 0.1rem;
    }
}


/* Unified Settings Dropdown - Mobile Optimized */

.unified-settings-dropdown {
    margin-top: var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.unified-settings-dropdown .dropdown-toggle {
    width: 100%;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border: none;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.unified-settings-dropdown .dropdown-toggle:hover {
    background: linear-gradient(135deg, var(--primary), var(--raogy-brand));
    color: var(--text-inverse);
}

.unified-settings-dropdown .dropdown-toggle.active {
    background: linear-gradient(135deg, var(--primary), var(--raogy-brand));
    color: var(--text-inverse);
}

.unified-settings-dropdown .dropdown-content {
    display: none;
    padding: var(--space-md);
    background: var(--bg-primary);
    animation: slideDown 0.3s ease-out;
}

.unified-settings-dropdown .dropdown-content.active {
    display: block;
}


/* Mobile-Optimized Tabs */

.mobile-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.6rem 0.4rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 70px;
    white-space: nowrap;
}

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

.tab-btn.active {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.tab-btn i {
    font-size: 1rem;
}


/* Tab Content */

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

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

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


/* Mobile Config Grid */

.mobile-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}


/* Compact mobile character fields */

.mobile-config-grid .mobile-field {
    gap: 0.3rem;
}

.mobile-config-grid .mobile-field label {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.mobile-config-grid .mobile-field select,
.mobile-config-grid .mobile-textarea {
    min-height: 32px;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
}

.mobile-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-field label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.mobile-field label i {
    color: var(--primary);
    width: 16px;
    font-size: 0.9rem;
}

.mobile-field select,
.mobile-textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition);
    resize: vertical;
}


/* Compact mobile dropdown options */

.mobile-field select option {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
    height: 26px;
    margin: 1px 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mobile-field select:focus,
.mobile-textarea:focus {
    outline: 2px solid var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}


/* Mobile Character Management */

.mobile-field.characters-section .character-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.mobile-remove-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    align-self: flex-end;
    min-width: 80px;
}

.mobile-remove-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.mobile-add-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
}

.mobile-add-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}


/* Mobile Control Buttons */

.mobile-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.mobile-control-btn {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}

.mobile-control-btn:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: translateY(-1px);
}


/* Enhanced Characters Section */

.characters-section {
    grid-column: 1 / -1;
    /* Full width */
}

.characters-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.character-input-group {
    position: relative;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    animation: fadeInUp 0.3s ease-out;
}

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

.character-input-group:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.character-input {
    flex: 1;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition);
    resize: vertical;
    min-height: 80px;
}

[data-theme="dark"] .character-input {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #4a4a4a;
}

.character-input:focus {
    outline: 2px solid var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.remove-character-btn {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
    margin-top: var(--space-md);
}

.remove-character-btn:hover {
    background: linear-gradient(135deg, #dc2626, var(--danger));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.add-character-btn {
    background: linear-gradient(135deg, var(--secondary), #059669);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.add-character-btn:hover {
    background: linear-gradient(135deg, #059669, var(--secondary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.add-character-btn i {
    font-size: 1rem;
}


/* NEW: Generate Button Container */

.generate-button-container {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 1rem 0;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(59, 130, 246, 0.05));
    border-radius: var(--radius-lg);
}

.generate-button-container .generate-btn {
    background: linear-gradient(135deg, var(--raogy-brand), var(--primary));
    color: var(--text-inverse);
    font-size: 1rem;
    padding: 0.9rem 2rem;
    box-shadow: var(--shadow-lg);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.generate-button-container .generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.generate-button-container .generate-btn:hover::before {
    left: 100%;
}

.generate-button-container .generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--primary), var(--raogy-brand));
    scale: 1.05;
}

.generate-button-container .generate-btn i {
    font-size: 1.3rem;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-10deg) scale(1.1);
    }
    75% {
        transform: rotate(10deg) scale(1.1);
    }
}


/* Toggle Container for Mobile Optimization */

.toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}


/* Responsive spacing optimization */

@media (max-width: 768px) {
    .toggle-container {
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .toggle-container {
        margin-top: 10px;
    }
}


/* Control Toggle Styles */

.control-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    transition: all var(--transition);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.control-toggle:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.control-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.control-toggle span {
    white-space: nowrap;
    user-select: none;
}


/* Mobile-first responsive design for toggle */

@media (max-width: 768px) {
    .toggle-container {
        margin-top: 15px;
        width: 100%;
    }
    .control-toggle {
        width: auto;
        max-width: 250px;
        justify-content: center;
        padding: 8px 16px;
        font-size: 13px;
        margin: 0 auto;
    }
    .control-toggle span {
        font-size: 13px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .toggle-container {
        margin-top: 12px;
    }
    .control-toggle {
        max-width: 200px;
        padding: 6px 12px;
        font-size: 12px;
    }
    .control-toggle span {
        font-size: 12px;
    }
    .control-toggle input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 769px) {
    .toggle-container {
        margin-top: 15px;
    }
    .control-toggle {
        padding: 8px 16px;
        font-size: 14px;
    }
}


/* Configuration Section (Updated) */

.config-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary);
}


/* Config Section Full */

.config-section-full {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary);
    animation: slideDown 0.3s ease-out;
}

.config-content h2 {
    color: var(--secondary);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.config-card {
    background: var(--bg-tertiary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.config-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.config-card h3 {
    color: var(--secondary);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
}

.config-field {
    margin-bottom: var(--space-md);
}

.config-field:last-child {
    margin-bottom: 0;
}

.config-field label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.config-field label i {
    color: var(--secondary);
    width: 16px;
}

.config-field select {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition);
    cursor: pointer;
}

.config-field select:focus {
    outline: 2px solid var(--secondary);
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.config-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.config-action-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
}

.config-action-btn:hover {
    background: var(--secondary);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.config-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 400px;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-group label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.config-group label i {
    color: var(--secondary);
    width: 16px;
}


/* Sections */

section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.section-header h2,
.section-header h3 {
    font-size: 1.375rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.8;
}


/* Input & Config */

.input-container {
    position: relative;
}

textarea,
input[type="number"],
select {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition);
    box-sizing: border-box;
}


/* Global compact styling for all select options */

select option {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    line-height: 1.2;
    height: 30px;
    margin: 1px 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

textarea:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}


/* Buttons */

.control-btn {
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    text-decoration: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    line-height: 1.25;
    white-space: nowrap;
}

.control-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* Scene Header with Copy Button */

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.scene-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scene-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(96, 165, 250, 0.1));
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-md);
    border-left: 4px solid #60a5fa;
    font-weight: 700;
}

.scene-copy-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.scene-copy-btn:hover {
    background: var(--primary);
    color: var(--text-inverse);
}


/* Dialogue Length Indicator */

.dialogue-length {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    margin-left: 0.5rem;
    font-weight: 600;
}

.dialogue-length.perfect {
    background: var(--success);
    color: white;
}

.dialogue-length.short {
    background: var(--warning);
    color: white;
}

.dialogue-length.long {
    background: var(--danger);
    color: white;
}


/* Enhanced Results Controls */

.results-controls {
    display: flex;
    gap: 0.375rem;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results-controls .control-btn {
    flex: none;
    min-width: auto;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.results-controls .control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.results-controls .control-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.results-controls .control-btn:hover::before {
    left: 100%;
}

.results-controls .control-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.results-controls .control-btn i {
    font-size: 0.875rem;
}


/* Special styling for the Advanced Export dropdown */

.results-controls .relative {
    display: inline-flex;
}

.results-controls .relative .control-btn {
    border-radius: 8px;
}


/* Add subtle animation for the entire controls container */

.results-controls {
    animation: slideInFromTop 0.3s ease-out;
}

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


/* Storyboard Results */

.storyboard-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.storyboard-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scene-detail {
    margin-bottom: 1rem;
}

.scene-detail h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(147, 197, 253, 0.1));
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-md);
    border-left: 3px solid #60a5fa;
}

.scene-detail p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Transition Detail Styling */
.transition-detail {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(74, 222, 128, 0.1));
    border-radius: var(--radius-md);
    padding: 0.8rem;
    margin-top: 1rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.transition-detail h5 {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(74, 222, 128, 0.15));
    border-left: 3px solid #22c55e;
    color: #22c55e;
}

.transition-instruction {
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(34, 197, 94, 0.05);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border-left: 2px solid #22c55e;
    font-style: italic;
}

[data-theme="dark"] .transition-detail {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(74, 222, 128, 0.08));
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .transition-instruction {
    background: rgba(34, 197, 94, 0.08);
    color: var(--text-primary);
}

.dialogue-text {
    font-style: italic;
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary);
}

.scene-meta {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}


/* Scene JSON Controls */

.scene-json-controls {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.scene-json-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.scene-json-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.scene-json-btn i {
    font-size: 12px;
}


/* Mobile optimization for scene JSON button */

@media (max-width: 768px) {
    .scene-json-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .scene-json-btn i {
        font-size: 11px;
    }
}


/* Consistent Prompts & Overview */

#storyboardOverview,
#consistentPromptsContainer {
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-color);
}

#consistentPromptsContainer h4,
#storyboardOverview h4 {
    margin-top: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* Consistent Assets Header with Copy Button */

.consistent-assets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.consistent-assets-header h4 {
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.consistent-assets-header .control-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.consistent-assets-content {
    margin-top: 0.5rem;
}

#consistentPromptsContainer h5 {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin: 1rem 0 0.5rem 0;
}

#consistentPromptsContainer div:not(:last-child) {
    margin-bottom: 1rem;
}

#consistentPromptsContainer p,
#storyboardOverview p {
    margin: 0;
    line-height: 1.6;
}


/* Enhanced Results Scroll Animation */

#generatedStoryboardHeader {
    scroll-margin-top: 2rem;
    position: relative;
}

#generatedStoryboardHeader::before {
    content: '🎬';
    position: absolute;
    left: -2rem;
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

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

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--raogy-brand) 100%);
    color: white;
    padding: 25px 30px 20px;
    border-radius: 18px 18px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.popup-body {
    padding: 30px;
}

.popup-body p {
    margin: 0 0 15px 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    text-align: center;
}

.popup-body p:first-child {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.popup-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.popup-benefits .benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.popup-benefits .benefit-item i {
    color: var(--success);
    font-size: 16px;
}


/* Mobile optimization for popup */

@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        margin: 20px;
    }
    .popup-header {
        padding: 20px 25px 15px;
    }
    .popup-header h3 {
        font-size: 1.2rem;
    }
    .popup-body {
        padding: 25px 20px;
    }
}


/* Icons should always be visible (mobile adjustments) */

@media (max-width: 480px) {
    .popup-content {
        width: 98%;
        margin: 10px;
    }
    .popup-header {
        padding: 18px 20px 12px;
    }
    .popup-header h3 {
        font-size: 1.1rem;
    }
    .popup-body {
        padding: 20px 15px;
    }
}


/* Footer Styles - Enhanced Design */

.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-xl) 0;
    margin-top: var(--space-xl);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.footer-brand h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.footer-brand p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    flex-direction: row;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    margin: 0;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
}


/* Dark mode improvements for footer links */

[data-theme="dark"] .footer-links a {
    color: #e2e8f0;
    /* Brighter text for better visibility */
    border-color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .footer-links a:hover {
    color: #ffffff;
    /* Pure white on hover */
    background: var(--primary);
    border-color: var(--primary);
}

.footer-links a:hover {
    color: var(--primary);
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
}

.footer-links a i {
    width: 12px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.footer-links a:hover i {
    color: var(--primary);
}

.footer-info {
    display: none;
}


/* Footer Copyright Styles */

.footer-copyright {
    text-align: center;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-md);
}

.footer-copyright p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.4;
}

[data-theme="dark"] .footer-copyright p {
    color: var(--text-secondary);
}


/* Mobile Footer Copyright Styles */

@media(max-width: 768px) {
    .footer-copyright {
        padding: var(--space-md) 0;
        margin-top: var(--space-md);
    }
    .footer-copyright p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

@media(max-width: 480px) {
    .footer-copyright {
        padding: var(--space-xs) 0;
        margin-top: var(--space-xs);
        margin-bottom: 0;
    }
    .footer-copyright p {
        font-size: 0.8rem;
        line-height: 1.6;
        padding: 0 var(--space-sm);
        margin-bottom: 0;
    }
}


/* Fixed Scroll to Top Button */

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--raogy-brand), var(--primary));
    color: var(--text-inverse);
    border: none;
    border-radius: 50%;
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}


/* Consistent mobile sidebar menu item styles */

.mobile-sidebar .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.mobile-sidebar .menu-item i,
.mobile-sidebar .menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mobile-sidebar .menu-item span {
    font-size: 0.95rem;
}

.mobile-sidebar .menu-item:hover {
    background: var(--bg-tertiary);
}

.mobile-sidebar .menu-item.active {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.mobile-sidebar .menu-item.active:hover {
    background: transparent !important;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--primary), var(--raogy-brand));
}

.scroll-to-top i {
    font-size: 16px;
    animation: bounceUp 2s infinite;
}

.scroll-to-top span {
    font-family: inherit;
    font-weight: 600;
}

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


/* Mobile Scroll Button */

@media (max-width: 768px) {
    .scroll-to-top {
        width: 20px;
        height: 20px;
        padding: 4px;
        bottom: 12px;
        right: 12px;
        font-size: 12px;
        box-shadow: 0 1px 6px rgba(99, 102, 241, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    .scroll-to-top i {
        font-size: 12px;
    }
    .scroll-to-top:hover {
        transform: translateY(-1px) scale(1.02);
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }
}


/* Loading & Toast */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}


/* Script Templates Modal */

.templates-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.templates-modal-backdrop.active {
    display: flex;
}

.templates-modal {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.templates-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.templates-modal .modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.templates-modal .modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.template-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #6366f1;
}

.template-card.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.template-card .template-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.template-card .template-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 14px;
}

.template-card .template-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.template-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.template-preview h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.template-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.template-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.template-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.template-field input,
.template-field textarea {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

.template-field textarea {
    min-height: 60px;
    resize: vertical;
}

.template-preview-text {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

.templates-modal .modal-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.templates-modal .modal-action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.templates-modal .modal-action-btn:hover {
    background: var(--bg-tertiary);
}

.templates-modal .modal-action-btn.primary {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.templates-modal .modal-action-btn.primary:hover {
    background: #5558dd;
    border-color: #5558dd;
}


/* Responsive Templates Modal for Mobile */

@media (max-width: 768px) {
    .templates-modal {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        height: 95vh;
        border-radius: 12px 12px 0 0;
        margin: 0;
        position: fixed;
        bottom: 0;
        top: auto;
    }
    .templates-modal .modal-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        background: var(--bg-primary);
        z-index: 10;
        border-bottom: 1px solid var(--border-color);
    }
    .templates-modal .modal-header h3 {
        font-size: 16px;
    }
    .templates-modal .modal-content {
        padding: 12px 16px;
        padding-bottom: 70px;
        /* Space for fixed actions */
    }
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        margin-bottom: 16px;
    }
    .template-card {
        padding: 10px;
        border-radius: 6px;
    }
    .template-card .template-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }
    .template-card .template-name {
        font-size: 12px;
        margin-bottom: 4px;
        line-height: 1.3;
    }
    .template-card .template-description {
        font-size: 10px;
        line-height: 1.3;
    }
    .template-preview {
        padding: 12px;
        border-radius: 6px;
    }
    .template-preview h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    .template-fields {
        gap: 10px;
        margin-bottom: 16px;
    }
    .template-field label {
        font-size: 11px;
    }
    .template-field input,
    .template-field textarea {
        font-size: 14px;
        padding: 8px 10px;
        border-radius: 4px;
    }
    .template-preview-text {
        min-height: 100px;
        font-size: 12px;
        padding: 10px;
        border-radius: 4px;
    }
    .templates-modal .modal-actions {
        padding: 12px 16px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        justify-content: center;
        gap: 8px;
    }
    .templates-modal .modal-action-btn {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 6px;
        flex: 1;
        max-width: 120px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .templates-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .template-card {
        padding: 8px;
    }
    .template-card .template-icon {
        font-size: 20px;
        margin-bottom: 4px;
    }
    .template-card .template-name {
        font-size: 11px;
    }
    .template-card .template-description {
        font-size: 9px;
    }
}

.loading-content {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    max-width: 320px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.loading-content h3 {
    margin: 0 0 0.4rem 0;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.loading-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.75rem;
}

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


/* Mobile optimization for loading modal */

@media (max-width: 768px) {
    .loading-content {
        padding: 1.2rem;
        max-width: 280px;
        border-radius: 10px;
    }
    .loading-spinner {
        width: 28px;
        height: 28px;
        border-width: 2.5px;
        margin-bottom: 0.6rem;
    }
    .loading-content h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    .loading-content p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .loading-content {
        padding: 1rem;
        max-width: 260px;
        border-radius: 8px;
    }
    .loading-spinner {
        width: 24px;
        height: 24px;
        border-width: 2px;
        margin-bottom: 0.5rem;
    }
}

#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

.toast {
    background: var(--bg-primary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    animation: slideIn 0.3s;
    margin-bottom: 0.5rem;
    max-width: 220px;
    font-size: 0.8rem;
}

.toast.compact-toast {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    max-width: 180px;
}

.toast.success {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
    font-weight: 600;
}

.toast.error {
    border-color: var(--danger);
}

.toast.warning {
    border-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}


/* Mobile responsive fixes */


/* Responsive Text Changes */

.generate-text-mobile,
.download-text-mobile {
    display: none;
}

.generate-text-desktop,
.download-text-desktop {
    display: inline;
}

@media(max-width: 768px) {
    body {
        font-size: 14px;
    }
    .generate-text-desktop,
    .download-text-desktop {
        display: none;
    }
    .generate-text-mobile,
    .download-text-mobile {
        display: inline;
    }
    .container {
        padding: 0.5rem;
        padding-bottom: 20px;
        max-width: 100%;
        margin: 0 auto;
    }
    /* Specific mobile styles for blog and tutorial pages */
    .blog-page .container,
    .tutorial-page .container {
        padding: 1rem;
        max-width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }
    /* Ensure article content is properly spaced on mobile */
    .blog-page .article-container,
    .tutorial-page .article-container {
        padding: 0;
        width: 100%;
    }
    /* Mobile-specific textarea sizing */
    #userInput {
        min-height: 120px;
        max-height: 200px;
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    /* Fix header layout on mobile */
    .header {
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .logo {
        flex: none;
        text-align: center;
    }
    .logo h1 {
        font-size: 1rem;
        gap: 0.3rem;
        line-height: 1.2;
        justify-content: center;
    }
    .by-raogy {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
    .brand-tagline {
        font-size: 0.65rem;
        margin: 0.1rem 0 0 0;
        display: none;
        /* Hide tagline on mobile for space */
    }
    .header-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .about-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        min-height: 32px;
    }
    .theme-toggle {
        width: 32px;
        height: 32px;
        min-height: 32px;
    }
    .theme-toggle i {
        font-size: 0.8rem;
    }
    .api-status {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        min-height: 32px;
        gap: 0.3rem;
    }
    .api-status .status-text {
        display: inline;
        /* Show status text on mobile */
        font-size: 0.6rem;
    }
    .api-status::after {
        display: none;
        /* Remove the "Ready" text */
    }
    /* Fix main input section spacing */
    .main-input-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    .section-header {
        margin-bottom: 1rem;
    }
    .section-header h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    .section-subtitle {
        font-size: 0.8rem;
    }
    /* NEW: Reorganized mobile layout order */
    /* 1. Dialogue status - smaller and first */
    .dialogue-status {
        order: 1;
        justify-content: center;
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        min-height: 28px;
        margin-bottom: 0.5rem;
        background: var(--bg-tertiary);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
    }
    .dialogue-status .status-text {
        font-size: 0.7rem;
    }
    /* 2. Settings dropdown - second */
    .unified-settings-dropdown {
        order: 2;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
    /* 3. Template button - third */
    /* 4. Generate button - last */
    .generate-button-container {
        order: 4;
        margin-top: 1rem;
        margin-bottom: 1rem;
        padding: 0.75rem 0;
        border-radius: var(--radius-md);
    }
    /* Fix input controls layout for new order */
    .input-controls {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    .control-btn {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 1rem;
    }
    .generate-button-container .generate-btn {
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
        width: 100%;
        max-width: 300px;
    }
    /* Fix unified settings dropdown */
    .unified-settings-dropdown .dropdown-toggle {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    .unified-settings-dropdown .dropdown-toggle span {
        font-size: 0.85rem;
    }
    .unified-settings-dropdown .dropdown-content {
        padding: 0.75rem;
    }
    .mobile-tabs {
        gap: 1px;
        padding: 2px;
    }
    .tab-btn {
        padding: 0.5rem 0.3rem;
        font-size: 0.7rem;
        min-width: 60px;
    }
    .tab-btn i {
        font-size: 0.9rem;
    }
    .mobile-field label {
        font-size: 0.85rem;
    }
    .mobile-field select,
    .mobile-textarea {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    /* Mobile compact select options */
    .mobile-field select option {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
        line-height: 1.1;
        height: 24px;
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    /* Mobile dropdown field options */
    .dropdown-field select option {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
        height: 24px;
    }
    .mobile-control-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
    .mobile-add-btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    .mobile-field.characters-section .character-input-group {
        padding: 0.75rem;
    }
    .mobile-remove-btn {
        padding: 0.4rem;
        font-size: 0.8rem;
        min-width: 70px;
    }
    /* Fix sections spacing */
    section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    /* Fix results section */
    .results-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
    .results-controls .control-btn {
        flex: 1 1 auto;
        min-width: 80px;
        max-width: 140px;
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        gap: 0.25rem;
    }
    .results-controls .control-btn i {
        font-size: 0.75rem;
    }
    /* Stack buttons in 2 rows on very small screens */
    @media (max-width: 380px) {
        .results-controls .control-btn {
            flex: 1 1 calc(50% - 0.125rem);
            min-width: 0;
        }
    }
    /* Fix storyboard cards */
    .storyboard-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    .scene-header {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        text-align: center;
    }
    .scene-header-actions {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }
    .scene-copy-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        flex: 0 1 auto;
        min-width: auto;
    }
    /* Fix footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-lg);
        padding: 0 1rem;
    }
    .footer-brand h3 {
        font-size: 1.5rem;
    }
    .footer-links {
        align-items: center;
    }
    .footer-links a {
        min-width: 180px;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    /* Fix scroll to top button */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        padding: 8px 14px;
        font-size: 0.75rem;
        min-width: 100px;
    }
    .scroll-to-top span {
        font-size: 0.75rem;
    }
    /* Fix about and how-to-use sections */
    .about-grid {
        grid-template-columns: 1fr;
    }
    .step-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    .feature-grid,
    .tips-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }
    .export-options {
        grid-template-columns: 1fr;
    }
    /* Fix toast positioning */
    #toastContainer {
        top: 20px;
        bottom: auto;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
    .toast {
        max-width: 280px;
        font-size: 0.9rem;
        padding: 0.8rem 1.2rem;
    }
    .toast.compact-toast {
        max-width: 250px;
        font-size: 0.85rem;
        padding: 0.7rem 1rem;
    }
    /* Fix character management */
    .characters-container {
        gap: 0.75rem;
    }
    .character-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    .remove-character-btn {
        margin-top: 0;
        width: 100%;
        height: auto;
        padding: 0.5rem 1rem;
    }
    .professional-note {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    .professional-note i {
        align-self: center;
        margin-top: 0;
    }
}

@media(max-width: 480px) {
    /* Extra small mobile screens - further reduce textarea */
    #userInput {
        min-height: 100px;
        max-height: 160px;
        font-size: 13px;
        padding: 0.75rem;
    }
    .header {
        padding: 0.5rem;
        border-radius: var(--radius-md);
    }
    .logo h1 {
        font-size: 0.85rem;
        gap: 0.25rem;
        line-height: 1.1;
    }
    .logo h1 i {
        font-size: 0.8rem;
    }
    .by-raogy {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
    }
    .brand-tagline {
        display: none;
    }
    .header-controls {
        gap: 0.25rem;
    }
    .about-btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
        min-height: 28px;
        gap: 0.2rem;
    }
    .about-btn span {
        display: none;
        /* Hide text, show only icons on very small screens */
    }
    .theme-toggle {
        width: 28px;
        height: 28px;
        min-height: 28px;
    }
    .theme-toggle i {
        font-size: 0.75rem;
    }
    .api-status {
        padding: 0.25rem 0.4rem;
        min-height: 28px;
    }
    .api-status .status-dot {
        width: 6px;
        height: 6px;
    }
    /* Fix main input section for very small screens */
    .main-input-section {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    .section-header h2 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    .section-subtitle {
        font-size: 0.75rem;
    }
    /* Even smaller dialogue status for very small screens */
    .dialogue-status {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        min-height: 24px;
    }
    .dialogue-status .status-text {
        font-size: 0.65rem;
    }
    /* Smaller template button */
    /* Fix results controls for very small screens */
    .results-controls {
        flex-direction: column;
    }
    .results-controls .control-btn {
        width: 100%;
        flex: none;
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    /* Fix scene header for very small screens */
    .scene-header {
        gap: 0.75rem;
    }
    .scene-copy-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.75rem;
    }
    /* Hide decorative elements on very small screens */
    #generatedStoryboardHeader::before {
        display: none;
    }
    /* Fix footer for very small screens */
    .footer-content {
        padding: 0 1rem;
    }
    .footer-brand h3 {
        font-size: 1.3rem;
    }
    .footer-links a {
        min-width: 160px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    /* Fix scroll to top button for very small screens */
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        padding: 6px 10px;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        min-width: unset;
        justify-content: center;
    }
    .scroll-to-top span {
        display: none;
    }
    .scroll-to-top i {
        font-size: 1.1rem;
    }
    /* Fix dropdown controls for very small screens */
    .dropdown-controls {
        gap: 0.5rem;
    }
    .dropdown-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    /* Fix generate button for very small screens */
    .generate-button-container .generate-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
    /* Fix character management for very small screens */
    .characters-section {
        grid-column: auto;
    }
    .character-input {
        min-height: 60px;
    }
    .professional-note {
        font-size: 0.85rem;
        padding: var(--space-md);
    }
    /* Configuration section mobile styles */
    .config-section {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    .config-area {
        max-width: 100%;
    }
    .config-group {
        gap: 0.3rem;
    }
    .config-group label {
        font-size: 0.85rem;
    }
    .config-group select {
        padding: 0.5rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
    .section-header {
        margin-bottom: 1rem;
    }
    .section-header h3 {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }
    .section-subtitle {
        font-size: 0.75rem;
    }
}


/* Additional mobile fixes for overlapping elements */

@media(max-width: 768px) {
    /* Ensure proper spacing between sections */
    .main-input-section,
    .about-section,
    .how-to-use-section,
    .config-section-full,
    #resultsSection {
        margin-bottom: 1.5rem;
        margin-top: 2rem;
    }
    /* Specific spacing for results section to maintain visual separation */
    #resultsSection {
        margin-top: 3rem;
        padding-top: 2rem;
        border-top: 1px solid var(--border-color);
        background: var(--bg-primary);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
    }
    /* Generate button container spacing */
    .flex.justify-center.pt-4 {
        margin-bottom: 3rem;
        padding-bottom: 2rem;
    }
    /* Fix any potential z-index issues */
    .header {
        z-index: 100;
        position: relative;
    }
    .generate-button-container {
        position: relative;
        z-index: 10;
    }
    /* Ensure proper button visibility */
    .generate-btn {
        position: relative;
        z-index: 5;
    }
    /* Fix any floating elements */
    .scroll-to-top {
        z-index: 1000;
    }
    #toastContainer {
        z-index: 1001;
    }
    /* Ensure modals appear above everything */
    .analytics-modal,
    .collaboration-modal {
        z-index: 2000;
    }
}


/* Prevent horizontal scrolling on mobile */

@media(max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    .container {
        overflow-x: hidden;
    }
    /* Ensure all content fits within viewport */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
}


/* Analytics Modal Styles */

.analytics-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.analytics-modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease-out;
}

.analytics-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.analytics-modal-header h3 {
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-close-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
}

.analytics-close-btn:hover {
    background: var(--danger);
    color: white;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.analytics-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.analytics-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

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

.analytics-card h4 {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.analytics-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.analytics-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.analytics-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.chart-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.chart-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.activity-timeline {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: var(--space-md);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    min-width: 80px;
    font-weight: 600;
}

.activity-desc {
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
}

.export-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.export-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.export-stat span:first-child {
    color: var(--text-secondary);
}

.export-stat span:last-child {
    color: var(--primary);
    font-weight: 600;
}

.analytics-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.analytics-action-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
}

.analytics-action-btn:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


/* Collaboration Modal Styles */

.collaboration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.collaboration-modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease-out;
}

.collaboration-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.collaboration-modal-header h3 {
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collaboration-close-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
}

.collaboration-close-btn:hover {
    background: var(--danger);
    color: white;
}


/* Collaboration Tabs */

.collaboration-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.collab-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    min-width: 120px;
}

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

.collab-tab-btn.active {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}


/* Collaboration Content */

.collaboration-content {
    min-height: 400px;
}

.collab-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

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


/* Share Section */

.share-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.share-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-link-container input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.85rem;
}

.copy-link-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.copy-link-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.share-note {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}


/* QR Code Section */

.qr-code-container {
    margin-bottom: 1rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
}

.qr-placeholder {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

.qr-code {
    text-align: center;
}

.qr-pattern {
    width: 100px;
    height: 100px;
    background: repeating-linear-gradient( 0deg, var(--text-primary) 0px, var(--text-primary) 2px, transparent 2px, transparent 8px), repeating-linear-gradient( 90deg, var(--text-primary) 0px, var(--text-primary) 2px, transparent 2px, transparent 8px);
    margin: 0 auto 0.5rem;
    border-radius: var(--radius-md);
}

.qr-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.generate-qr-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    width: 100%;
    justify-content: center;
}

.generate-qr-btn:hover {
    background: var(--raogy-brand);
    transform: translateY(-1px);
}


/* Comments Section */

.comments-section {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.comments-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.comments-container {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.no-comments {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--space-lg);
}

.comment-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-scene {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.comment-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.add-comment-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.add-comment-section select,
.add-comment-section textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}

.add-comment-section textarea {
    resize: vertical;
    min-height: 80px;
}

.add-comment-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
}

.add-comment-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}


/* Version History Section */

.history-section {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.history-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.version-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.no-versions {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--space-lg);
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary);
}

.version-item:last-child {
    margin-bottom: 0;
}

.version-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.version-name {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

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

.version-actions {
    display: flex;
    gap: 0.5rem;
}

.version-btn {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.version-btn:hover {
    background: var(--primary);
    color: white;
}

.version-btn:last-child:hover {
    background: var(--danger);
}

.save-version-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    width: 100%;
}

.save-version-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}


/* Mobile responsive for modals */

@media(max-width: 768px) {
    .analytics-modal-content,
    .collaboration-modal-content {
        width: 95%;
        padding: var(--space-lg);
        max-height: 90vh;
    }
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    .analytics-charts {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    .analytics-number {
        font-size: 2rem;
    }
    .analytics-card {
        padding: var(--space-md);
    }
    .chart-section {
        padding: var(--space-md);
    }
    .analytics-actions {
        flex-direction: column;
        align-items: center;
    }
    .analytics-action-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    .collaboration-tabs {
        gap: 1px;
        padding: 2px;
    }
    .collab-tab-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        min-width: 100px;
    }
    .share-link-container {
        flex-direction: column;
    }
    .copy-link-btn {
        width: 100%;
        justify-content: center;
    }
    .version-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .version-actions {
        width: 100%;
        justify-content: space-between;
    }
    .version-btn {
        flex: 1;
        justify-content: center;
    }
}

@media(max-width: 480px) {
    .analytics-modal-content,
    .collaboration-modal-content {
        padding: var(--space-md);
    }
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .analytics-number {
        font-size: 1.8rem;
    }
    .analytics-card h4 {
        font-size: 0.85rem;
    }
    .activity-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    .activity-time {
        min-width: auto;
        font-size: 0.75rem;
    }
    .activity-desc {
        font-size: 0.85rem;
    }
    .collaboration-tabs {
        flex-direction: column;
        gap: 1px;
    }
    .collab-tab-btn {
        min-width: auto;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    .share-section,
    .comments-section,
    .history-section {
        padding: var(--space-md);
    }
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .add-comment-section textarea {
        min-height: 60px;
    }
}


/* Consistency Scene Styles */

.consistency-scene {
    border-left: 4px solid var(--secondary) !important;
    background: linear-gradient(135deg, var(--bg-secondary), rgba(16, 185, 129, 0.05)) !important;
    position: relative;
}

.consistency-scene::before {
    content: '🎬 Veo 3 Consistency';
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 10;
}

.consistency-header h4 {
    color: var(--secondary) !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1)) !important;
    border-left: 4px solid var(--secondary) !important;
}

.consistency-badge {
    background: var(--secondary);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
    display: inline-block;
}

.consistency-note {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.consistency-note i {
    color: var(--secondary);
}


/* Enhanced scene detail styling for consistency scenes */

.consistency-scene .scene-detail h5 {
    color: var(--secondary) !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1)) !important;
    border-left: 3px solid var(--secondary) !important;
}

.consistency-scene .dialogue-text {
    background: rgba(16, 185, 129, 0.1) !important;
    border-left: 3px solid var(--secondary) !important;
    font-style: italic;
    color: var(--text-primary);
}


/* Mobile responsive for consistency scenes */

@media(max-width: 768px) {
    .consistency-scene::before {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
        top: -8px;
        left: 8px;
    }
    .consistency-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }
    .consistency-note {
        font-size: 0.7rem;
    }
}

@media(max-width: 480px) {
    .consistency-scene::before {
        font-size: 0.55rem;
        padding: 0.15rem 0.3rem;
        top: -6px;
        left: 6px;
    }
    .consistency-badge {
        font-size: 0.55rem;
        padding: 0.1rem 0.25rem;
    }
    .consistency-note {
        font-size: 0.65rem;
    }
}


/* Guide Section */

.guide-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.guide-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.guide-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.guide-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.guide-step {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

.step-number {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.step-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.example-box {
    background: rgba(147, 197, 253, 0.1);
    border: 1px solid rgba(147, 197, 253, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

[data-theme="dark"] .example-box {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.2);
}

.pro-tip {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin: var(--space-sm) 0;
    font-size: 0.9rem;
}

[data-theme="dark"] .pro-tip {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.2);
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin: var(--space-sm) 0;
    font-size: 0.9rem;
}

[data-theme="dark"] .warning-box {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
}

.step-features {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0;
}

.step-features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.step-features li i {
    color: #22c55e;
    font-size: 0.9rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin: var(--space-md) 0;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.setting-item i {
    color: #7c3aed;
    font-size: 1rem;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin: var(--space-md) 0;
}

.export-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.export-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.export-option i {
    color: #7c3aed;
    font-size: 1rem;
}

.guide-tips {
    margin: var(--space-xl) 0;
}

.guide-tips h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.tip-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tip-card i {
    font-size: 2rem;
    color: #7c3aed;
    margin-bottom: var(--space-sm);
}

.tip-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.tip-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.guide-troubleshooting {
    margin: var(--space-xl) 0 0 0;
}

.guide-troubleshooting h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.trouble-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.trouble-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.trouble-item i {
    font-size: 1.5rem;
    color: #f59e0b;
    margin-bottom: var(--space-sm);
}

.trouble-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.trouble-item p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}


/* Mobile responsive for guide section */

@media(max-width: 768px) {
    .guide-section {
        padding: var(--space-lg);
        margin: var(--space-lg) 0;
    }
    .guide-header h2 {
        font-size: 1.5rem;
    }
    .guide-header p {
        font-size: 1rem;
    }
    .guide-steps {
        gap: var(--space-lg);
    }
    .guide-step {
        flex-direction: column;
        gap: var(--space-md);
    }
    .step-number {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    .step-content h3 {
        font-size: 1.2rem;
    }
    .settings-grid,
    .export-options,
    .tips-grid,
    .troubleshooting-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    .guide-tips h3,
    .guide-troubleshooting h3 {
        font-size: 1.3rem;
    }
}

@media(max-width: 480px) {
    .guide-section {
        padding: var(--space-md);
        margin: var(--space-md) 0;
    }
    .guide-header h2 {
        font-size: 1.3rem;
    }
    .guide-header p {
        font-size: 0.9rem;
    }
    .step-content h3 {
        font-size: 1.1rem;
    }
    .example-box {
        font-size: 0.8rem;
        padding: var(--space-sm);
    }
    .tip-card,
    .trouble-item {
        padding: var(--space-md);
    }
    .tip-card i {
        font-size: 1.5rem;
    }
    .trouble-item i {
        font-size: 1.2rem;
    }
}


/* Policy Pages Styles (Privacy Policy, Terms of Service, Disclaimer) */

.policy-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.policy-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.policy-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.policy-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
}

.policy-content {
    max-width: 800px;
    margin: 0 auto;
}

.policy-section-block {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.policy-section-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.policy-section-block h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.policy-section-block p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.policy-section-block ul {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

.policy-section-block li {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.contact-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-top: var(--space-md);
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.contact-info i {
    color: var(--primary);
    width: 20px;
}


/* About Page Styles */

.about-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.about-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.about-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.about-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-section-block {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.about-section-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.about-section-block h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.about-section-block p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.target-audience {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.audience-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.audience-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.audience-item i {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: var(--space-sm);
}

.audience-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.audience-item p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.value-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.value-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.value-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.value-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.value-item p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.timeline {
    margin: var(--space-lg) 0;
}

.timeline-item {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    background: var(--primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.timeline-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.contact-method {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.contact-method:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.contact-method i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.contact-method h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.contact-method p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}


/* Contact Page Styles */

.contact-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.contact-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.contact-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.contact-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
}

.contact-content {
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info-section {
    margin-bottom: var(--space-xl);
}

.contact-info-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.contact-info-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.contact-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.contact-method-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.contact-method-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.contact-method-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.contact-method-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.contact-method-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-sm);
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: var(--raogy-brand);
}


/* Dark mode improvements for contact links */

[data-theme="dark"] .contact-link {
    color: #60a5fa;
    /* Brighter blue for better visibility */
}

[data-theme="dark"] .contact-link:hover {
    color: #93c5fd;
    /* Even brighter on hover */
}

.contact-form-section {
    margin-bottom: var(--space-xl);
}

.contact-form-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.contact-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 600px;
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}


/* Vertical mode checkbox styles */

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
}

.mobile-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}


/* Character details form styles */

.character-details {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.character-details h4 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.character-details small {
    display: block;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.character-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

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

.form-group input {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}


/* Mobile responsive adjustments */

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}


/* Mobile input styles */

.mobile-input {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
    width: 100%;
}

.mobile-input:focus {
    outline: none;
    border-color: var(--primary);
}


/* Tool buttons container spacing */

.flex.flex-wrap.items-center.gap-2 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
}


/* Create space before the generate button */

.tool-chip.generate-btn-compact {
    background: linear-gradient(135deg, var(--raogy-brand), var(--primary));
    color: white;
    border: 2px solid var(--primary);
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 15px;
    top: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    margin-left: auto;
}


/* Tool chip buttons styling */

.tool-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tool-chip:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

.tool-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}


/* Add spacing to the container to accommodate the absolutely positioned arrow */

.flex.flex-wrap.items-center.gap-2 {
    padding-right: 60px;
    /* Space for the arrow button */
}

.tool-chip.generate-btn-compact:hover {
    background: linear-gradient(135deg, var(--primary), var(--raogy-brand));
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.tool-chip.generate-btn-compact i {
    font-size: 1.2rem;
    color: white;
    animation: arrowPulse 2s infinite;
}

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


/* Hide original generate button container */

.flex.justify-center.pt-4 {
    display: none;
}

.quick-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-top: 1.5rem;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.control-group label i {
    color: var(--primary);
    width: 16px;
}

.scene-count-selector {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.scene-count-selector:focus {
    outline: none;
    border-color: var(--primary);
}

.scene-count-selector option {
    background: var(--bg-primary);
    color: var(--text-primary);
}


/* Responsive adjustments for quick controls */

@media (max-width: 768px) {
    .quick-controls {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    .control-group {
        gap: var(--space-xs);
    }
    /* Mobile tool buttons container */
    .flex.flex-wrap.items-center.gap-2 {
        margin-top: 1rem;
        margin-bottom: 0.75rem;
        gap: 0.5rem;
    }
    .tool-chip {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    /* Mobile compact generate button */
    .tool-chip.generate-btn-compact {
        width: 36px;
        height: 36px;
        padding: 0.4rem;
    }
    .tool-chip.generate-btn-compact i {
        font-size: 1rem;
    }
}


/* Dark mode improvements for checkbox label links */

[data-theme="dark"] .checkbox-label a {
    color: #60a5fa;
    /* Brighter blue for better visibility */
}

[data-theme="dark"] .checkbox-label a:hover {
    color: #93c5fd;
    /* Even brighter on hover */
}

.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
}

.submit-btn:hover {
    background: var(--raogy-brand);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.faq-section {
    margin-bottom: var(--space-xl);
}

.faq-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.response-time-section {
    margin-bottom: var(--space-xl);
}

.response-time-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.response-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.response-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.response-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.response-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.response-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.response-item p {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.response-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}


/* Mobile responsive for all new pages */

@media(max-width: 768px) {
    .container {
        padding: var(--space-sm);
    }
    .policy-section,
    .about-section,
    .contact-section {
        padding: var(--space-md);
        margin: var(--space-md) 0;
        border-radius: var(--radius-md);
    }
    .policy-header h1,
    .about-header h1,
    .contact-header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: var(--space-xs);
    }
    .policy-header p,
    .about-header p,
    .contact-header p {
        font-size: 0.95rem;
    }
    .policy-section-block h2,
    .about-section-block h2,
    .contact-info-section h2,
    .contact-form-section h2,
    .faq-section h2,
    .response-time-section h2 {
        font-size: 1.2rem;
        flex-direction: column;
        gap: var(--space-xs);
    }
    .features-grid,
    .target-audience,
    .values-grid,
    .contact-methods-grid,
    .faq-grid,
    .response-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    .timeline-item {
        flex-direction: column;
        gap: var(--space-md);
    }
    .timeline-date {
        align-self: flex-start;
    }
    /* Header improvements for mobile on secondary pages */
    .header {
        padding: var(--space-sm);
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-xs);
    }
    .header-link {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.9rem;
    }
    .contact-form {
        padding: var(--space-lg);
    }
}

@media(max-width: 480px) {
    .policy-section,
    .about-section,
    .contact-section {
        padding: var(--space-md);
        margin: var(--space-md) 0;
    }
    .policy-header h1,
    .about-header h1,
    .contact-header h1 {
        font-size: 1.8rem;
    }
    .policy-header p,
    .about-header p,
    .contact-header p {
        font-size: 0.9rem;
    }
    .policy-section-block h2,
    .about-section-block h2,
    .contact-info-section h2,
    .contact-form-section h2,
    .faq-section h2,
    .response-time-section h2 {
        font-size: 1.2rem;
    }
    .feature-card,
    .audience-item,
    .value-item,
    .contact-method-card,
    .faq-item,
    .response-item {
        padding: var(--space-md);
    }
    .feature-card i,
    .audience-item i,
    .value-item i,
    .contact-method-card i,
    .response-item i {
        font-size: 1.5rem;
    }
    .contact-form {
        padding: var(--space-md);
    }
    .submit-btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: 0.9rem;
    }
}


/* Mobile responsive for footer */

@media(max-width: 768px) {
    .footer {
        padding: var(--space-md) 0;
        margin-top: var(--space-md);
    }
    .footer-content {
        flex-direction: column;
        gap: var(--space-md);
        padding: 0 var(--space-lg);
        text-align: center;
        max-width: 100%;
        align-items: center;
    }
    .footer-links {
        justify-content: center;
        gap: var(--space-sm);
    }
    .footer-brand {
        margin-bottom: var(--space-sm);
        text-align: center;
    }
    .footer-brand h3 {
        font-size: 1.3rem;
        margin-bottom: var(--space-xs);
    }
    .footer-brand p {
        font-size: 0.85rem;
    }
    .footer-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-xs);
        row-gap: var(--space-xs);
        max-width: 100%;
        width: 100%;
        align-items: center;
        justify-content: center;
    }
    .footer-links a {
        padding: var(--space-xs) var(--space-sm);
        margin: 0;
        font-size: 0.75rem;
        border-radius: 6px;
        flex: 0 0 auto;
        white-space: nowrap;
        justify-content: center;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    .footer-links a:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(99, 102, 241, 0.1);
        background: var(--bg-secondary);
    }
    .footer-links a i {
        font-size: 0.7rem;
        width: 10px;
        margin-right: var(--space-xs);
    }
}

@media(max-width: 480px) {
    .footer {
        padding: var(--space-sm) 0;
        margin-top: var(--space-sm);
        margin-bottom: 0;
    }
    .footer-content {
        padding: 0 var(--space-sm);
        gap: var(--space-sm);
        max-width: 100%;
        align-items: center;
    }
    .footer-brand h3 {
        font-size: 1.2rem;
        margin-bottom: var(--space-xs);
    }
    .footer-brand p {
        font-size: 0.8rem;
    }
    .footer-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-xs);
        row-gap: var(--space-xs);
        max-width: 100%;
        width: 100%;
        align-items: center;
        justify-content: center;
    }
    .footer-links a {
        padding: var(--space-xs);
        margin: 0;
        font-size: 0.7rem;
        border-radius: 4px;
        flex: 0 0 auto;
        white-space: nowrap;
        justify-content: center;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    .footer-links a:hover {
        transform: translateY(-1px);
        box-shadow: 0 1px 4px rgba(99, 102, 241, 0.1);
        background: var(--bg-secondary);
    }
    .footer-links a i {
        font-size: 0.65rem;
        width: 8px;
        margin-right: var(--space-xs);
    }
}


/* Fix mobile blank space issue and ensure consistent footer container size */

@media(max-width: 768px) {
    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow-x: hidden;
    }
    .container {
        flex: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }
    main {
        flex: 1;
        width: 100%;
    }
    .footer {
        margin-top: auto;
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }
}


/* Ensure consistent footer container size across all pages */

.footer {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.footer-content {
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
}


/* WhatsApp Channel Join Section - Professional Design */

.whatsapp-section {
    background: linear-gradient(135deg, #86efac 0%, #93c5fd 100%);
    padding: 25px 20px;
    margin: 25px 0;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(134, 239, 172, 0.3), 0 4px 16px rgba(147, 197, 253, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.whatsapp-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    pointer-events: none;
}

.whatsapp-content {
    max-width: 380px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.whatsapp-header h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 800;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.5px;
}

.whatsapp-header h3 i {
    font-size: 1.6rem;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

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

.whatsapp-benefits {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.whatsapp-benefits .benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 1px 3px rgba(0, 0, 0, 0.7);
}

.whatsapp-benefits .benefit-item:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.whatsapp-benefits .benefit-item span:first-child {
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8), 0 1px 3px rgba(0, 0, 0, 0.7));
}

.whatsapp-join-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #16a34a;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(134, 239, 172, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.whatsapp-join-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.whatsapp-join-btn:hover::before {
    left: 100%;
}

.whatsapp-join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(147, 197, 253, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #e9ecef 100%);
}

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

.whatsapp-join-btn i {
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}


/* Mobile optimization for WhatsApp section - Ultra Compact */

@media (max-width: 768px) {
    .whatsapp-section {
        padding: 12px 10px;
        margin: 12px 10px;
        border-radius: 8px;
    }
    .whatsapp-content {
        max-width: 100%;
    }
    .whatsapp-header h3 {
        font-size: 1.1rem;
        gap: 5px;
        margin-bottom: 10px;
    }
    .whatsapp-header h3 i {
        font-size: 1.2rem;
    }
    .whatsapp-benefits {
        gap: 10px;
        margin-bottom: 12px;
    }
    .whatsapp-benefits .benefit-item {
        font-size: 0.7rem;
        padding: 5px 8px;
    }
    .whatsapp-benefits .benefit-item span:first-child {
        font-size: 0.9rem;
    }
    .whatsapp-join-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .whatsapp-section {
        padding: 10px 8px;
        margin: 10px 8px;
        border-radius: 6px;
    }
    .whatsapp-header h3 {
        font-size: 1rem;
        gap: 4px;
        margin-bottom: 8px;
    }
    .whatsapp-header h3 i {
        font-size: 1.1rem;
    }
    .whatsapp-benefits {
        gap: 8px;
        margin-bottom: 10px;
    }
    .whatsapp-benefits .benefit-item {
        font-size: 0.65rem;
        padding: 4px 6px;
    }
    .whatsapp-benefits .benefit-item span:first-child {
        font-size: 0.8rem;
    }
    .whatsapp-join-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}


/* Container */


/* =====================================
   Sidebar Styles - Enhanced with Vertical/Horizontal Support
===================================== */


/* Base sidebar styles */

#sidebar {
    position: fixed;
    background: var(--bg-primary);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    box-sizing: border-box;
    /* Cross-browser fixes for consistent sizing */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    min-width: 64px;
}


/* Vertical Menu (Default) - Left aligned, full height */

#sidebar.vertical {
    top: 0;
    left: 0;
    height: 100vh;
    width: 64px;
    /* Collapsed width */
    max-height: 100vh;
    flex-direction: column;
    border-right: 1px solid var(--bg-tertiary);
    overflow: hidden;
    /* Allow internal scrolling */
}

#sidebar.vertical.open {
    width: 220px;
    /* Expanded width as requested */
}


/* Horizontal Menu - Top aligned, full width */

#sidebar.horizontal {
    top: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    /* Fixed height as requested */
    max-width: 100vw;
    flex-direction: row;
    border-bottom: 1px solid var(--bg-tertiary);
    border-right: none;
}

#sidebar.horizontal.open {
    height: 60px;
    /* Keep same height when expanded */
}


/* Default to vertical if no class specified */

#sidebar:not(.horizontal):not(.vertical) {
    top: 0;
    left: 0;
    height: 100vh;
    width: 64px;
    max-height: 100vh;
    flex-direction: column;
    border-right: 1px solid var(--bg-tertiary);
    overflow: hidden;
    /* Allow internal scrolling */
}

#sidebar:not(.horizontal):not(.vertical).open {
    width: 220px;
}


/* Collapsed state styles for vertical layout */

#sidebar.vertical:not(.open),
#sidebar:not(.horizontal):not(.vertical):not(.open) {
    padding: 0.5rem 0;
}

#sidebar.vertical:not(.open) .flex.items-center,
#sidebar:not(.horizontal):not(.vertical):not(.open) .flex.items-center {
    justify-content: center;
    padding: 0.5rem;
    margin: 0;
    /* Browser compatibility for centering */
    display: flex;
    align-items: center;
    -webkit-box-align: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -webkit-align-items: center;
}


/* Collapsed state styles for horizontal layout */

#sidebar.horizontal:not(.open) {
    padding: 0 0.5rem;
}

#sidebar.horizontal:not(.open) .flex.items-center {
    justify-content: center;
    padding: 0.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    -webkit-box-align: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -webkit-align-items: center;
}


/* Navigation list styles for vertical layout */

#sidebar.vertical:not(.open) ul,
#sidebar:not(.horizontal):not(.vertical):not(.open) ul {
    padding: 0;
    margin: 0;
    flex-direction: column;
}

#sidebar.vertical:not(.open) li,
#sidebar:not(.horizontal):not(.vertical):not(.open) li {
    margin: 0.25rem 0;
}


/* Remove scrolling from navigation - ensure all items are visible */

#sidebar #menu-items {
    overflow-y: auto !important;
    max-height: calc(100vh - 120px) !important;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

#sidebar #menu-items::-webkit-scrollbar {
    width: 4px;
}

#sidebar #menu-items::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar #menu-items::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

#sidebar #menu-items::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

#sidebar nav ul {
    overflow: visible !important;
}


/* Navigation list styles for horizontal layout */

#sidebar.horizontal:not(.open) ul {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
}

#sidebar.horizontal:not(.open) li {
    margin: 0 0.25rem;
    flex: 0 0 auto;
}


/* Link and button styles for collapsed vertical */

#sidebar.vertical:not(.open) a,
#sidebar.vertical:not(.open) button,
#sidebar:not(.horizontal):not(.vertical):not(.open) a,
#sidebar:not(.horizontal):not(.vertical):not(.open) button {
    justify-content: center;
    padding: 0.75rem !important;
    margin: 0;
    width: 100%;
    min-height: 48px;
}


/* Link and button styles for collapsed horizontal */

#sidebar.horizontal:not(.open) a,
#sidebar.horizontal:not(.open) button {
    justify-content: center;
    padding: 0.5rem 0.75rem !important;
    margin: 0;
    min-width: 48px;
    height: 100%;
}


/* Expanded state styling for vertical layout */

#sidebar.vertical.open,
#sidebar:not(.horizontal):not(.vertical).open {
    padding: 0.75rem;
}

#sidebar.vertical.open .flex.items-center,
#sidebar:not(.horizontal):not(.vertical).open .flex.items-center {
    justify-content: flex-start;
    padding: 0.5rem;
}

#sidebar.vertical.open ul,
#sidebar:not(.horizontal):not(.vertical).open ul {
    padding: 0 0.5rem;
    flex-direction: column;
}

#sidebar.vertical.open li,
#sidebar:not(.horizontal):not(.vertical).open li {
    margin: 0.125rem 0;
}

#sidebar.vertical.open a,
#sidebar.vertical.open button,
#sidebar:not(.horizontal):not(.vertical).open a,
#sidebar:not(.horizontal):not(.vertical).open button {
    justify-content: flex-start;
    padding: 0.5rem !important;
}


/* Expanded state styling for horizontal layout */

#sidebar.horizontal.open {
    padding: 0.5rem 0.75rem;
}

#sidebar.horizontal.open .flex.items-center {
    justify-content: flex-start;
    padding: 0.25rem 0.5rem;
}

#sidebar.horizontal.open ul {
    padding: 0 0.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
}

#sidebar.horizontal.open li {
    margin: 0 0.5rem;
    flex: 0 0 auto;
}

#sidebar.horizontal.open a,
#sidebar.horizontal.open button {
    justify-content: flex-start;
    padding: 0.25rem 0.5rem !important;
    white-space: nowrap;
}


/* Ensure proper text containment within sidebar */

#sidebar .flex.items-center {
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    /* Cross-browser flex fixes */
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}


/* Icon sizing consistency across browsers */

#sidebar svg,
#sidebar i {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    flex-shrink: 0 !important;
    /* Cross-browser sizing */
    -webkit-flex-shrink: 0 !important;
    -moz-flex-shrink: 0 !important;
}


/* Menu text visibility and containment */

#sidebar:not(.open) .menu-text {
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
}

#sidebar.open .menu-text {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline !important;
    margin-left: 0.5rem !important;
    /* Reduced from 0.75rem */
    width: auto !important;
    max-width: calc(100% - 2.5rem) !important;
    /* Adjusted for smaller margin */
    padding: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    height: auto !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}


/* Brand logo specific styles */

#sidebar-header {
    overflow: hidden;
    white-space: nowrap;
}

#sidebar.open #sidebar-header h1 {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}


/* Ensure all flex containers within sidebar are properly constrained */

#sidebar ul {
    width: 100%;
    box-sizing: border-box;
}

#sidebar li {
    width: 100%;
    box-sizing: border-box;
}


/* Optimized spacing for menu items */

#sidebar.open a,
#sidebar.open button {
    padding: 0.5rem 0.75rem !important;
    /* Consistent padding */
    gap: 0.5rem;
    /* Direct gap control */
}

#sidebar.open .flex.items-center {
    gap: 0.5rem !important;
    /* Consistent gap between icon and text */
}


/* Specific icon sizing to prevent overflow */

#sidebar svg,
#sidebar .bg-green-500 {
    flex-shrink: 0;
    min-width: 20px;
    min-height: 20px;
}


/* Collapsed state icon positioning */

#sidebar:not(.open) svg,
#sidebar:not(.open) .bg-green-500 {
    margin: 0 auto;
}


/* Ensure icons are properly visible in collapsed state */

#sidebar:not(.open) .flex.items-center {
    justify-content: center !important;
}

#sidebar:not(.open) .lucide {
    width: 20px !important;
    height: 20px !important;
}

#sidebar:not(.open) .bg-green-500 {
    width: 12px !important;
    height: 12px !important;
}


/* Header styling in collapsed state */

#sidebar:not(.open) #sidebar-header {
    display: none;
}

#sidebar.open #sidebar-header {
    display: block;
}

#sidebar:not(.open) #brand-text {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

#sidebar.open #brand-text {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}


/* Ensure proper button heights in collapsed state */

#sidebar:not(.open) button,
#sidebar:not(.open) a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px !important;
}


/* Override any Tailwind margin classes in expanded state */

#sidebar.open .menu-text {
    margin-left: 0 !important;
    /* Let CSS gap handle spacing */
}


/* Header container gap */

#sidebar .flex.items-center {
    gap: 0.5rem;
}

#sidebar svg {
    color: var(--text-primary);
    min-width: 24px;
    min-height: 24px;
}

[data-theme="dark"] #sidebar svg {
    color: var(--text-primary-dark);
}

#sidebar a,
#sidebar button {
    border: none;
    background: transparent;
    text-decoration: none;
}


/* Dark mode body and main content fixes */

[data-theme="dark"] body {
    background: var(--bg-secondary-dark);
    color: var(--text-primary-dark);
}

[data-theme="dark"] .container {
    background: var(--bg-secondary-dark);
    color: var(--text-primary-dark);
}

[data-theme="dark"] #mainContent {
    background: var(--bg-secondary-dark);
    color: var(--text-primary-dark);
}


/* Sidebar dark mode improvements */

[data-theme="dark"] #sidebar {
    background: var(--bg-primary-dark) !important;
    border-color: var(--border-dark) !important;
    color: var(--text-primary-dark) !important;
}

[data-theme="dark"] #sidebar .menu-text {
    color: var(--text-primary-dark) !important;
}

[data-theme="dark"] #sidebar a,
[data-theme="dark"] #sidebar button {
    color: var(--text-primary-dark) !important;
}

[data-theme="dark"] #sidebar a:hover,
[data-theme="dark"] #sidebar button:hover {
    background: var(--bg-tertiary-dark) !important;
    color: var(--text-primary-dark) !important;
}


/* Ensure all input sections work in dark mode */

[data-theme="dark"] .main-input-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] select {
    background: var(--bg-tertiary-dark) !important;
    color: var(--text-primary-dark) !important;
    border-color: var(--border-dark) !important;
}


/* Dark mode for settings dropdown and buttons */

[data-theme="dark"] .unified-settings-dropdown {
    background: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .unified-settings-dropdown .dropdown-toggle {
    background: linear-gradient(135deg, #1e293b, #334155) !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .unified-settings-dropdown .dropdown-toggle:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .unified-settings-dropdown .dropdown-toggle.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .unified-settings-dropdown .dropdown-content {
    background: #0f172a !important;
    color: #f1f5f9 !important;
}


/* Dark mode for tab buttons */

[data-theme="dark"] .tab-btn {
    color: #94a3b8 !important;
    background: transparent !important;
}

[data-theme="dark"] .tab-btn:hover {
    background: #374151 !important;
    color: #f9fafb !important;
}

[data-theme="dark"] .tab-btn.active {
    background: #4f46e5 !important;
    color: #ffffff !important;
}


/* Dark mode for control buttons (Clear, Load, etc) */

[data-theme="dark"] .control-btn {
    background: #374151 !important;
    color: #f9fafb !important;
    border-color: #6b7280 !important;
}

[data-theme="dark"] .control-btn:hover {
    background: #4b5563 !important;
    color: #ffffff !important;
}


/* Dark mode for specific input elements with better visibility */

[data-theme="dark"] #userInput {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] #userInput::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}


/* Dark mode for mobile tabs */

[data-theme="dark"] .mobile-tabs {
    background: #1e293b !important;
    border-color: #475569 !important;
}


/* Dark mode for form elements in settings */

[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="range"] {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}


/* Dark mode for labels and text in settings */

[data-theme="dark"] .tab-content label,
[data-theme="dark"] .tab-content p,
[data-theme="dark"] .tab-content span {
    color: #f1f5f9 !important;
}


/* Dark mode for all button elements */

[data-theme="dark"] button {
    background: #374151 !important;
    color: #f9fafb !important;
    border-color: #6b7280 !important;
}

[data-theme="dark"] button:hover {
    background: #4b5563 !important;
    color: #ffffff !important;
}


/* Dark mode for specific Save button */

[data-theme="dark"] .save-btn,
[data-theme="dark"] button[type="submit"] {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: #ffffff !important;
    border: none !important;
}

[data-theme="dark"] .save-btn:hover,
[data-theme="dark"] button[type="submit"]:hover {
    background: linear-gradient(135deg, #047857, #059669) !important;
    transform: translateY(-1px) !important;
}


/* Mobile overlay */

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.mobile-overlay.active {
    display: block;
}


/* Mobile sidebar toggle */

@media (max-width: 768px) {
    #sidebar.mobile-open {
        transform: translateX(0);
    }
}


/* Critical fix for menu text visibility when sidebar is closed */

#sidebar:not(.open) .menu-text {
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
}

#sidebar.open .menu-text {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline !important;
    margin-left: 0.75rem !important;
    width: auto !important;
    max-width: none !important;
    padding: initial !important;
    font-size: inherit !important;
    line-height: inherit !important;
    height: auto !important;
    transition: all 0.3s ease !important;
}


/* Ensure consistent behavior for the hidden class */

#sidebar .menu-text.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
}

#sidebar.open .menu-text.hidden {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline !important;
    margin-left: 0.75rem !important;
    width: auto !important;
    max-width: none !important;
    padding: initial !important;
    font-size: inherit !important;
    line-height: inherit !important;
    height: auto !important;
}


/* Additional fix for any text elements in closed sidebar */

#sidebar:not(.open) .menu-text {
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
}

#sidebar.open .menu-text {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline !important;
    width: auto !important;
    max-width: none !important;
    padding: initial !important;
    font-size: inherit !important;
    line-height: inherit !important;
    height: auto !important;
    margin-left: 0.75rem !important;
}


/* Specific fix for the green Live dot - should remain visible when closed */

#sidebar:not(.open) .bg-green-500 {
    opacity: 1 !important;
    visibility: visible !important;
    width: 12px !important;
    height: 12px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

#sidebar.open .bg-green-500 {
    opacity: 1 !important;
    visibility: visible !important;
    width: 12px !important;
    height: 12px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}


/* ===== MOBILE OPTIMIZATION - EXACT DESKTOP LAYOUT BUT GEMINI-SIZED ===== */

@media (max-width: 768px) {
    /* Hide sidebar on mobile */
    #sidebar {
        display: none !important;
    }
    /* Adjust main content for mobile */
    #mainContent {
        margin-left: 0 !important;
        width: 100%;
    }
    /* Container - Gemini-like compact sizing */
    .container {
        padding: 0.75rem;
        padding-top: 5vh;
        max-width: 100%;
    }
    /* Input container - same as desktop but compact */
    .w-full.max-w-4xl.mx-auto.bg-white {
        padding: 1rem;
        margin-bottom: 2rem;
        border-radius: 1.25rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }
    /* Header - Gemini-like compact text */
    .text-center h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.25rem;
    }
    .text-center p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    /* Textarea - Gemini-like compact but functional */
    #userInput {
        min-height: 100px !important;
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
        border-radius: 1rem !important;
    }
    /* Dialogue status - compact */
    .absolute.bottom-3.right-3 {
        bottom: 0.5rem !important;
        right: 0.5rem !important;
    }
    .dialogue-status {
        font-size: 0.7rem !important;
    }
    /* Tool buttons - exact same layout but compact */
    .flex.flex-wrap.items-center.gap-2 {
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-right: 50px;
    }
    .tool-chip {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.75rem !important;
        border-radius: 1rem !important;
    }
    /* Generate button - same position but smaller */
    .tool-chip.generate-btn-compact {
        width: 35px !important;
        height: 35px !important;
        right: 10px !important;
    }
    /* Results section - same as desktop but compact */
    #resultsSection {
        padding: 1rem !important;
        margin-top: 2rem !important;
        border-radius: 1.25rem !important;
    }
    /* Section headers - compact */
    .section-header h2 {
        font-size: 1.25rem !important;
    }
    .section-subtitle {
        font-size: 0.8rem !important;
    }
    /* Results controls - compact */
    .results-controls {
        gap: 0.5rem !important;
        margin-bottom: 1rem !important;
    }
    .control-btn {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.75rem !important;
    }
    /* Scroll to top - compact */
    .scroll-to-top {
        bottom: 15px !important;
        right: 15px !important;
        padding: 6px 12px !important;
        min-width: 80px !important;
        font-size: 0.7rem !important;
    }
}


/* Extra small devices - even more compact */

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    .w-full.max-w-4xl.mx-auto.bg-white {
        padding: 0.75rem;
    }
    .text-center h1 {
        font-size: 1.3rem !important;
    }
    .tool-chip {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.7rem !important;
    }
    .tool-chip.generate-btn-compact {
        width: 32px !important;
        height: 32px !important;
    }
}


/* Icons should always be visible */

#sidebar svg {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
}


/* Button Hover Text Visibility Fixes for Light and Dark Modes */


/* General button hover improvements */

button:hover,
.btn:hover,
.button:hover,
a:hover,
.menu-item:hover {
    transition: all 0.2s ease;
}


/* Light mode button hover text contrast */

:root {
    --hover-bg-light: rgba(0, 0, 0, 0.08);
    --hover-text-light: #1e293b;
    --hover-bg-dark: rgba(255, 255, 255, 0.15);
    --hover-text-dark: #ffffff;
}


/* Ensure proper text visibility on hover for all buttons */

button:hover,
.btn:hover,
.button:hover {
    color: var(--hover-text-light) !important;
}


/* Dark mode button hover text visibility */

[data-theme="dark"] button:hover,
[data-theme="dark"] .btn:hover,
[data-theme="dark"] .button:hover {
    color: var(--hover-text-dark) !important;
}


/* Specific fixes for menu items and links */

.menu-item:hover span,
.menu-text:hover {
    color: var(--text-primary) !important;
    opacity: 1 !important;
}

[data-theme="dark"] .menu-item:hover span,
[data-theme="dark"] .menu-text:hover {
    color: var(--text-primary-dark) !important;
    opacity: 1 !important;
}


/* Fix for dropdown buttons */

.dropdown-btn:hover,
.dropdown-toggle:hover {
    background-color: var(--hover-bg-light) !important;
    color: var(--hover-text-light) !important;
}

[data-theme="dark"] .dropdown-btn:hover,
[data-theme="dark"] .dropdown-toggle:hover {
    background-color: var(--hover-bg-dark) !important;
    color: var(--hover-text-dark) !important;
}


/* Control buttons hover fix */

.control-btn:hover,
.sub-actions button:hover {
    opacity: 1 !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .control-btn:hover,
[data-theme="dark"] .sub-actions button:hover {
    color: var(--text-primary-dark) !important;
}


/* Primary buttons should maintain white text on hover */

.btn-primary:hover,
button.primary:hover,
.sub-actions .apply:hover {
    color: #ffffff !important;
}


/* Optimized Scroll to Top Button */

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
}

.scroll-to-top i {
    font-size: 16px;
    line-height: 1;
    color: #ffffff;
}

.scroll-to-top span {
    display: none;
}


/* Dark mode scroll button */

[data-theme="dark"] .scroll-to-top {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .scroll-to-top:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}


/* Desktop - slightly larger */

@media (min-width: 769px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 30px;
        right: 30px;
    }
    .scroll-to-top i {
        font-size: 18px;
    }
}


/* Tablet */

@media (max-width: 768px) {
    .scroll-to-top {
        width: 38px;
        height: 38px;
        bottom: 20px;
        right: 20px;
    }
    .scroll-to-top i {
        font-size: 16px;
    }
}


/* Mobile - compact size */

@media (max-width: 480px) {
    .scroll-to-top {
        width: 36px;
        height: 36px;
        bottom: 15px;
        right: 15px;
    }
    .scroll-to-top i {
        font-size: 14px;
    }
}


/* Additional hover state improvements */

.theme-toggle:hover i {
    color: var(--primary) !important;
}

[data-theme="dark"] .theme-toggle:hover i {
    color: var(--primary) !important;
}


/* Ensure all interactive elements have visible hover states */

a:hover,
button:hover,
[role="button"]:hover {
    opacity: 1 !important;
}


/* Fix specific button types */

.copy-btn:hover {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

.generate-btn:hover {
    opacity: 0.9 !important;
    color: #ffffff !important;
}


/* Sidebar menu items hover fix */

#sidebar a:hover span,
.mobile-sidebar a:hover span {
    color: var(--text-primary) !important;
    opacity: 1 !important;
}

[data-theme="dark"] #sidebar a:hover span,
[data-theme="dark"] .mobile-sidebar a:hover span {
    color: var(--text-primary-dark) !important;
}


/* Remove any conflicting styles */

.scroll-to-top * {
    margin: 0;
    padding: 0;
}


/* Storyboard Result Button Hover Fixes */


/* Fix for results control buttons (Copy All, JSON Prompt, Export, Share) */

.results-controls .control-btn {
    transition: all 0.2s ease;
    position: relative;
}

.results-controls .control-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-controls .control-btn:hover i,
.results-controls .control-btn:hover span {
    color: #ffffff !important;
}


/* Dark mode specific */

[data-theme="dark"] .results-controls .control-btn {
    background: #374151;
    color: #f9fafb;
    border: 1px solid #4b5563;
}

[data-theme="dark"] .results-controls .control-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

[data-theme="dark"] .results-controls .control-btn:hover i,
[data-theme="dark"] .results-controls .control-btn:hover span {
    color: #ffffff !important;
}


/* Specific button types in results */

.control-btn.copy-all-btn:hover,
.control-btn.json-btn:hover,
.control-btn.export-btn:hover,
.control-btn.share-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
}


/* Copy Assets button specific */

.copy-assets-btn,
.control-btn.copy-assets {
    transition: all 0.2s ease;
}

.copy-assets-btn:hover,
.control-btn.copy-assets:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
}


/* Ensure icons maintain white color on hover */

.control-btn:hover .fas,
.control-btn:hover .fa,
.control-btn:hover [class*="fa-"] {
    color: #ffffff !important;
}


/* Scene-specific copy buttons */

.scene-copy-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .scene-copy-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
}


/* JSON button specific fixes */

.scene-json-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
}


/* Mobile specific hover states */

@media (max-width: 768px) {
    .results-controls .control-btn:active {
        background: var(--primary) !important;
        color: #ffffff !important;
        transform: scale(0.98);
    }
}


/* Ensure all text elements inside control buttons are visible on hover */

.control-btn:hover * {
    color: #ffffff !important;
    opacity: 1 !important;
}

[data-theme="dark"] .control-btn:hover * {
    color: #ffffff !important;
    opacity: 1 !important;
}


/* Fix for any button with icon + text */

.control-btn i+span,
.control-btn svg+span {
    margin-left: 0.5rem;
}


/* Active/Focus states */

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


/* Disabled state */

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

.control-btn:disabled:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    transform: none;
}


/* Toast Notification Fixes */

#toastContainer,
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 14px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: #10b981;
    color: white;
}

.toast.error {
    background: #ef4444;
    color: white;
}

.toast.warning {
    background: #f59e0b;
    color: white;
}

.toast.info {
    background: #3b82f6;
    color: white;
}


/* Dark mode toast styles */

[data-theme="dark"] .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .toast:not(.success):not(.error):not(.warning):not(.info) {
    background: #374151;
    color: #f9fafb;
    border: 1px solid #4b5563;
}


/* Mobile toast positioning */

@media (max-width: 768px) {
    #toastContainer,
    .toast-container {
        top: auto;
        bottom: 80px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    .toast {
        min-width: 90vw;
        max-width: 90vw;
        justify-content: center;
        text-align: center;
    }
}


/* Improved Scroll to Top Button */

.scroll-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.scroll-to-top:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.scroll-to-top i {
    font-size: 20px;
    line-height: 1;
    color: #ffffff;
}


/* Pulsing animation for scroll button */

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    }
    50% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    }
    100% {
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    }
}

.scroll-to-top.visible {
    animation: pulse 2s infinite;
}

.scroll-to-top:hover {
    animation: none;
}


/* Dark mode scroll button */

[data-theme="dark"] .scroll-to-top {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

[data-theme="dark"] .scroll-to-top:hover {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}


/* Tablet size */

@media (max-width: 768px) {
    .scroll-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }
    .scroll-to-top i {
        font-size: 18px;
    }
}


/* Mobile size */

@media (max-width: 480px) {
    .scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
        border-radius: 10px;
    }
    .scroll-to-top i {
        font-size: 16px;
    }
}


/* Ensure button text remains white */

.scroll-to-top,
.scroll-to-top:hover,
.scroll-to-top:focus,
.scroll-to-top:active {
    color: #ffffff !important;
}

.scroll-to-top i,
.scroll-to-top:hover i {
    color: #ffffff !important;
}


/* Force Toast Visibility */

#toastContainer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


/* Ensure toasts are visible on mobile */

@media (max-width: 768px) {
    #toastContainer {
        position: fixed !important;
        bottom: 80px !important;
        top: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 90vw !important;
        max-width: 400px !important;
        z-index: 99999 !important;
    }
    .toast {
        width: 100% !important;
        margin: 0 0 10px 0 !important;
        transform: translateY(100px) !important;
        opacity: 0 !important;
    }
    .toast.show {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
}


/* Ensure toast text is always visible */

.toast span {
    color: white !important;
    opacity: 1 !important;
}

.toast i {
    color: white !important;
    opacity: 1 !important;
    margin-right: 8px !important;
}


/* Animation keyframes */

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

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


/* Apply animations */

@media (min-width: 769px) {
    .toast {
        animation: slideInRight 0.3s ease-out forwards;
    }
}

@media (max-width: 768px) {
    .toast {
        animation: slideInBottom 0.3s ease-out forwards;
    }
}


/* Ensure proper stacking */

.toast+.toast {
    margin-top: 10px;
}


/* Dark mode adjustments - toasts already have their own background colors */


/* Template System Styles */

.template-btn {
    transition: all 0.2s ease;
}

.template-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* Script Validation Styles */

#scriptValidation {
    z-index: 10;
}

#validationStatus,
#scriptStats {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* Advanced Export Styles */

.export-option-btn {
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

.export-option-btn:hover {
    transform: translateX(2px);
    background: var(--bg-tertiary) !important;
}


/* Advanced Export Dropdown */

#advancedExportDropdown {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 0.5rem !important;
    background: var(--bg-primary) !important;
}

#advancedExportDropdown .space-y-1>*+* {
    margin-top: 0.25rem;
}


/* Results section overall improvements */

#resultsSection {
    animation: fadeInUp 0.4s ease-out;
}

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


/* Mobile optimizations for new features */

@media (max-width: 768px) {
    #scriptValidation {
        top: 1rem;
        right: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    #validationStatus,
    #scriptStats {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    .template-btn {
        padding: 0.75rem;
    }
    .template-btn .font-medium {
        font-size: 0.8rem;
    }
    .template-btn .text-xs {
        font-size: 0.7rem;
    }
}


/* Fix z-index conflicts */

.loading-overlay {
    z-index: 9999;
}

#toastContainer {
    z-index: 10000;
}

.toast {
    z-index: 10001;
}


/* Mobile optimization for configuration dropdown option panels */

@media (max-width: 768px) {
    /* Target the dropdown option panels for the 7 configuration selects */
    #transition-style-select option,
    #visual-style-select option,
    #shot-type-select option,
    #camera-movement-select option,
    #scene-duration-select option,
    #lighting-select option,
    #time-of-day-select option {
        font-size: 12px !important;
        padding: 4px 8px !important;
        line-height: 1.2 !important;
        min-height: 28px !important;
    }
    /* Make the dropdown containers more compact */
    #transition-style-select,
    #visual-style-select,
    #shot-type-select,
    #camera-movement-select,
    #scene-duration-select,
    #lighting-select,
    #time-of-day-select {
        font-size: 12px !important;
        line-height: 1.2 !important;
    }
}

@media (max-width: 480px) {
    /* Even smaller for mobile phones */
    #transition-style-select option,
    #visual-style-select option,
    #shot-type-select option,
    #camera-movement-select option,
    #scene-duration-select option,
    #lighting-select option,
    #time-of-day-select option {
        font-size: 11px !important;
        padding: 3px 6px !important;
        line-height: 1.1 !important;
        min-height: 24px !important;
    }
    #transition-style-select,
    #visual-style-select,
    #shot-type-select,
    #camera-movement-select,
    #scene-duration-select,
    #lighting-select,
    #time-of-day-select {
        font-size: 11px !important;
        line-height: 1.1 !important;
    }
}


/* Blog and Tutorial Page Layout Optimizations */

.blog-page .page-container,
.tutorials-page .page-container {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

.blog-page .page-content,
.tutorials-page .page-content {
    margin-left: 40px;
    flex: 1;
    width: calc(100vw - 40px);
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
    overflow-x: hidden;
}


/* Ensure proper sidebar expansion */

.blog-page .page-sidebar.expanded+.page-content,
.tutorials-page .page-sidebar.expanded+.page-content {
    margin-left: 200px;
    width: calc(100vw - 200px);
}


/* Article and Tutorial Content Optimization */

.article-container,
.tutorial-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}


/* Responsive optimizations for blog and tutorial pages */

@media (max-width: 768px) {
    .blog-page .page-content,
    .tutorials-page .page-content {
        margin-left: 40px;
        width: calc(100vw - 40px);
    }
    .article-container,
    .tutorial-container {
        padding: 1rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .article-container,
    .tutorial-container {
        padding: 0.5rem;
    }
}


/* =============================
   Minimal Usage Highlight State
   Applies light blue background to indicate active/used settings or characters/templates.
   ============================= */

.usage-highlight {
    background: #e0f2fe !important;
    /* Light sky blue */
    box-shadow: 0 0 0 2px #bae6fd inset;
    /* Subtle inner border */
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

[data-theme="dark"] .usage-highlight {
    background: #1e3a8a !important;
    /* Deep indigo for dark mode */
    box-shadow: 0 0 0 2px #3b82f6 inset;
}


/* Mobile input optimizations */

@media (max-width: 768px) {
    /* Show menu text in mobile sidebar when open */
    .mobile-sidebar.open .menu-text,
    #mobile-sidebar.open .menu-text {
        display: block !important;
    }
    /* Optimize textarea for mobile - more compact */
    #userInput {
        height: 160px !important;
        /* Smaller than desktop but adequate */
        padding: 12px !important;
        /* Slightly less padding */
        font-size: 14px !important;
        /* Optimized text size for mobile */
        line-height: 1.4 !important;
    }
}

/* Script Generation Loader - Professional Blue & White Theme */
.script-gen-loader {
    margin: 16px 0;
    padding: 24px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.98) 25%, 
        rgba(241, 245, 249, 0.95) 75%, 
        rgba(255, 255, 255, 0.95) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    box-shadow: 
        0 4px 20px rgba(59, 130, 246, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.script-gen-loader:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 24px rgba(59, 130, 246, 0.12),
        0 3px 12px rgba(0, 0, 0, 0.06),
        0 1px 4px rgba(0, 0, 0, 0.04);
    border-color: rgba(59, 130, 246, 0.25);
}

/* Remove shimmer effect for professional look */
.script-gen-loader::before {
    display: none;
}

[data-theme="dark"] .script-gen-loader {
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.95) 0%, 
        rgba(30, 41, 59, 0.98) 25%, 
        rgba(51, 65, 85, 0.95) 75%, 
        rgba(15, 23, 42, 0.95) 100%);
    border-color: rgba(96, 165, 250, 0.2);
    box-shadow: 
        0 4px 20px rgba(59, 130, 246, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

.loader-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gemini-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, 
        #1e40af 0%, 
        #2563eb 25%, 
        #3b82f6 50%, 
        #2563eb 75%, 
        #1e40af 100%);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 3px 12px rgba(59, 130, 246, 0.25),
        0 1px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gemini-sparkle {
    color: white;
    animation: gemini-rotate 2s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gemini-sparkle svg {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8)) 
            drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

@keyframes gemini-rotate {
    0% { 
        transform: rotate(0deg) scale(1);
        opacity: 0.9;
    }
    25% { 
        transform: rotate(90deg) scale(1.05);
        opacity: 1;
    }
    50% { 
        transform: rotate(180deg) scale(1);
        opacity: 0.9;
    }
    75% { 
        transform: rotate(270deg) scale(1.05);
        opacity: 1;
    }
    100% { 
        transform: rotate(360deg) scale(1);
        opacity: 0.9;
    }
}

.loader-text {
    flex: 1;
}

.loader-text .primary-text {
    font-size: 16px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 4px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.loader-text .secondary-text {
    font-size: 14px;
    color: #64748b;
    font-weight: 400;
    line-height: 1.4;
    opacity: 0.8;
}

[data-theme="dark"] .loader-text .primary-text {
    color: #e2e8f0;
}

[data-theme="dark"] .loader-text .secondary-text {
    color: #94a3b8;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .script-gen-loader {
        margin: 12px 0;
        padding: 16px;
        border-radius: 12px;
    }
    
    .loader-content {
        gap: 12px;
    }
    
    .gemini-icon-container {
        width: 32px;
        height: 32px;
    }
    
    .gemini-sparkle svg {
        width: 16px;
        height: 16px;
    }
    
    .loader-text .primary-text {
        font-size: 14px;
    }
    
    .loader-text .secondary-text {
        font-size: 12px;
    }
}