/* ================================
   Premium LyricGen AI Design System
   ================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Premium Color Palette */
    --bg-deep: #0a0a0f;
    --bg-color: #12121a;
    --panel-bg: rgba(24, 24, 32, 0.95);
    --panel-bg-solid: #18181f;
    --card-bg: rgba(32, 32, 44, 0.8);

    /* Accent Gradients */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --glow-primary: rgba(99, 102, 241, 0.4);
    --glow-success: rgba(16, 185, 129, 0.4);

    /* Text Colors */
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accent Colors */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    --secondary-color: #475569;
    --secondary-hover: #334155;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;

    /* Semantic Colors */
    --inc-color: #4ade80;
    --exc-color: #fb7185;

    /* Borders & Surfaces */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--glow-primary);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
    background-attachment: fixed;
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 100%),
        radial-gradient(2px 2px at 40% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 100%),
        radial-gradient(2px 2px at 60% 40%, rgba(255, 255, 255, 0.06) 0%, transparent 100%),
        radial-gradient(2px 2px at 80% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ================================
   Layout
   ================================ */

.app-container {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ================================
   Sidebar
   ================================ */

.sidebar {
    width: 320px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.sidebar .logo {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar .logo h2 {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-header-actions {
    padding: 1.5rem 1.5rem 0 1.5rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

summary {
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition-fast);
    padding: 0.25rem 0;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

summary h3 {
    display: inline;
    margin: 0;
    cursor: pointer;
}

summary:hover {
    color: var(--primary-color);
}

summary:hover h3 {
    color: var(--primary-color);
}

.details-content {
    padding: 1rem 0 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-left: 2px solid var(--border-color);
    margin-left: 0.4rem;
}

.info-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    background: var(--primary-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    width: fit-content;
}

.include-section-list {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    /* Removed max-height/overflow to allow full expansion */
}

.include-section-list label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.include-section-list label:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-color);
}

/* Custom Checkbox */
.include-section-list input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    position: relative;
}

.include-section-list input[type="checkbox"]:checked {
    background: var(--primary-gradient);
    border-color: transparent;
}

.include-section-list input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 10px;
    font-weight: 700;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ================================
   Main Workspace
   ================================ */

.main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: transparent;
    height: 100vh;
    overflow: hidden;
}

/* ================================
   Form Controls
   ================================ */

.input-control {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition-fast);
    width: 100%;
}

textarea.input-control {
    resize: vertical;
    min-height: 60px;
}

.input-control::placeholder {
    color: var(--text-muted);
}

.input-control:hover {
    border-color: var(--border-light);
    background: rgba(0, 0, 0, 0.35);
}

.input-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px var(--primary-light);
}

select.input-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

select.input-control option {
    background: var(--panel-bg-solid);
    color: var(--text-color);
    padding: 0.5rem;
}

.text-inc {
    color: var(--inc-color);
}

.text-exc {
    color: var(--exc-color);
}

.radio-group.vertical {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 0.85rem;
}

.radio-group label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.radio-group input[type="radio"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
}

.radio-group input[type="radio"]:checked {
    border-color: var(--primary-color);
    background: var(--primary-color);
    box-shadow: inset 0 0 0 2px var(--bg-deep);
}

/* Flow Archetypes & Metronome */
.flow-vibe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.vibe-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.vibe-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.vibe-card.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.vibe-icon {
    font-size: 1.25rem;
    opacity: 0.7;
}

.vibe-card.active .vibe-icon {
    opacity: 1;
    color: var(--primary-color);
}

.vibe-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.flow-visualizer {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.metronome {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.metronome-arm {
    width: 2px;
    height: 15px;
    background: var(--primary-color);
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    animation: metronome-swing 1s ease-in-out infinite alternate;
}

@keyframes metronome-swing {
    from {
        transform: translateX(-50%) rotate(-45deg);
    }

    to {
        transform: translateX(-50%) rotate(45deg);
    }
}

.flow-info {
    flex: 1;
}

#pacing-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition-normal);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.full-width {
    width: 100%;
}

.flex-1 {
    flex: 1;
}

.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-success {
    background: var(--success-gradient);
}

.btn-success:hover {
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-gradient);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.button-group.compact {
    display: flex;
    gap: 0.5rem;
}

/* ================================
   Editor Panel - MAXIMIZED
   ================================ */

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: transparent;
    /* Seamless with main background now */
    padding: 1.5rem 2rem;
    height: 100%;
    overflow: hidden;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
}

.editor-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.char-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
}

.sections-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-right: 0.5rem;
    /* Extra padding at bottom for scrolling past last element */
    padding-bottom: 2rem;
}

/* ================================
   Song Section Cards
   ================================ */

.song-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.song-section:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.song-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 4px;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: var(--transition-fast);
}

.song-section:hover::before {
    opacity: 1;
}

.section-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.section-header .header-input {
    flex: 0 0 160px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.section-header .notes-input {
    flex: 1;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.section-header .syllable-count {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.section-lyrics textarea {
    width: 100%;
    min-height: 200px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    resize: vertical;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    transition: var(--transition-fast);
}

.section-lyrics textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: rgba(0, 0, 0, 0.25);
}

.section-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
}

.control-icons {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn.delete:hover {
    color: var(--exc-color);
    background: rgba(251, 113, 133, 0.1);
    border-color: rgba(251, 113, 133, 0.3);
}

.regen-group {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 500px;
    margin-left: 1rem;
}

.regen-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.regen-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ================================
   Bottom Bar
   ================================ */

.bottom-bar {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--panel-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
}

/* ================================
   Modal
   ================================ */
/* ... preserving modal styles largely ... */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.hidden {
    display: none;
}

.modal-content {
    background: var(--panel-bg-solid);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.songs-list {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.song-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.song-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.song-info {
    cursor: pointer;
    flex: 1;
}

.song-info strong {
    display: block;
    color: var(--text-color);
}

.song-info small {
    color: var(--text-muted);
}

.song-actions {
    margin-left: 1rem;
}

/* Mobile Responsive */
@media (max-width: 960px) {
    .app-container {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        height: auto;
    }

    .sidebar-content {
        overflow: visible;
        padding: 1.5rem;
    }

    .main-workspace {
        height: auto;
        overflow: visible;
        padding-bottom: 2rem;
    }

    .editor-panel {
        height: auto;
    }

    .sections-container {
        overflow: visible;
    }
}

/* Accordion Styles */
details {
    /* overflow: hidden; */
    transition: var(--transition-normal);
}

details summary {
    list-style: none;
    /* Hide default triangle */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    cursor: pointer;
}

details summary::-webkit-details-marker {
    display: none;
}

.summary-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

details[open] .summary-icon {
    transform: rotate(90deg);
    color: var(--primary-color);
}

.mt-2 {
    margin-top: 0.5rem;
}

/* Settings Modal Styles */
.large-modal {
    max-width: 900px;
    width: 95%;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.providers-list-header {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 50px;
    gap: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.provider-row {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 50px;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.provider-row:hover {
    border-color: var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
}

.provider-row input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

/* ================================
   Login Page
   ================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-box {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box .error-message {
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.3);
    color: var(--exc-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ================================
   Workspace Tabs
   ================================ */

.workspace-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem 0;
    flex-shrink: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.3);
}

.tab-btn.active {
    background: var(--panel-bg);
    color: var(--text-color);
    border-color: var(--glass-border);
}

.tab-btn.active i {
    color: var(--primary-color);
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ================================
   Ideas Tab
   ================================ */

.ideas-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    overflow: hidden;
}

.ideas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
}

.ideas-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.ideas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

@media (max-width: 900px) {
    .ideas-grid {
        grid-template-columns: 1fr;
    }
}

.idea-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.idea-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.idea-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.idea-card-header i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.idea-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.idea-list {
    list-style: none;
    padding: 1rem 1.25rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.idea-item {
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.idea-item:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.idea-placeholder {
    padding: 1rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.idea-card-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.idea-card-controls label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    min-width: 100px;
}

#song-topic-input {
    flex: 1;
    min-width: 150px;
}

/* ================================
   Song Concept Wizard
   ================================ */
.wizard-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

.wizard-progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1rem;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.step-indicator {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    color: var(--text-muted);
    z-index: 2;
    transition: var(--transition-normal);
}

.step-indicator.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
    z-index: 1;
}

.wizard-step-container {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

#wizard-step-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#wizard-step-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.wizard-input-group {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto 2rem auto;
}

.wizard-results-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wizard-option-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    display: flex;
    align-items: center;
    font-size: 1rem;
}

.wizard-option-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.wizard-option-card::before {
    content: '➜';
    margin-right: 1rem;
    color: var(--primary-color);
    opacity: 0;
    transition: var(--transition-fast);
}

.wizard-option-card:hover::before {
    opacity: 1;
}

.wizard-final-card {
    background: var(--success-gradient);
    padding: 2rem;
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease-out;
}

.final-details {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    text-align: left;
}

.final-details p {
    margin: 0.5rem 0;
}

.loading-pulse {
    font-size: 1.1rem;
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* New Genre Styles */
.wizard-option-card.new-genre {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.wizard-option-card.new-genre:hover {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.new-badge {
    background: var(--success-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.genre-definition-form {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.4s ease-out;
}

.genre-definition-form .form-group label {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: block;
}

.genre-definition-form textarea {
    background: rgba(0, 0, 0, 0.3);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}

/* Wizard Actions Row */
.wizard-actions-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.wizard-reroll-btn,
.wizard-restart-inline-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-reroll-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.wizard-restart-inline-btn:hover {
    background: rgba(251, 113, 133, 0.1);
    border-color: var(--exc-color);
    color: var(--exc-color);
}

/* Context Summary */
.wizard-context-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.context-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-color);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 500;
}

.context-badge i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

/* Completed Step Indicator */
.step-indicator.completed {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--success-color);
}

.step-indicator.completed::after {
    content: ' ✓';
}

/* Better description styling */
#wizard-step-desc p {
    margin: 0;
    color: var(--text-secondary);
}

/* ================================
   Ideas Tab - Suggestion Card
   ================================ */
.ideas-results-container {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.suggestion-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid var(--glass-border);
}

.suggestion-header i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.suggestion-header h4 {
    margin: 0;
    font-weight: 600;
    color: var(--text-color);
}

.suggestion-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.suggestion-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.suggestion-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-row .input-control {
    background: rgba(0, 0, 0, 0.3);
}

.structure-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.structure-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.structure-checkbox:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.structure-checkbox input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.suggestion-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

.suggestion-actions .btn {
    flex: 1;
}

/* ================================
   Genres Tab
   ================================ */
.genres-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    overflow: hidden;
}

.genres-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
}

.genres-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.genres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.genre-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
}

.genre-card:hover {
    border-color: var(--glass-border);
    box-shadow: var(--shadow-md);
}

.genre-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.genre-card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.genre-card-header h4 i {
    color: var(--primary-color);
}

.genre-card-actions {
    display: flex;
    gap: 0.5rem;
}

.genre-card-body {
    padding: 1rem 1.25rem;
    max-height: 200px;
    overflow-y: auto;
}

.genre-definition {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.icon-btn.delete:hover {
    background: rgba(251, 113, 133, 0.15);
    border-color: var(--exc-color);
    color: var(--exc-color);
}

.text-muted {
    color: var(--text-muted);
}

.error-msg {
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.3);
    color: var(--exc-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
}

@media (max-width: 768px) {
    .genres-grid {
        grid-template-columns: 1fr;
    }

    .suggestion-actions {
        flex-direction: column;
    }
}