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

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1f1f1f;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #c4c4c4;
    --accent-pink: #EAA11B;
    --accent-pink-hover: #d4910f;
    --accent-text: #000000;
    --border-color: #3d3d3d;
    --sidebar-width: 220px;
}

body {
    font-family: 'Poppins', -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: var(--accent-text);
    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: 20px;
    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);
}

/* Language Selector */
.language-selector {
    position: relative;
    margin-bottom: 0.5rem;
}

.language-current {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.language-current:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.language-chevron {
    transition: transform 0.2s ease;
}

.language-dropdown.show + .language-current .language-chevron,
.language-current[aria-expanded="true"] .language-chevron {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.375rem;
    margin-bottom: 0.375rem;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

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

.language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

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

.language-option.active {
    background: var(--accent-pink);
    color: var(--accent-text);
}

.language-flag {
    font-size: 1rem;
    line-height: 1;
}

.language-name {
    flex: 1;
}

/* 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 - hidden on desktop */
.mobile-logo {
    display: none;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    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-spacer {
    flex: 1;
}

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

.admin-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--accent-pink);
    padding: 0.35rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.admin-badge svg {
    width: 14px;
    height: 14px;
}

.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.4rem;
    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);
}

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

.orientation-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.preference-option .orientation-icon {
    width: 22px;
    height: 22px;
}

.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(234, 161, 27, 0.1);
}

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

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

.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(234, 161, 27, 0.2);
}

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

/* Form Actions Row */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Clip Selector & Orientation Selector (Supporters Only) */
.clips-selector,
.orientation-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clips-selector {
    margin-right: auto;
}

.clips-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.clips-select {
    padding: 0.35rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.clips-select:focus {
    outline: none;
    border-color: var(--accent-pink);
}

.clips-info-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0.6;
}

.clips-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    z-index: 100;
}

.clips-tooltip.show {
    display: block;
}


.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(--accent-text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.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(234, 161, 27, 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-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;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.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: var(--accent-text);
    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(234, 161, 27, 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(--accent-text);
    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;
    position: relative;
    z-index: 2;
    background: var(--bg-primary);
}

.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;
}

.footer-disclaimer {
    color: var(--text-secondary);
    font-size: 0.7rem;
    opacity: 0.5;
    margin-top: 0.5rem;
}

/* Status Message */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    font-weight: 500;
    font-size: 0.95rem;
}

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

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

.status-message.error {
    background: #dc2626;
    color: #fff;
}

/* 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;
        position: fixed;
        top: 5px;
        left: 5px;
        width: 44px;
        height: 44px;
        padding: 0.625rem;
        flex-shrink: 0;
        z-index: 1001;
    }

    .hamburger span {
        width: 20px;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-header {
        padding-left: 4rem;
    }

    /* Mobile logo above toolbar */
    .mobile-logo {
        display: block;
        position: sticky;
        top: 0;
        z-index: 101;
        text-align: center;
        background-color: var(--bg-secondary);
        padding: 0.5rem 0;
    }

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

    /* Mobile toolbar - below logo */
    .top-bar {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        flex-wrap: nowrap;
        position: sticky;
        top: 40px;
        z-index: 100;
        background-color: var(--bg-secondary);
    }

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

    .preference-dropdown {
        display: flex;
    }

    .preference-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.375rem;
        min-width: auto;
    }

    .dropdown-arrow {
        width: 14px;
        height: 14px;
    }

    .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;
        gap: 0.5rem;
    }

    .hamburger {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
    }

    .hamburger span {
        width: 18px;
    }

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

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

    .login-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(234, 161, 27, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(234, 161, 27, 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(234, 161, 27, 0.15);
    border-color: rgba(234, 161, 27, 0.4);
    color: var(--text-primary);
    transform: translateY(-1px);
}

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

.topup-credits-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.5rem;
    background: rgba(234, 161, 27, 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(--accent-text);
    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(234, 161, 27, 0.05);
}

.generation-thumbnail-wrap {
    position: relative;
    width: 80px;
    height: 60px;
    flex-shrink: 0;
}

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

/* Vertical video format thumbnails */
.generation-card.vertical-format .generation-thumbnail-wrap {
    width: 45px;
    height: 80px;
}

.generation-card.vertical-format .generation-thumbnail {
    width: 45px;
    height: 80px;
}

.generation-processing,
.generation-failed {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
}

.generation-processing svg {
    width: 24px;
    height: 24px;
    color: var(--accent-pink);
    animation: spin 1s linear infinite;
}

.generation-failed svg {
    width: 24px;
    height: 24px;
    color: #ff4444;
}

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

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.status-processing {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
}

.status-failed {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.status-completed {
    background: rgba(68, 255, 68, 0.2);
    color: #44ff44;
}

.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;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-btn:hover {
    border-color: var(--accent-pink);
    background: var(--accent-pink);
    color: var(--accent-text);
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0 1rem;
}

.pagination-dots {
    color: var(--text-secondary);
    padding: 0 0.25rem;
}

/* 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(--accent-text);
    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-merging {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

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

.generation-status-rejected {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.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(--accent-text);
}

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

.action-btn-danger {
    background: transparent;
    color: #ff4444;
    border: 1px solid #ff4444;
}

.action-btn-danger:hover {
    background: rgba(255, 68, 68, 0.1);
}

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

.processing-state,
.generation-detail .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;
    }
}
