@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette — Bright Forest Green with warm accents */
    --bg-color: #172e17;
    --bg-secondary: #3b533b;
    --text-color: #e8f4e8;
    --text-muted: #b0c8b0;
    --primary-color: #54de16;
    --primary-hover: #7DFC6C;
    --accent-color: #c2c534;
    --accent-yellow: #e7f233;
    --accent-orange: #eebf35;
    --border-color: rgba(84, 222, 22, 0.25);
    --border-glow: #54de16;

    /* Green gradients */
    --green-gradient: linear-gradient(135deg, #206020, #40e010);
    --green-gradient-short: linear-gradient(135deg, #206020, #40e010);
    /* Warm accent gradient (avatar, upgrade buttons) */
    --warm-gradient: linear-gradient(135deg, #f4a636, #e7f233);
    /* Multi-color animated gradient */
    --vivid-gradient: linear-gradient(135deg, #40e010, #c4dc37, #e7f233, #f4a636, #7DFC6C, #40e010);

    /* Component specific */
    --chat-bg-user: #1a3820;
    --chat-bg-ai: #111811;
    --sidebar-width: 280px;

    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3 {
    margin-top: 0;
    font-weight: 600;
    letter-spacing: -0.025em;
}

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

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

/* ===================== TOP NAVIGATION BAR ===================== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 60px;
    background: #2a422a;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(84, 222, 22, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233, #f4a636, #7DFC6C, #40e010);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    animation: vividShift 6s linear infinite;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 4px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    color: var(--text-color);
    background: rgba(64, 224, 16, 0.06);
    border-color: var(--border-glow);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

.nav-tab.active {
    color: #090e09;
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233);
    box-shadow: 0 2px 12px rgba(196, 220, 55, 0.4);
}

.nav-icon {
    font-size: 1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-credit-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

/* User Menu Dropdown */
.user-menu-wrapper {
    position: relative;
}

.user-menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #090e09;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--font-family);
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(244, 166, 54, 0.4);
    background: var(--warm-gradient);
}

.user-menu-trigger:hover .user-avatar {
    transform: scale(1.08);
    box-shadow: 0 2px 16px rgba(231, 242, 51, 0.5);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(64, 224, 16, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.25rem 0;
}

.user-dropdown-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-dropdown-plan {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.6rem 0;
}

.user-dropdown-balance {
    padding: 0 0.25rem;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.balance-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.balance-value {
    font-size: 0.85rem;
    font-weight: 600;
}

.topup-value {
    color: #94cc54;
}

.balance-total {
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
}

.user-dropdown-actions {
    display: flex;
    gap: 6px;
}

.dropdown-action-btn {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.dropdown-action-btn:hover {
    background: rgba(84, 222, 22, 0.08);
    border-color: var(--border-glow);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

.dropdown-action-btn.upgrade-btn {
    background: var(--warm-gradient);
    border: none;
    color: #090e09;
}

.dropdown-action-btn.upgrade-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 14px rgba(244, 166, 54, 0.5);
}

.dropdown-action-btn.topup-btn {
    border-color: #94cc5440;
    color: #94cc54;
}

.dropdown-action-btn.topup-btn:hover {
    background: #94cc5410;
}

.dropdown-action-btn.logout-btn {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===================== HOME PAGE ===================== */
.home-hero {
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.home-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233, #f4a636, #7DFC6C, #40e010);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
    animation: vividShift 5s linear infinite;
}

.home-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.home-card {
    background: rgba(59, 83, 59, 0.45);
    border: 1px solid rgba(84, 222, 22, 0.08);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45), 0 12px 30px rgba(84, 222, 22, 0.15);
}

.home-card-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.home-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.home-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===================== AUTH FORM CARD ===================== */
.auth-form-card {
    background: rgba(59, 83, 59, 0.45);
    border: 1px solid rgba(84, 222, 22, 0.08);
    border-radius: 18px;
    padding: 2rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ===================== LAYOUT ===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - 60px);
}

/* ===================== SIDEBAR (CHAT) ===================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.chat-input-area {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ===================== BUTTONS ===================== */
.btn-primary {
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233);
    color: #090e09;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-family: var(--font-family);
    box-shadow: 0 4px 15px rgba(196, 220, 55, 0.3);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(231, 242, 51, 0.45);
    filter: brightness(1.08);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(84, 222, 22, 0.1);
    border-color: var(--border-glow);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

/* ===================== FORM ELEMENTS ===================== */
input,
select,
textarea {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: var(--font-family);
    transition: all 0.2s;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-glow);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

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

/* ===================== GENERATION PAGES (IMAGE & MUSIC) ===================== */
.gen-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.gen-header {
    text-align: center;
    margin-bottom: 2rem;
}

.gen-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.gen-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

.gen-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.gen-form {
    background: rgba(59, 83, 59, 0.45);
    border: 1px solid rgba(84, 222, 22, 0.08);
    border-radius: 18px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.gen-input-group {
    margin-bottom: 1rem;
}

.gen-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.gen-input-group textarea,
.gen-input-group input[type="text"] {
    width: 100%;
}

.gen-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.gen-option {
    flex: 1;
    min-width: 180px;
}

.gen-option label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.gen-option select {
    width: 100%;
}

.gen-btn {
    width: 100%;
    font-size: 1rem;
    padding: 0.9rem;
}

.gen-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-size: 0.95rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

/* Mode toggle (Music page) */
.gen-mode-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.25rem;
}

.mode-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    color: var(--text-color);
    background: rgba(64, 224, 16, 0.06);
}

.mode-btn.active {
    color: #090e09;
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233);
    box-shadow: 0 2px 12px rgba(196, 220, 55, 0.4);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* File input */
.file-input-wrapper {
    margin-top: 0.25rem;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.file-input-label:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
    color: var(--text-color);
}

.file-preview-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===================== IMAGE GALLERY ===================== */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.image-card {
    border-radius: 14px;
    background: rgba(59, 83, 59, 0.45);
    border: 1px solid rgba(84, 222, 22, 0.08);
    transition: all 0.3s ease;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.image-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45), 0 12px 30px rgba(84, 222, 22, 0.15);
}

.image-card img {
    width: 100%;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.image-card-prompt {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================== MUSIC RESULTS ===================== */
.music-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.track-card {
    display: flex;
    flex-direction: column;
    background: rgba(59, 83, 59, 0.45);
    border: 1px solid rgba(84, 222, 22, 0.08);
    border-radius: 14px;
    padding: 1rem;
    transition: all 0.3s ease;
    gap: 0.75rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.track-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

.track-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.track-cover {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.track-cover-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

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

.track-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-style {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.track-audio {
    width: 200px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
}

.track-audio-full {
    width: 100%;
    height: 36px;
    border-radius: 12px;
    overflow: hidden;
}

.track-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233);
    color: #090e09 !important;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.track-download-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(64, 224, 16, 0.4);
    text-decoration: none !important;
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes greenShift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@keyframes vividShift {
    0% { background-position: 0% center; }
    100% { background-position: 300% center; }
}

.message-enter {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a3a2a;
}

/* ===================== CHAT ===================== */
#messages {
    scroll-behavior: smooth;
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.chat-message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
}

.chat-user {
    background-color: var(--chat-bg-user);
    color: #e8f4e8;
    border-bottom-right-radius: 4px;
}

.chat-ai {
    background-color: var(--chat-bg-ai);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.conversation-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background-color 0.2s;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.conversation-item:hover {
    background-color: rgba(84, 222, 22, 0.1);
    color: var(--text-color);
}

.conversation-item.active {
    background-color: rgba(84, 222, 22, 0.15);
    color: var(--primary-color);
    font-weight: 500;
}

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(64, 224, 16, 0.08);
}

.subscription-modal-content {
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
}

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

.plan-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.2s ease;
}

.plan-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

.plan-card.current {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.plan-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.plan-points {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.plan-features li {
    padding: 3px 0;
}

.plan-features li::before {
    content: '✓ ';
    color: #40e010;
}

.plan-btn {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.plan-btn.current {
    background: rgba(64, 224, 16, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
    cursor: default;
}

.plan-btn.upgrade {
    background: var(--warm-gradient);
    border: none;
    color: #090e09;
    font-weight: 600;
}

.plan-btn.upgrade:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(244, 166, 54, 0.45);
}

.topup-section {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

.topup-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.topup-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 1.25rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topup-card:hover {
    border-color: #94cc54;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(148, 196, 84, 0.2);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 0.75rem;
        gap: 8px;
    }

    .nav-brand {
        display: none;
    }

    .nav-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .nav-user {
        display: none;
    }

    .nav-right {
        gap: 6px;
    }

    .sidebar {
        width: 200px;
        padding: 1rem;
    }

    .home-title {
        font-size: 2rem;
    }

    .home-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .gen-options {
        flex-direction: column;
    }

    .track-card-top {
        flex-direction: column;
        text-align: center;
    }

    .track-audio-full,
    .track-audio {
        width: 100%;
    }

    .track-download-btn {
        width: 100%;
        justify-content: center;
    }

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

    .nav-plan-badge {
        display: none;
    }

    .image-gallery {
        grid-template-columns: 1fr;
    }

    .dashboard-container {
        padding: 1.5rem 1rem;
    }

    .dashboard-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .dashboard-song-item {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-song-audio {
        width: 100%;
    }
}

/* ===================== DASHBOARD ===================== */

.dashboard-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233, #f4a636, #7DFC6C, #40e010);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: vividShift 5s linear infinite;
}

.dashboard-section {
    margin-bottom: 2.5rem;
    background: rgba(59, 83, 59, 0.45);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(84, 222, 22, 0.08);
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dashboard-section-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.dashboard-see-all {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

.dashboard-see-all:hover {
    color: var(--primary-hover);
}

.dashboard-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    font-size: 0.9rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.dashboard-empty a {
    color: var(--primary-color);
}

/* Dashboard Chat List */
.dashboard-chat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-chat-item:hover {
    border-color: var(--border-glow);
    transform: translateX(4px);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

.dashboard-chat-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 1rem;
}

.dashboard-chat-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Dashboard Image Grid */
.dashboard-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.dashboard-image-card {
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.dashboard-image-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

.dashboard-image-card img {
    width: 100%;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
}

.dashboard-image-prompt {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dashboard Song List */
.dashboard-song-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-song-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.dashboard-song-item:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

.dashboard-song-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.dashboard-song-cover-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #40e010, #c4dc37, #e7f233);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.dashboard-song-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-song-style {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dashboard-song-audio {
    width: 280px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
}

/* ===================== DELETE BUTTONS ===================== */

.image-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
}

.image-card-footer .image-card-prompt {
    padding: 0;
    flex: 1;
    min-width: 0;
}

.image-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.image-delete-btn,
.track-delete-btn,
.chat-delete-btn {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 6px;
    opacity: 0.7;
    transition: all 0.2s;
    flex-shrink: 0;
    color: inherit;
}

.image-delete-btn:hover,
.track-delete-btn:hover,
.chat-delete-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 0.7);
    color: #ff6b6b;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.35);
}

/* Custom red delete tooltips */
.delete-tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.delete-tooltip-wrapper::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: auto;
    transform: none;
    background: rgba(30, 10, 10, 0.92);
    color: #ff6b6b;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 9999;
}

.delete-tooltip-wrapper:hover::after {
    opacity: 1;
}

/* ===================== VIDEO GENERATION PAGE ===================== */

.video-results {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.video-card {
    background: rgba(59, 83, 59, 0.45);
    border: 1px solid rgba(84, 222, 22, 0.08);
    border-radius: 14px;
    transition: all 0.3s ease;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.video-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 0 1px var(--border-glow), 0 0 18px rgba(84, 222, 22, 0.45);
}

.video-card-player {
    width: 100%;
    background: #000;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.video-player {
    width: 100%;
    max-height: 480px;
    display: block;
    object-fit: contain;
}

.video-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: rgba(0, 0, 0, 0.3);
}

.video-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.video-card-prompt {
    font-size: 0.82rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
}

.video-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Info box */
.gen-info-box {
    background: rgba(84, 222, 22, 0.08);
    border: 1px solid rgba(84, 222, 22, 0.2);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Dashboard video grid */
.dashboard-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.dashboard-video-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.dashboard-video-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

.dashboard-video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #000;
}

.dashboard-video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.3);
}

.dashboard-video-prompt {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .dashboard-video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================== IMAGE LIGHTBOX ===================== */

#image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.lightbox-backdrop {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 10px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    cursor: default;
    animation: lightbox-in 0.18s ease;
}

@keyframes lightbox-in {
    from { opacity: 0; transform: scale(0.93); }
    to   { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 0.7);
}

