* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* n8n inspired colors */
    --bg-primary: #0a0b0e;
    --bg-secondary: #1a1d29;
    --bg-tertiary: #2a2d3a;
    --bg-glass: rgba(42, 45, 58, 0.8);
    
    /* Accent colors */
    --purple: #6366f1;
    --purple-light: #818cf8;
    --purple-dark: #4f46e5;
    --orange: #f59e0b;
    --orange-light: #fbbf24;
    
    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --logo-color: #00d4ff;
    
    /* Borders and shadows */
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--purple) 0%, var(--orange) 100%);
    --gradient-bg: linear-gradient(135deg, #0a0b0e 0%, #1a1d29 100%);
    --gradient-glass: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
}

/* Authentication Modals */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 14, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-heavy);
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

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

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

.auth-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

.auth-modal-body {
    padding: 2rem;
}

/* Google Login Button */
.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: white;
    color: #333;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.google-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.google-login-btn i {
    font-size: 1.1rem;
    color: #db4437;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

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

.form-group input {
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.auth-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--purple-light);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    animation: slideInLeft 0.8s ease-out;
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sidebar-logo .logo-icon {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: none;
    background: none;
    border: none;
    box-shadow: none;
}

.logo-text {
    font-family: 'Comfortaa', 'Nunito', 'Quicksand', cursive, sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--logo-color) !important;
    -webkit-text-fill-color: var(--logo-color) !important;
    margin: 0;
    padding: 0;
    text-align: center;
    letter-spacing: 2px;
    background: none !important;
    border: none;
    box-shadow: none;
}

/* Main page logo - 50% bigger */
.logo .logo-text {
    font-size: 3.75rem;
}

/* Sidebar logo - 50% smaller */
.sidebar-logo .logo-text {
    font-size: 1.25rem;
}

.sidebar-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 0.25rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    position: relative;
}

.menu-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(4px);
}

.menu-link:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
}

/* Help submenu styles */
.menu-help {
    position: relative;
}

.help-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-left: 1rem;
    margin-top: 0.25rem;
    background: var(--bg-secondary, #252525);
    border-radius: 8px;
    overflow: hidden;
}

.help-submenu li {
    margin: 0;
}

.help-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
}

.help-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.menu-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-link span {
    font-size: 0.9rem;
    font-weight: 500;
}

.menu-link.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left: 3px solid var(--purple);
}

/* Hierarchical Menu Styles */
.menu-category {
    margin-bottom: 0.5rem;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 600;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin: 0.5rem 1rem;
}

.category-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--purple-light);
}

.category-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.category-link span {
    flex: 1;
    font-size: 0.95rem;
}

.category-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.category-link.expanded .category-arrow {
    transform: rotate(180deg);
}

.submenu-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu-list .menu-item {
    margin-bottom: 0;
}

.submenu-list .menu-link {
    padding-left: 3.5rem;
    font-size: 0.85rem;
}

.submenu-list .menu-link:hover::before {
    width: 2px;
}

/* Video Creation Submenu Styles */
.video-creation-toggle {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin: 0.25rem 0;
    cursor: pointer;
}

.video-creation-toggle:hover,
.video-creation-toggle.expanded {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.video-creation-toggle i:first-child {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.video-creation-toggle.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.video-creation-submenu {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    overflow: hidden;
    border-left: 2px solid rgba(99, 102, 241, 0.2);
    margin-left: 1rem;
    padding-left: 0.5rem;
}

.video-creation-submenu .menu-item {
    margin-bottom: 0.25rem;
}

.video-creation-submenu .menu-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    margin: 0;
}

.video-creation-submenu .menu-link:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateX(4px);
}

.video-creation-submenu .menu-link i {
    font-size: 0.9rem;
    width: 16px;
    opacity: 0.8;
}

/* YouTube Authorization Status */
.youtube-menu-item {
    position: relative;
}

.youtube-menu-item .menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    opacity: 0.8;
    margin-left: 0.5rem;
}

.auth-indicator.authenticated {
    color: #10b981; /* Green for authenticated */
}

.auth-indicator.needs-auth {
    color: #f59e0b; /* Orange for needs auth */
    animation: pulse 2s infinite;
}

.auth-indicator.error {
    color: #ef4444; /* Red for error */
}

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

.youtube-auth-button-container {
    padding: 0.5rem 1.5rem 0.75rem 1.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid var(--purple);
    margin: 0.25rem 0;
    border-radius: 0 4px 4px 0;
}

.auth-button {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.auth-button.pulse {
    animation: authButtonPulse 1.5s infinite;
}

@keyframes authButtonPulse {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        transform: translateY(0);
    }
    50% { 
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
        transform: translateY(-2px);
    }
}

.menu-frequency {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* User Section */
.user-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

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

/* Login Prompt */
.login-prompt {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Auth Required Message */
.auth-required-message {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    text-align: center;
}

.auth-required-message a {
    color: var(--purple-light);
    text-decoration: none;
    font-weight: 600;
}

.auth-required-message a:hover {
    text-decoration: underline;
}

/* Subscription Section */
.subscription-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.subscribe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.cancel-subscription-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.cancel-subscription-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    font-size: 0.875rem;
    font-weight: 500;
}

.subscription-status i {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    width: 100%;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
}

/* DateTime Display */
.datetime-display {
    position: fixed;
    top: 2rem;
    left: 300px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInLeft 0.8s ease-out;
    z-index: 90;
}

.datetime-icon {
    display: none;
}

.datetime-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.date-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.time-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Adjust logo container when it contains logo-text */
.logo:has(.logo-text) {
    gap: 0;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: var(--shadow-medium);
    animation: pulse 2s infinite;
}

/* Override logo-icon styles when it contains logo-text */
.logo-icon:has(.logo-text) {
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    box-shadow: none;
    animation: none;
}

/* Remove this rule as it conflicts with .logo-text */
.logo h1:not(.logo-text) {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.highlight {
    color: var(--purple-light);
    font-weight: 600;
}

/* Chat Container */
.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 2rem;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-glass);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.chat-messages {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    min-height: 400px;
    scroll-behavior: smooth;
}

.welcome-message {
    text-align: center;
    padding: 3rem 1rem;
    opacity: 0.8;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--purple-light);
    margin: 0 auto 1.5rem;
    border: 1px solid var(--border-color);
}

.welcome-message h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Messages */
.message {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-user .message-content {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 20px 20px 6px 20px;
    max-width: 80%;
    box-shadow: var(--shadow-light);
}

.message-bot {
    display: flex;
    justify-content: flex-start;
}

.message-bot .message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 20px 20px 20px 6px;
    max-width: 80%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    line-height: 1.6;
}

.message-content {
    font-size: 1rem;
    word-wrap: break-word;
}

.message-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: right;
}

/* Input Container */
.input-container {
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid var(--border-color);
    background: rgba(26, 29, 41, 0.5);
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

#promptInput {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    min-height: 56px;
    max-height: 120px;
    transition: all 0.2s ease;
}

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

#promptInput::placeholder {
    color: var(--text-muted);
}

#promptInput:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-button {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.send-button:active {
    transform: translateY(0);
}

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

/* Footer */
.footer {
    margin-top: 2rem;
    text-align: center;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.model-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(42, 45, 58, 0.5);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 11, 14, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--purple);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

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

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .container {
        padding: 1rem 0.5rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .chat-messages {
        padding: 1.5rem;
    }
    
    .input-container {
        padding: 1rem 1.5rem 1.5rem;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .auth-modal {
        margin: 1rem;
        max-width: none;
    }
    
    /* Responsive datetime display */
    .datetime-display {
        position: static;
        left: auto;
        margin: 0 auto 1.5rem;
        width: fit-content;
    }
    
    .header {
        padding-top: 0;
    }
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--purple);
}

/* Channel Selector and Subscription Styles */
.channel-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.channel-selector {
    margin-bottom: 1rem;
}

.channel-selector label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.channel-selector select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.channel-selector select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.channel-actions {
    margin-bottom: 1rem;
}

.subscription-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    font-size: 0.875rem;
}

.subscription-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.subscription-btn:disabled {
    cursor: not-allowed;
    transform: none;
}

/* Active subscription state */
.subscription-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    opacity: 0.9;
}

/* Processing subscription state */
.subscription-btn.processing {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    animation: processingPulse 2s ease-in-out infinite;
}

/* Waiting subscription state */
.subscription-btn.waiting {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    opacity: 0.9;
}

@keyframes processingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

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

.channel-status {
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 500;
}

.channel-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.channel-empty p {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.create-channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.create-channel-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--purple);
    transform: translateY(-1px);
}

.create-channel-btn i {
    font-size: 0.875rem;
}

/* Generate Images Button */
.generate-images-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    justify-content: center;
}

.generate-images-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-images-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

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

.generate-images-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.generate-images-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-images-btn:disabled::before {
    display: none;
}

.generate-images-btn i {
    font-size: 1.2rem;
}

.generate-images-btn span {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Check Payment Status Button */
.check-payment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

.check-payment-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.check-payment-btn:disabled {
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

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

/* Payment Modal Styles */
.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 14, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.payment-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.payment-modal {
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-heavy);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.payment-modal-overlay.active .payment-modal {
    transform: translateY(0) scale(1);
}

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

.payment-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-payment-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

.payment-modal-body {
    padding: 2rem;
}

.channel-info {
    text-align: center;
    margin-bottom: 2rem;
}

.channel-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.channel-name {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.plan-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.plan-option {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
}

.plan-option:hover {
    border-color: var(--purple-light);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.plan-option.selected {
    border-color: var(--purple);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.plan-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.plan-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--purple);
}

.plan-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
}

.payment-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cancel-payment-btn {
    padding: 0.875rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.submit-payment-btn {
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.submit-payment-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.submit-payment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Video Generation Status */
.generation-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin: 10px 0;
}

.generation-status i {
    font-size: 20px;
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.video-completed,
.video-failed,
.video-timeout,
.video-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin: 10px 0;
}

.video-completed i {
    font-size: 24px;
}

.generated-video-container {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.generated-video {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.video-thumbnail {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 8px;
}

.video-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.download-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.download-video-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Previous Videos Section */
.previous-videos-container {
    margin-top: 2rem;
}

.loading-videos {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.previous-videos-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.previous-videos-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.video-status-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}

.video-status-badge.completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.video-status-badge.processing {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.video-status-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.video-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.video-preview {
    position: relative;
    background: #000;
}

.video-preview video {
    width: 100%;
    height: auto;
    display: block;
}

.video-processing,
.video-failed {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.video-processing i,
.video-failed i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.video-processing i {
    color: #f59e0b;
}

.video-failed i {
    color: #ef4444;
}

.check-status-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.check-status-btn:hover {
    background: var(--bg-primary);
    border-color: var(--purple);
}

.video-card .video-actions {
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.video-card .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.video-card .download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.no-videos,
.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-videos i,
.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

/* Fix for centering intro/outro interface */
.intro-interface, .outro-interface, .intro-outro-interface {
    display: flex !important;
    flex-direction: column !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 2rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
}

/* Ensure the main content container centers the interface properly */
.main-content .intro-outro-interface,
.main-content .intro-interface,
.main-content .outro-interface {
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
}

/* Even more specific selectors to override JavaScript-injected styles */
body .main-content .intro-outro-interface,
body .main-content .intro-interface,
body .main-content .outro-interface,
html body .intro-outro-interface,
html body .intro-interface,
html body .outro-interface {
    display: flex !important;
    flex-direction: column !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 2rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
} /* Updated Wed Jun 18 10:26:52 PM CDT 2025 */

/* Force centering using flexbox on the main content container */
.main-content:has(.intro-outro-interface),
.main-content:has(.intro-interface),
.main-content:has(.outro-interface) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 2rem !important;
}

/* Alternative approach - use CSS Grid for perfect centering */
.main-content {
    display: grid !important;
    place-items: center start !important;
    grid-template-columns: 1fr !important;
    padding: 2rem !important;
}

/* Left-justify intro/outro interface elements */
.intro-outro-interface, .intro-interface, .outro-interface { align-items: flex-start !important; text-align: left !important; }
.intro-outro-interface h2, .intro-interface h2, .outro-interface h2 { align-self: center !important; text-align: center !important; width: 100% !important; }
.intro-outro-interface .file-upload-section, .intro-outro-interface .btn { align-self: stretch !important; text-align: left !important; margin-left: 0 !important; }

/* Force left alignment for intro/outro interface buttons and elements */
.intro-outro-interface .select-file-btn,
.intro-outro-interface .upload-btn,
.intro-outro-interface .concatenate-btn { align-self: flex-start !important; }
.intro-outro-interface .option-group { justify-content: flex-start !important; }
.intro-outro-interface .upload-container { text-align: left !important; }

/* FORCE LEFT ALIGNMENT - Maximum specificity override */
html body .main-content .intro-outro-interface {
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: left !important;
    width: 100% !important;
    max-width: none !important;
    transform: none !important;
    left: auto !important;
    position: static !important;
}

/* Force all content to left align */
html body .main-content .intro-outro-interface * {
    text-align: left !important;
}

/* Keep only headers centered */
html body .main-content .intro-outro-interface h2,
html body .main-content .intro-outro-interface h3.intro-outro-header {
    text-align: center !important;
}

/* Left-justify just the main header */
.intro-outro-interface .intro-outro-header,
.intro-outro-interface .intro-outro-header h2 {
    text-align: center !important;
}

.intro-outro-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Clip replacement styles */
.clip-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.clip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--purple);
}

.clip-card .clip-video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0;
}

.clip-info {
    padding: 1rem;
    background: var(--bg-secondary);
}

.clip-keyword {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.clip-duration {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.clip-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.replace-clip-btn {
    background: var(--orange) !important;
    transition: all 0.2s ease;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.85rem;
}

.replace-clip-btn:hover {
    background: #d97706 !important;
    transform: translateY(-1px);
}

.play-clip-btn {
    background: var(--purple) !important;
    transition: all 0.2s ease;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.85rem;
}

.play-clip-btn:hover {
    background: var(--purple-dark) !important;
    transform: translateY(-1px);
}

/* Modal styles */
.modal-overlay {
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-heavy);
    animation: modalSlideIn 0.3s ease;
    color: var(--text-primary);
}

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

.modal-content h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

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

.modal-content input[type="text"] {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#replacementPreview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

#replacementPreview > div {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

#replacementPreview > div:last-child {
    border-bottom: none;
}

#replacementPreview > div:hover {
    background: var(--bg-glass) !important;
}

#replacementPreview video {
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

#replacementPreview button {
    background: var(--purple);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
}

#replacementPreview button:hover {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

.modal-content .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-content .modal-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.modal-content .modal-actions button:first-child {
    background: var(--purple);
    color: white;
}

.modal-content .modal-actions button:first-child:hover {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

.modal-content .modal-actions button:last-child {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.modal-content .modal-actions button:last-child:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

/* Video Creation Mode Styling */
.video-mode-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.video-mode-section > label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.video-mode-section > label i {
    color: var(--purple);
    font-size: 1.2rem;
}

.video-mode-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.mode-option {
    position: relative;
    cursor: pointer;
    display: block;
    transition: all 0.3s ease;
}

.mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-card {
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.mode-option:hover .mode-card {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: rgba(99, 102, 241, 0.3);
}

.mode-option:hover .mode-card::before {
    opacity: 1;
}

.mode-option input[type="radio"]:checked + .mode-card {
    border-color: var(--purple);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.mode-option input[type="radio"]:checked + .mode-card::before {
    opacity: 1;
}

.mode-option input[type="radio"]:checked + .mode-card::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    background: var(--purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-option input[type="radio"]:checked + .mode-card::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.mode-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.mode-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.mode-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.mode-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Provider Section Styling (matching the video mode styling) */
.provider-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.provider-section > label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.provider-section > label i {
    color: var(--orange);
    font-size: 1.2rem;
}

.provider-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.provider-option {
    position: relative;
    cursor: pointer;
    display: block;
    transition: all 0.3s ease;
}

.provider-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.provider-card {
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.provider-option:hover .provider-card {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: rgba(245, 158, 11, 0.3);
}

.provider-option:hover .provider-card::before {
    opacity: 1;
}

.provider-option input[type="radio"]:checked + .provider-card {
    border-color: var(--orange);
    background: rgba(245, 158, 11, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.15);
}

.provider-option input[type="radio"]:checked + .provider-card::before {
    opacity: 1;
}

.provider-option input[type="radio"]:checked + .provider-card::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    background: var(--orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.provider-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-light) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.provider-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.provider-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.provider-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Vividity B-Reel (Local Stock) Options Styling */
.local-stock-options-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.local-stock-options-section > label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.local-stock-options-section > label i {
    color: var(--purple);
    font-size: 1.2rem;
}

.local-stock-options {
    display: grid;
    gap: 1rem;
}

.local-stock-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.local-stock-select:hover {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.local-stock-select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.local-stock-select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.5rem;
}

.stock-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.generate-stock-video-btn {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-height: 44px;
}

.generate-stock-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.generate-stock-video-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-stock-video-btn i {
    font-size: 1rem;
}

/* Local Video Upload Styles */
.upload-local-video-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-height: 44px;
    margin-left: 10px;
}

.upload-local-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.upload-local-video-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.upload-local-video-btn i {
    font-size: 1rem;
}

.generate-local-video-btn {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-height: 44px;
}

.generate-local-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.generate-local-video-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-local-video-btn i {
    font-size: 1rem;
}

.local-video-file-input {
    padding: 0.5rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    display: inline-block;
    min-width: 300px;
}

.local-video-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.local-video-input[readonly] {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.8;
}

.local-video-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Stock Video Preview Styles */
.stock-video-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

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

.preview-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.preview-controls {
    display: flex;
    gap: 0.5rem;
}

.preview-btn {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    min-height: 36px;
}

.preview-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

.preview-video-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.preview-video-player {
    width: 100%;
    height: auto;
    min-height: 250px;
    display: block;
    background: #000;
}

.preview-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.preview-duration {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-duration::before {
    content: "⏱️";
    font-size: 1rem;
}

.preview-usage {
    color: var(--orange);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-usage::before {
    content: "📊";
    font-size: 1rem;
}

.preview-usage.unused {
    color: var(--purple-light);
}

.preview-usage.unused::before {
    content: "🆕";
}

/* =================================================================
   ⚙️ Settings API Key Modal Styles
   ================================================================= */

.settings-api-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 14, 0.95);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.settings-api-overlay.active {
    opacity: 1;
    visibility: visible;
}

.settings-api-modal {
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 900px;
    box-shadow: var(--shadow-heavy);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
}

.settings-api-overlay.active .settings-api-modal {
    transform: translateY(0) scale(1);
}

.settings-api-modal-header {
    padding: 2rem 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.settings-api-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-api-modal-header h2 i {
    color: var(--purple);
}

.settings-api-modal-body {
    padding: 2rem;
}

.settings-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--purple);
}

.api-keys-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.api-section {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.api-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.api-section-title i {
    color: var(--purple);
    font-size: 1.2rem;
}

.api-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.api-field label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.api-label-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.api-label-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

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

.api-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.api-input-wrapper .api-input {
    padding-right: 3rem;
}

.api-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.api-input::placeholder {
    color: var(--text-muted);
    font-family: inherit;
}

.toggle-visibility {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toggle-visibility:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cancel-settings-btn {
    padding: 0.875rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

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

.save-settings-btn {
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.save-settings-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.save-settings-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.settings-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border-left: 3px solid #10b981;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.settings-note i {
    color: #10b981;
    font-size: 1.2rem;
}

/* API Key Status Indicators for Buttons */
.api-key-configured {
    border: 2px solid #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
    position: relative;
}

.api-key-configured::before {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid var(--bg-primary);
    z-index: 1;
}

.api-key-missing {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    position: relative;
}

.api-key-missing::before {
    content: '!';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid var(--bg-primary);
    z-index: 1;
}

/* Special styling for LLM option indicators */
.llm-option.api-key-configured {
    background: rgba(16, 185, 129, 0.05) !important;
}

.llm-option.api-key-missing {
    background: rgba(239, 68, 68, 0.05) !important;
}

.llm-option.api-key-configured label {
    border-color: #10b981 !important;
}

.llm-option.api-key-missing label {
    border-color: #ef4444 !important;
}

.llm-option.api-key-missing input[type="radio"]:disabled ~ label {
    opacity: 0.6;
    cursor: not-allowed;
}

.llm-option.api-key-missing .llm-description::after {
    content: ' (API key required)';
    color: #ef4444;
    font-weight: 500;
}

/* Disabled model styles */
.llm-option.model-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.llm-option.model-disabled label {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: #999 !important;
    cursor: not-allowed !important;
}

.llm-option.model-disabled input[type="radio"] {
    cursor: not-allowed;
}

.llm-option.model-disabled .llm-name {
    color: #999 !important;
}

.llm-option.model-disabled .llm-description {
    color: #999 !important;
}

/* API key needed badge */
.api-key-needed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-key-needed-badge i {
    font-size: 0.85rem;
}

/* Highlight the SELECTED (checked) model */
.llm-option input[type="radio"]:checked ~ label {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    border: 3px solid #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), 0 4px 12px rgba(102, 126, 234, 0.3) !important;
    transform: scale(1.02);
}

.llm-option input[type="radio"]:checked ~ label .llm-name {
    color: #667eea;
    font-weight: 600;
}

.llm-option input[type="radio"]:checked ~ label .llm-name::after {
    content: ' ✓ SELECTED';
    font-size: 0.7em;
    color: #667eea;
    font-weight: 700;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 4px;
}

.llm-option input[type="radio"]:checked ~ label .llm-description {
    color: var(--text-primary);
}

/* Selected state overrides API key indicators */
.llm-option.api-key-configured input[type="radio"]:checked ~ label {
    border-color: #667eea !important;
}

.llm-option.api-key-missing input[type="radio"]:checked ~ label {
    border-color: #667eea !important;
}

.api-key-warning {
    background: rgba(239, 68, 68, 0.05);
}

/* Tooltip for API key status */
.api-key-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
    z-index: 1000;
    box-shadow: var(--shadow-medium);
}

.api-key-missing:hover .api-key-tooltip,
.api-key-configured:hover .api-key-tooltip {
    opacity: 1;
    visibility: visible;
}

.api-key-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-color);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-heavy);
    border: 1px solid var(--border-color);
    z-index: 3000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 3px solid #10b981;
}

.notification-success i {
    color: #10b981;
}

.notification-error {
    border-left: 3px solid #ef4444;
}

.notification-error i {
    color: #ef4444;
}

.notification-info {
    border-left: 3px solid var(--purple);
}

.notification-info i {
    color: var(--purple);
}

.notification span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Responsive Design for Settings Modal */
@media (max-width: 768px) {
    .settings-api-modal {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .settings-api-overlay {
        padding: 0;
    }

    .settings-api-modal-header {
        padding: 1.5rem 1rem 1rem;
    }

    .settings-api-modal-body {
        padding: 1.5rem 1rem;
    }

    .api-section {
        padding: 1rem;
    }

    .settings-actions {
        flex-direction: column-reverse;
    }

    .cancel-settings-btn,
    .save-settings-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =================================================================
   🎬 Keyword Editing Styles for AI Images
   ================================================================= */

.keyword-editing-section {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.keyword-editing-section label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.keyword-editing-section small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.keywords-container {
    margin-top: 1rem;
}

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

.keywords-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.recalculate-btn {
    background: var(--purple);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.recalculate-btn:hover {
    background: var(--purple-dark);
}

.keywords-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.keyword-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.keyword-number {
    background: var(--purple);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.keyword-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.keyword-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: bold;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.keyword-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.keyword-segment {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.keyword-duration {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}
