/* Modern Design System - Global CSS */

:root {
    /* Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --success-color: #10b981;
    --success-dark: #059669;
    --error-color: #dc2626;
    --error-dark: #b91c1c;
    --warning-color: #f59e0b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-colored: 0 8px 32px rgba(102, 126, 234, 0.3);
}

/* Video Card Hover Effect */
.video-card-hover:hover {
    transform: scale(1.02) !important;
}

/* Global Resets and Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-50);
}

/* Modern Hero Gradient */
.hero-gradient {
    background: var(--primary-gradient);
    min-height: 70vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="g" cx="50%" cy="50%" r="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="50" cy="50" r="50" fill="url(%23g)"/></svg>') center/400px 400px;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
    text-align: center;
    padding: var(--space-3xl) 0;
}

/* Modern Cards */
.feature-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

/* Modern Buttons */
.modern-button {
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-lg) var(--space-2xl);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-colored);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.modern-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.modern-button-outline {
    background: transparent;
    border: 2px solid white;
    border-radius: var(--radius-full);
    padding: var(--space-lg) var(--space-2xl);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.modern-button-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

/* Gradient Text */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Floating Animations */
.floating-element {
    position: absolute;
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(2) {
    animation-delay: -2s;
}

.floating-element:nth-child(3) {
    animation-delay: -4s;
}

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

/* Phone Mockup Styles */
.phone-mockup {
    width: 280px;
    height: 560px;
    background: #1a1a1a;
    border-radius: 35px;
    padding: 20px;
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 25px;
    overflow: hidden;
    position: relative;
}

.phone-notch {
    width: 120px;
    height: 30px;
    background: #1a1a1a;
    border-radius: 0 0 15px 15px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* Feature Showcase Grid */
.feature-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin: var(--space-3xl) 0;
}

.feature-item {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    font-size: 1.5rem;
}

/* Statistics Section */
.stats-section {
    background: var(--gray-50);
    border-radius: var(--radius-2xl);
    padding: var(--space-3xl);
    margin: var(--space-3xl) 0;
    border: 1px solid var(--gray-200);
}

.stat-item {
    text-align: center;
    padding: var(--space-xl);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-xs);
}

.stat-description {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Tools Showcase */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin: var(--space-3xl) 0;
}

.tool-card {
    background: var(--gray-900);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-8px);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

.tool-card:hover::before {
    opacity: 0.2;
}

/* CTA Section */
.cta-section {
    background: var(--primary-gradient);
    border-radius: var(--radius-2xl);
    padding: var(--space-3xl);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin: var(--space-3xl) 0;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="g" cx="50%" cy="50%" r="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="50" cy="50" r="50" fill="url(%23g)"/></svg>') center/200px 200px;
    opacity: 0.3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-content {
        padding: var(--space-2xl) var(--space-md);
    }

    .hero-content h1 {
        font-size: 2.5rem !important;
    }

    .feature-card {
        margin-bottom: var(--space-lg);
    }

    .modern-button,
    .modern-button-outline {
        width: 100%;
        justify-content: center;
        margin-bottom: var(--space-md);
    }

    .floating-element {
        display: none;
    }

    .phone-mockup {
        width: 200px;
        height: 400px;
        padding: 15px;
    }

    .phone-notch {
        width: 80px;
        height: 20px;
    }

    .feature-showcase {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem !important;
    }

    .feature-card {
        padding: var(--space-lg);
    }

    .stats-section,
    .cta-section {
        padding: var(--space-xl);
        margin: var(--space-xl) 0;
    }
}

/* Step Cards for Multi-step Processes */
.step-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-200) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

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

/* Process Indicator */
.process-indicator {
    background: var(--primary-gradient);
    height: 4px;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Global AI Interface Layout */
.ai-app-layout {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    background: #0a0a0a;
    display: flex;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    box-sizing: border-box;
}

.ai-app-layout *,
.ai-app-layout *:before,
.ai-app-layout *:after {
    box-sizing: border-box;
}

/* Global Navigation Sidebar */
.ai-nav-sidebar {
    width: 64px;
    background: #1a1a1a;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md) 0;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
    display: none;
}

/* Hamburger Menu - Hidden by default (desktop) */
.mobile-menu-toggle {
    display: none !important;
}

.ai-nav-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    text-decoration: none;
}

.ai-nav-item:hover {
    background: #2a2a2a;
    color: #ccc;
}

.ai-nav-item.active {
    background: #667eea;
    color: white;
}

.ai-nav-item .mud-icon-root {
    font-size: 1.5rem;
}

/* Content Area */
.ai-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Allow flexbox to shrink */
    min-width: 0; /* Allow flexbox to shrink */
    max-width: 100%;
}

/* Top Header Bar */
.ai-top-header {
    height: 60px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.ai-header-left {
    display: flex;
    align-items: center;
}

.ai-title-section {
    display: flex;
    align-items: center;
}

.ai-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ai-nav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 4px;
}

.ai-nav-tabs .mud-button {
    border-radius: 6px;
    text-transform: none;
    font-weight: 500;
    min-width: 60px;
    height: 32px;
}

.ai-header-right {
    display: flex;
    align-items: center;
}

/* Page Content */
.ai-page-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    height: calc(100vh - 60px); /* Account for header height */
    min-height: 0; /* Allow flexbox to work properly */
    min-width: 0; /* Allow flexbox to work properly */
    max-width: 100%;
    width: 100%;
}

/* Update simple content wrapper to account for header */
.simple-content-wrapper {
    padding: var(--space-2xl);
    max-width: 1200px;
    margin: 0 auto;
    color: white;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Tool Sidebar */
.ai-tool-sidebar {
    width: 300px;
    max-width: 300px;
    background: #1a1a1a;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
    flex-shrink: 0;
    height: 100%;
}

.ai-tool-header {
    padding: var(--space-lg);
    border-bottom: 1px solid #333;
    background: #1e1e1e;
}

.ai-tool-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    padding: var(--space-md);
    width: 100%;
    max-width: 100%;
}

.ai-tool-content > div {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.ai-tool-content *:not(svg):not(path) {
    max-width: 100%;
}

.ai-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    height: 100%;
}

.ai-header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    min-width: 0;
    min-height: 0; /* Allow flexbox to work properly */
    max-width: 100%;
    height: 100%;
    width: 100%;
}

.ai-prompt-panel {
    flex: 1;
    background: #0a0a0a;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    overflow: auto;
}

.ai-results-panel {
    flex: 1;
    background: #111111;
    border-left: 1px solid #333;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-md);
    position: relative;
    min-width: 300px;
    max-width: 100%;
}

.ai-prompt-input {
    background: #1a1a1a !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    color: white !important;
    font-size: 14px !important;
    min-height: 120px !important;
    width: 100%;
    max-width: 600px;
}

.ai-prompt-input .mud-input-root {
    background: transparent !important;
}

.ai-prompt-input .mud-input-root input,
.ai-prompt-input .mud-input-root textarea {
    color: white !important;
}

.ai-prompt-input .mud-input-root .mud-input-helper-text {
    color: #999 !important;
}

.ai-generate-button {
    background: #22c55e !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 12px 32px !important;
    margin-top: var(--space-lg);
    font-size: 14px !important;
    min-width: 140px;
}

.ai-generate-button:hover {
    background: #16a34a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.ai-generate-button:disabled {
    background: #374151 !important;
    color: #9ca3af !important;
    transform: none;
    box-shadow: none;
}

/* Generation Thumbnails */
.generation-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
    padding: var(--space-sm);
}

.generation-thumbnail {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    transition: all 0.2s ease;
    cursor: pointer;
}

.generation-thumbnail:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.generation-thumbnail-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #0a0a0a;
}

.generation-thumbnail-info {
    padding: var(--space-sm);
}

.generation-thumbnail-title {
    color: white;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.2;
}

.generation-thumbnail-meta {
    color: #999;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.generation-loading {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    padding: var(--space-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.generation-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.generation-loading-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

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

/* Settings Panel */
.ai-settings-panel {
    background: #1a1a1a;
    border-radius: 8px;
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    border: 1px solid #333;
}

.ai-settings-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.ai-settings-row {
    margin-bottom: var(--space-md);
}

.ai-settings-label {
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: var(--space-xs);
    display: block;
}

.ai-select {
    background: #0a0a0a !important;
    border: 1px solid #333 !important;
    border-radius: 6px !important;
    color: white !important;
    font-size: 12px !important;
    height: 36px !important;
}

/* Hide mobile elements on desktop */
.mobile-params-button {
    display: none !important;
}

.mobile-params-backdrop {
    display: none;
}

.mobile-close-header {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ai-results-panel {
        min-width: 280px;
    }
    .generation-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* Tablet and Mobile - 1024px and below */
@media (max-width: 1024px) {
    .ai-top-header {
        padding: 0 16px;
    }

    /* Hide social links on tablet */
    .ai-header-right > div:has(svg) {
        display: none !important;
    }

    /* Make credits button smaller */
    .ai-header-right .credits-button {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    .ai-header-right .credits-button .mud-icon-root {
        font-size: 16px !important;
    }
}

/* Mobile - 768px and below */
@media (max-width: 768px) {
    /* Show hamburger menu button on mobile */
    .mobile-menu-toggle {
        display: inline-flex !important;
    }

    /* Transform sidebar to slide-in menu */
    .ai-app-layout {
        position: relative;
        min-height: 100vh;
        height: 100vh;
        width: 100vw;
        display: flex;
        overflow: hidden;
    }

    .ai-nav-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        width: 80px; /* Icon-only width */
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
        padding: var(--space-md) 0;
        overflow-y: auto; /* Allow scrolling on mobile if content overflows */
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .ai-nav-sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Mobile menu backdrop */
    .mobile-menu-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050;
        animation: fadeIn 0.3s ease;
    }

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

    .ai-nav-item {
        width: 56px;
        height: 56px;
        margin-bottom: 8px;
    }

    .ai-content-area {
        width: 100%;
        flex: 1;
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .ai-top-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 12px;
        flex-wrap: nowrap;
        width: 100%;
        z-index: 900;
        background: #1a1a1a;
    }

    .ai-header-left {
        flex: 1;
        min-width: 0;
    }


    .ai-title-section {
        overflow: hidden;
    }

    .ai-title-section .mud-typography {
        font-size: 16px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ai-title-section .mud-chip {
        display: none; /* Hide model badge on very small screens */
    }

    .ai-header-center {
        display: none; /* Hide center section on mobile */
    }

    .ai-header-right {
        display: flex;
        gap: 8px;
    }

    .ai-header-right > * {
        flex-shrink: 0;
    }

    /* Hide "Follow us" text on mobile */
    .ai-header-right > div > .mud-text {
        display: none !important;
    }

    /* Hide "Assets" button text, show only icon */
    .ai-header-right .mud-button:last-child span {
        display: none;
    }

    /* Make credits display more compact */
    .ai-header-right .credits-button {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    .ai-header-right .credits-button .mud-icon-root {
        margin-right: 4px !important;
        font-size: 16px !important;
    }

    .ai-header-right .credits-button .credits-number {
        font-size: 13px !important;
    }

    .ai-page-content {
        padding-top: 56px; /* Account for fixed header */
        height: 100vh;
        width: 100%;
        flex: 1;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
        flex-direction: column !important;
    }

    .simple-content-wrapper {
        padding-top: 56px; /* Account for fixed header */
        height: 100vh;
        width: 100%;
        padding: var(--space-lg);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile params button - floating action button */
    .mobile-params-button {
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea, #764ba2) !important;
        color: white !important;
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
        z-index: 1000;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .mobile-params-button:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    }

    /* Mobile backdrop */
    .mobile-params-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1100;
        animation: fadeIn 0.3s ease;
    }

    /* Tool sidebar as mobile drawer */
    .ai-tool-sidebar {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 80vh;
        border-right: none !important;
        border-top: 1px solid #333;
        border-radius: 16px 16px 0 0;
        z-index: 1200;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
    }

    .ai-tool-sidebar.mobile-open {
        transform: translateY(0);
    }

    /* Mobile close header */
    .mobile-close-header {
        display: flex !important;
        align-items: center;
        padding: 16px;
        background: #1a1a1a;
        border-bottom: 1px solid #333;
    }

    .ai-tool-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
    }

    /* Main workspace takes full screen on mobile */
    .ai-workspace {
        flex-direction: column;
        width: 100% !important;
        max-width: 100% !important;
        flex: 1;
        min-height: 0;
        display: flex;
        height: 100%;
        overflow: hidden;
    }

    .ai-main-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .ai-prompt-panel {
        display: none; /* Hide prompt panel on mobile, use dialog instead */
    }

    .ai-results-panel {
        width: 100% !important;
        max-width: 100% !important;
        border-left: none;
        border-top: none;
        min-width: auto !important;
        flex: 1;
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 12px;
        display: flex;
        flex-direction: column;
    }

    .generation-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--space-sm);
    }

    .ai-prompt-input {
        font-size: 16px !important; /* Prevent zoom on iOS */
        max-width: 100%;
    }
}

/* Small Mobile - 480px and below */
@media (max-width: 480px) {
    .ai-top-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 50px;
        padding: 0 8px;
        z-index: 900;
        background: #1a1a1a;
    }

    .ai-title-section .mud-typography {
        font-size: 14px !important;
    }

    .ai-nav-sidebar {
        width: 72px; /* Icon-only width for small screens */
    }

    .ai-nav-item {
        width: 48px;
        height: 48px;
    }

    .ai-nav-item .mud-icon-root {
        font-size: 1.25rem;
    }

    .ai-page-content {
        padding-top: 50px; /* Account for fixed header */
        height: 100vh;
        width: 100%;
        flex: 1;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
        flex-direction: column !important;
    }

    .simple-content-wrapper {
        padding-top: 50px; /* Account for fixed header */
        height: 100vh;
        width: 100%;
        padding: var(--space-md);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Make credits display even more compact - hide label but keep number */
    .ai-header-right .credits-button .credits-label {
        display: none !important;
    }

    .ai-header-right .credits-button {
        padding: 6px 10px !important;
        min-width: auto !important;
    }

    .ai-header-right .credits-button .credits-number {
        font-size: 12px !important;
    }

    .generation-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    /* Tool sidebar drawer on small mobile too */
    .ai-tool-sidebar {
        max-height: 75vh;
    }

    .ai-workspace {
        flex-direction: column;
        width: 100% !important;
        max-width: 100% !important;
        flex: 1;
        min-height: 0;
        display: flex;
        height: 100%;
        overflow: hidden;
    }

    .ai-main-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .ai-results-panel {
        height: 100%;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 8px;
        display: flex;
        flex-direction: column;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.fw-light { font-weight: 300; }
.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 800; }

.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }
.mb-6 { margin-bottom: var(--space-2xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }
.mt-6 { margin-top: var(--space-2xl); }

/* Simple Content Wrapper for Non-AI Pages */
.simple-content-wrapper {
    padding: var(--space-2xl);
    max-width: 1200px;
    margin: 0 auto;
    color: white;
    height: 100vh;
    overflow-y: auto;
}

.simple-content-wrapper h1,
.simple-content-wrapper h2,
.simple-content-wrapper h3 {
    color: white;
    margin-bottom: var(--space-lg);
}

.simple-content-wrapper p {
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

/* Model Selector Menu - Remove unwanted padding */
.model-selector-menu .mud-popover-content {
    padding: 0 !important;
}

.model-selector-menu .mud-list {
    padding: 0 !important;
}
