/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --accent-pink: #6366f1;
    --accent-pink-hover: #818cf8;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-gradient-hover: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #c084fc 100%);
    --border-color: #2d2d4a;
    --sidebar-width: 220px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    font-size: 14px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-pink);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

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

.sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

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

.logo-img {
    height: 24px;
    width: auto;
}

/* Text fallback for logo */
.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-pink);
}

.logo-text span {
    color: var(--text-primary);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
}

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

.nav-item.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-left-color: var(--accent-pink);
}

.nav-item:focus-visible {
    outline: 2px solid var(--accent-pink);
    outline-offset: -2px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Supporter Badge */
.supporter-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: auto 0.75rem 0.4rem;
    padding: 0.45rem 0.7rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 14px;
    color: #fbbf24;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.supporter-badge:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(245, 158, 11, 0.2) 100%);
    border-color: rgba(251, 191, 36, 0.6);
    transform: translateY(-1px);
}

.supporter-badge:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.supporter-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Credits Badge - For supporters */
.credits-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: auto 0.75rem 0.4rem;
    padding: 0.35rem 0.6rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.credits-badge:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

.credits-badge:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.credits-icon {
    color: #22c55e;
    display: flex;
    align-items: center;
}

.credits-icon svg {
    width: 16px;
    height: 16px;
}

.credits-display {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.credits-amount {
    font-size: 0.85rem;
    font-weight: 600;
    color: #22c55e;
}

.credits-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.credits-plus {
    font-size: 0.85rem;
    font-weight: 700;
    color: #22c55e;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.credits-badge:hover .credits-plus {
    opacity: 1;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    position: fixed;
    top: 0.875rem;
    left: 1rem;
    z-index: 1001;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.625rem;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.hamburger:focus-visible {
    outline: 2px solid var(--accent-pink);
    outline-offset: 2px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Mobile Logo */
.mobile-logo {
    display: none;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem 1.5rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 0.6rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wavespeed-balance {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.35rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.wavespeed-balance svg {
    width: 14px;
    height: 14px;
}

/* Preference Dropdown */
.preference-dropdown {
    position: relative;
}

.preference-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-family: inherit;
}

.preference-btn:hover {
    border-color: var(--accent-pink);
}

.preference-icon,
.dropdown-arrow {
    width: 16px;
    height: 16px;
}

.gender-icon {
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
    letter-spacing: -0.1em;
}

.preference-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 101;
}

.preference-menu.active {
    display: flex;
}

.preference-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.8rem;
    text-align: left;
    font-family: inherit;
}

.preference-option:hover {
    background: var(--bg-tertiary);
}

/* Login Button */
.login-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    border-color: var(--accent-pink);
    background: rgba(99, 102, 241, 0.1);
}

/* Create Button */
.create-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    background: var(--accent-gradient);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.create-btn:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.create-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Content Area */
.content-area {
    flex: 1;
    width: 100%;
}

.content-padded {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Page Title */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.prompt-section {
    padding: calc((100svh - 54.5px - 227px) / 2) 1.5rem 1.5rem;
}

.prompt-container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.prompt-title {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.prompt-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.prompt-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.prompt-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--accent-pink);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-end;
}

.generate-btn:hover {
    background: var(--accent-pink-hover);
}

.generate-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

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

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

/* Examples Section */
.examples-section {
    padding: 1rem 1.5rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.examples-container {
    text-align: center;
}

.examples-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.example-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    padding: 0;
}

.example-card:hover {
    border-color: var(--accent-pink);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.example-card:focus-visible {
    outline: 2px solid var(--accent-pink);
    outline-offset: 2px;
}

.example-video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

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

.example-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.example-info {
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

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

.example-card:hover .example-text {
    color: var(--text-primary);
}

.copy-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-secondary);
    opacity: 0.5;
}

.example-card:hover .copy-icon {
    opacity: 1;
    color: var(--accent-pink);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    opacity: 0.3;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--accent-pink);
}

.empty-title {
    font-size: 24px;
    color: #E0E0E0;
    margin-bottom: 10px;
}

.empty-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.cta-btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--accent-pink);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.cta-btn:hover {
    background: var(--accent-pink-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
}

/* Library Styles */
.library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.library-header .page-title {
    margin-bottom: 0;
}

.create-action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--accent-pink);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.create-action-btn:hover {
    background: var(--accent-pink-hover);
}

.create-action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Page Footer */
.page-footer-section {
    margin-top: 4rem;
    padding: 0 1rem 2rem;
}

.footer-separator {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.separator-logo {
    display: flex;
    align-items: center;
    opacity: 0.6;
}

.separator-logo-img {
    height: 28px;
    width: auto;
}

/* Text fallback */
.separator-logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-pink);
}

.separator-logo-text span {
    color: var(--text-secondary);
}

.page-footer {
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: #aaa;
}

.footer-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Status Message */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.status-message.active {
    display: block;
}

.status-message.success {
    border-color: #22c55e;
}

.status-message.error {
    border-color: #ef4444;
}

/* Responsive */
@media (max-width: 900px) {
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .examples-section {
        padding: 0 1rem 2rem;
    }
}

@media (max-width: 791px) {
    :root {
        --sidebar-width: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        max-width: 80vw;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .hamburger {
        display: flex;
    }

    .mobile-logo {
        display: none;
    }

    .top-bar {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0.75rem 1rem;
        padding-left: 60px;
        gap: 0.75rem;
        flex-wrap: nowrap;
    }

    .top-actions {
        margin-left: auto;
    }

    .preference-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .preference-icon {
        display: none;
    }


    .prompt-section {
        padding: calc((100svh - 54.5px - 242px) / 2) 1rem 1rem;
    }

    .prompt-title {
        font-size: 1.4rem;
    }

    .generate-btn {
        width: 100%;
        align-self: stretch;
    }

    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-padded {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .prompt-title {
        font-size: 1.2rem;
    }

    .top-bar {
        padding: 0.625rem 0.75rem;
        padding-left: 52px;
    }

    .preference-btn {
        padding: 0.4rem 0.625rem;
        font-size: 0.75rem;
    }

    .create-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}

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

/* General Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.modal.active {
    display: block;
}

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

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 480px;
    width: 90%;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

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

/* Minutes/Credits Modal */
.minutes-modal {
    max-width: 400px;
}

.minutes-modal-top {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
    margin: -1.5rem -1.5rem 0;
}

.modal-minutes-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    color: #22c55e;
}

.minutes-balance {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.minutes-count {
    font-size: 1.5rem;
    font-weight: 600;
    color: #22c55e;
    line-height: 1;
}

.minutes-modal-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.7;
}

.minutes-modal-body {
    padding: 1.2rem 0 0;
}

.minutes-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.topup-form {
    margin-top: 0.5rem;
}

.topup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topup-btn:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
}

.topup-btn svg {
    width: 18px;
    height: 18px;
}

/* Topup Amount Selector */
.topup-amount-selector {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.topup-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.topup-preset {
    padding: 0.75rem 0.5rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.topup-preset:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.topup-preset-selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-pink);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.topup-credits-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 8px;
}

.topup-credits-info strong {
    color: var(--accent-pink);
    font-size: 1rem;
}

@media (max-width: 400px) {
    .topup-presets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 791px) {
    .modal-content {
        padding: 1.5rem;
        max-width: none;
        width: calc(100% - 2rem);
    }

    .modal-minutes-icon {
        width: 32px;
        height: 32px;
    }
}

/* Status Messages */
.status-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.status-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Library Page */
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.create-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-pink);
    color: var(--text-primary);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.create-action-btn:hover {
    background: var(--accent-pink-hover);
}

.create-action-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.generations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.generation-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.generation-card:hover {
    border-color: var(--accent-pink);
    background: rgba(99, 102, 241, 0.05);
}

.generation-thumbnail {
    width: 80px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.generation-content {
    flex: 1;
    min-width: 0;
}

.generation-title {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
}

.empty-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.empty-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cta-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent-pink);
    color: var(--text-primary);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.cta-btn:hover {
    background: var(--accent-pink-hover);
}

/* Generation Detail Page */
.generation-detail {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

.generation-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.generation-title {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.generation-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.generation-status-completed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.generation-status-processing,
.generation-status-pending {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.generation-status-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.generation-video {
    margin-bottom: 1.5rem;
}

.video-player {
    width: 100%;
    border-radius: 12px;
    background: var(--bg-secondary);
}

.generation-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.action-btn-primary {
    background: var(--accent-pink);
    color: var(--text-primary);
}

.action-btn-primary:hover {
    background: var(--accent-pink-hover);
}

.generation-processing,
.generation-failed {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

.processing-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.generation-failed svg {
    width: 48px;
    height: 48px;
    color: #ef4444;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.generation-meta-detail {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.meta-value {
    font-weight: 600;
}

.generation-prompt-full {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
}

.generation-prompt-full h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.generation-prompt-full p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 791px) {
    .library-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .generations-list {
        grid-template-columns: 1fr;
    }

    .generation-header {
        flex-direction: column;
    }

    .generation-meta-detail {
        flex-wrap: wrap;
        gap: 1rem;
    }
}
