* {
    box-sizing: border-box;
}

:root {
    --dark-bg: #20262B;
    --dark-surface: #2A3137;
    --dark: #37424a;
    --light: #D5DCE0;
    --accent: #54B76E;
    --accent-glow: rgba(84, 183, 110, 0.2);
    --error: #E57373;
    --success: #81C784;
    --warning: #FFB74D;

    --text-gray-300: #C2C7CC;
    --text-gray-400: #9AA3AA;
    --text-gray-500: #788086;

    --glass-bg: rgba(42, 49, 55, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.04);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

/* Utility Classes for Spacing */
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }

/* Global / Body Setup */
body.app-body {
    background-color: var(--dark-bg);
    color: var(--light);
    font-family: 'Inter', 'system-ui', '-apple-system', 'sans-serif';
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.no-scroll {
    overflow: hidden;
}

/* Container & Layout */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 1280px;
}

/* Header Styling */
.main-header {
    position: relative;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(84, 183, 110, 0.2);
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
    overflow: hidden;
}

/* ✅ FIX: DISABLE expensive animation - it kills GPU/CPU */
.main-header::before {
    content: '';
    position: absolute;
    inset: -10%;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    /* animation: header-drift 18s ease-in-out infinite alternate; REMOVED */
    z-index: 0;
}

/* Keep keyframes for potential future use, but don't apply */
@keyframes header-drift {
    0%   { transform: scale(1.05) translate(0%, 0%); }
    33%  { transform: scale(1.08) translate(-1.5%, 1%); }
    66%  { transform: scale(1.06) translate(1%, -1%); }
    100% { transform: scale(1.1)  translate(-1%, 0.5%); }
}

.header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.15) 100%);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 10;
}

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

.main-title {
    font-size: 2rem;
    line-height: 1;
    font-weight: 900; /* Πιο παχύ βάρος */
    font-family: 'Plus Jakarta Sans', sans-serif;
    
    /* Εφέ Outline (Περίγραμμα) */
    color: transparent; /* Κάνουμε το εσωτερικό διάφανο */
    -webkit-text-stroke: 1.5px var(--accent); /* Το πράσινο περίγραμμα */
    
    text-transform: uppercase; /* Όλα κεφαλαία όπως στην εικόνα */
    letter-spacing: 0.05em; /* Λίγο κενό ανάμεσα στα γράμματα για readability */
    margin-bottom: 0.5rem;

    /* Ενισχυμένο Neon Glow */
    text-shadow:
        0 0 10px rgba(84, 183, 110, 0.8),
        0 0 20px rgba(84, 183, 110, 0.4),
        0 0 40px rgba(84, 183, 110, 0.2);
}

/* Για μεγάλες οθόνες */
@media (min-width: 768px) {
    .main-title {
        font-size: 4rem; /* Λίγο μεγαλύτερο για να δείξει το εφέ */
        -webkit-text-stroke: 2px var(--accent); /* Πιο παχύ outline στο desktop */
        letter-spacing: 0.1em;
    }
}
.header-description {
    font-size: 1.125rem;
    color: var(--text-gray-300);
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    line-height: 1.5;
}

.btn-kofi {
    background-color: rgba(255, 138, 76, 0.12);
    color: #FF8A4C;
    font-weight: 600;
    border: 1px solid rgba(255, 138, 76, 0.35);
}

.btn-kofi:hover:not(:disabled) {
    background-color: rgba(255, 138, 76, 0.22);
    border-color: rgba(255, 138, 76, 0.6);
    box-shadow: 0 0 12px rgba(255, 138, 76, 0.2);
}

/* Destructive ghost — visible border, clearly secondary */
.btn-ghost-destructive {
    background: transparent;
    color: var(--text-gray-400);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-ghost-destructive:hover:not(:disabled) {
    color: #E57373;
    border-color: rgba(229, 115, 115, 0.4);
    background: rgba(229, 115, 115, 0.06);
    transform: none;
}

@media (min-width: 768px) {
    .main-header {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    .main-title {
        font-size: 3.75rem;
        line-height: 1;
        letter-spacing: -1.5px;
    }
}

.sub-text {
    font-size: 0.875rem; 
    color: var(--text-gray-400); 
    line-height: 1.5;
}

.header-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

/* Responsive adjustments for Header */
@media (min-width: 640px) { /* sm breakpoint */
    .header-actions {
        flex-direction: row;
    }
}
@media (min-width: 768px) { /* md breakpoint */
    .main-header {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    .main-title {
        font-size: 4rem;
        line-height: 1;
        -webkit-text-stroke: 2px var(--accent);
        letter-spacing: 0.08em;
    }
}

.main-title-lower {
    text-transform: lowercase;
}

/* Main Content Layout */
.main-content {
    padding-top: 1rem;
    padding-bottom: 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ── Mobile: compact everything to reduce scroll ── */
@media (max-width: 767px) {
    .main-content {
        padding-top: 0.5rem;
        padding-bottom: 1rem;
    }

    .main-grid {
        gap: 0.75rem;
    }

    .input-controls-panel, .output-panel {
        gap: 0.5rem;
    }

    /* Tighten the generate section bottom padding */
    .input-controls-panel > .card:last-child > div:last-child {
        padding: 1rem;
    }

    /* Reduce composition card top padding */
    .composition-card {
        padding: 0.75rem !important;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

@media (min-width: 1024px) { /* lg breakpoint */
    .main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        align-items: start;
    }

    .input-controls-panel {
        position: sticky;
        top: 1rem;
    }
}

.input-controls-panel, .output-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
@media (min-width: 768px) {
    .input-controls-panel, .output-panel {
        gap: 1rem;
    }
}

/* Card Styling */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    border-color: rgba(84, 183, 110, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(84, 183, 110, 0.08) inset;
}

.tabs-card {
    display: flex;
    flex-direction: column;
}

.tabs-card .tab-content-wrapper {
    flex: 1;
    padding: 1.25rem;
}

.tabs-card > div:last-child {
    margin-top: auto;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--light);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.composition-card, .visualizer-card {
    padding: 1rem;
}
@media (min-width: 768px) {
    .composition-card, .visualizer-card {
        padding: 1.5rem;
    }
}


/* Buttons General */
.btn {
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 500;
    transition: background-color 0.2s, opacity 0.2s, box-shadow 0.2s, transform 0.15s ease;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
}
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}
.btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-secondary {
    background: rgba(55, 66, 74, 0.7);
    /* ✅ FIX: Reduce blur from 6px to 3px */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--light);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    color: var(--light);
}

.btn-accent {
    background: linear-gradient(135deg, #54B76E 0%, #3da85a 100%);
    color: #0f1a14;
    font-weight: 800;
    border: 1px solid rgba(84, 183, 110, 0.3);
    box-shadow: 0 2px 8px rgba(84, 183, 110, 0.2), 0 1px 0 rgba(255,255,255,0.15) inset;
}

.btn-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, #5ec878 0%, #48b865 100%);
    box-shadow: 0 4px 20px rgba(84, 183, 110, 0.45), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.btn-kofi svg {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-kofi-cta {
    background: transparent;
    color: #FF8A4C;
    font-weight: 600;
    border: 1.5px solid #FF8A4C;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.btn-kofi-cta:hover:not(:disabled) {
    background-color: #FF8A4C;
    color: #1a1a1a;
    box-shadow: 0 0 20px rgba(255, 138, 76, 0.35);
}

.btn-kofi-cta svg {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-large {
    padding: 0.75rem 1.5rem;
}

.btn-huge {
    font-size: 1.25rem;
    padding: 1rem 2rem;
    letter-spacing: 0.01em;
    box-shadow: 
        0 4px 20px rgba(84, 183, 110, 0.4), 
        0 0 40px rgba(84, 183, 110, 0.15),
        0 1px 0 rgba(255,255,255,0.15) inset;
}
.btn-huge:hover:not(:disabled) {
    box-shadow: 
        0 0 40px rgba(84, 183, 110, 0.7), 
        0 0 80px rgba(84, 183, 110, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.4), 
        0 1px 0 rgba(255,255,255,0.2) inset;
    transform: translateY(-2px);
}

/* Generate button — ίδιο πλάτος με textarea, centered */
#generate.btn-huge {
    width: auto;
    min-width: 60%;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.btn-action {
    padding: 0.75rem 1rem;
}

.btn-warning {
    background-color: #d97706;
    color: white;
    font-weight: 600;
}
.btn-warning:hover:not(:disabled) {
    background-color: #b45309;
}

/* Tabs */
.tab-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: rgba(20, 24, 28, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0.35rem;
    gap: 0.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.tab-list::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray-500);
    transition: color 0.2s ease, background-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
    border-radius: 0.375rem;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-gray-300);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
    background: rgba(84, 183, 110, 0.08);
    color: #ffffff;
    font-weight: 700;
    border-color: transparent;
    border-bottom: 2px solid var(--accent);
    border-radius: 0.375rem 0.375rem 0 0;
    box-shadow: none;
}

.tab-panel {
    display: none !important;
}

.tab-panel.active {
    display: flex !important;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

/* Forms */
.form-group-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-fields-container {
        gap: 1.5rem;
    }
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 0.5rem;
}

.form-label-small {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray-400);
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .text-area {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--light);
    transition: all 0.2s;
    font-size: 1rem;
}
.text-area {
    padding: 0.75rem 1rem;
    background-color: var(--dark-bg);
    line-height: 1.7;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}


.form-input::placeholder, .text-area::placeholder {
    color: var(--text-gray-500);
    font-style: italic;
    line-height: 1.7;
}

.form-input:focus, .form-select:focus, .text-area:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(84, 183, 110, 0.2);
}

.text-area {
    resize: vertical;
    font-size: 1rem;
}

.form-select {
    background-color: var(--dark);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
}

.form-select-small {
    width: 100%;
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
    border-radius: 0.5rem;
    background-color: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--light);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.form-select-small:focus {
     border-color: var(--accent);
    outline: none;
}


/* Track Types Grid */
.track-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}
@media (min-width: 640px) { /* sm breakpoint */
    .track-types-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

.track-type-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.track-type-text {
    font-size: 0.875rem;
    color: var(--text-gray-400);
    transition: color 0.2s;
}
.track-type-label:hover .track-type-text {
    color: var(--light);
}

/* Musical Properties Grid */
.section-separator {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
@media (min-width: 768px) {
    .section-separator {
        padding-top: 1.5rem;
    }
}

.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--light);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0.75rem;
}
@media (min-width: 640px) { /* sm breakpoint */
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Status Messages */
#status-container {
    min-height: 2.5rem;
    margin-top: 1rem;
    position: relative;
}

.status-message {
    padding: 0.7rem 1rem;
    border-radius: 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--light);
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-height: 2.5rem;
    border: 1px solid transparent;
    border-left-width: 3px;
    line-height: 1.5;
}

/* Info — neutral slate */
.info-message {
    background-color: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.2);
    border-left-color: #64748B;
    color: #CBD5E1;
}

/* Success — teal/cyan, distinct from accent green */
.success-message {
    background-color: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
    border-left-color: #0EA5E9;
    color: #BAE6FD;
}

/* Warning — amber */
.warning-message {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    border-left-color: #F59E0B;
    color: #FDE68A;
}

/* Error — deep red */
.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    border-left-color: #EF4444;
    color: #FECACA;
}

/* Loading — violet/purple */
.loading-message {
    background-color: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.2);
    border-left-color: #8B5CF6;
    color: #DDD6FE;
    font-weight: 600;
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-top: 2px solid #8B5CF6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
    margin-top: 2px;
}

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

/* Examples Grid */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.example-btn {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    background-color: var(--dark);
    border: 1px solid rgba(84, 183, 110, 0.3);
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    cursor: pointer;
}
.example-btn:hover {
    background-color: var(--accent);
    color: var(--dark);
    border-color: var(--accent);
}

/* Variation Panel Styles */
.variation-source-info {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background-color: rgba(84, 183, 110, 0.05);
    border: 1px solid rgba(84, 183, 110, 0.15);
}

.raw-json-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.4rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.raw-json-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}
.source-title-small {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.source-title-large {
    display: block;
    margin-top: 0.5rem;
    color: var(--light);
    font-weight: 700;
}
.description {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-gray-400);
    font-style: italic;
}

.variation-controls-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}
@media (min-width: 640px) {
    .variation-controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.versions-section {
    display: flex;
    flex-direction: column;
}
.versions-list-content {
    margin-top: 0.75rem;
}
.versions-list-content p {
    font-size: 0.875rem;
    color: var(--text-gray-400);
}

.variation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.75rem;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.variation-card:hover {
    border-color: rgba(84, 183, 110, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.variation-card:first-child {
    margin-top: 0;
}
.variation-card-info h4 {
    font-weight: 600;
    color: var(--light);
    font-size: 1rem;
}
.variation-card-info p {
    font-size: 0.75rem;
    color: var(--text-gray-400);
}
.variation-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.variation-card-actions .btn-load {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.variation-card-actions .btn-delete {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    min-width: auto;
    width: auto;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 0.375rem;
}

.variation-card-actions .btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3) !important;
}

.variation-card-actions .btn-delete:active {
    transform: scale(0.95);
}

@media (max-width: 480px) {
    .variation-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .variation-card-info {
        width: 100%;
    }

    .variation-card-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .variation-card-actions .btn-load {
        flex: 1;
        min-width: 120px;
    }

    .variation-card-actions .btn-delete {
        padding: 0.5rem 0.625rem;
        font-size: 0.9rem;
    }
}

/* Who It's For — Audience Section */
.audience-section {
    background-color: var(--dark-bg);
    padding: 2.5rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.audience-label {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 1;
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 12px rgba(84, 183, 110, 0.4);
}

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

@media (min-width: 640px) {
    .audience-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .audience-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.audience-card {
    background: rgba(42, 49, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.875rem;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.audience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(84, 183, 110, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.audience-card:hover {
    border-color: rgba(84, 183, 110, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(84, 183, 110, 0.05);
    transform: translateY(-2px);
}

.audience-card:hover::before {
    opacity: 1;
}

.audience-icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 0.1rem;
}

.audience-role {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--light);
    margin: 0;
}

.audience-workflow {
    font-size: 0.78rem;
    color: var(--text-gray-400);
    line-height: 1.5;
    margin: 0;
}

.visualizer-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(84, 183, 110, 0.25);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    user-select: none;
    pointer-events: none;
}

.visualizer-placeholder svg {
    opacity: 0.4;
    color: var(--accent);
}

/* Track checkbox processing pulse */
@keyframes track-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

label.track-checkbox-processing {
    animation: track-pulse 1s ease-in-out infinite;
    pointer-events: none;
}

label.track-checkbox-processing::after {
    content: '...';
    font-size: 0.65rem;
    color: var(--accent);
    margin-left: 2px;
    letter-spacing: 1px;
}
.promo-section {
    background-color: var(--dark-bg);
    padding: 1.5rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.promo-card {
    max-width: 560px;
    margin: 0 auto;
    background: rgba(42, 49, 55, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(84, 183, 110, 0.25);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(84, 183, 110, 0.08) inset,
        0 0 40px rgba(84, 183, 110, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.promo-label {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.8;
    margin: 0;
}

.promo-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--light);
    margin: 0;
    letter-spacing: -0.02em;
}

.promo-desc {
    font-size: 0.875rem;
    color: var(--text-gray-400);
    line-height: 1.6;
    max-width: 400px;
    margin: 0;
}

.promo-btn {
    margin-top: 0.25rem;
}

/* Header action buttons — consistent height & alignment */
.header-btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.header-byop-btn {
    background: var(--accent);
    color: #0f1a14;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 0 16px var(--accent-glow);
    gap: 8px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-byop-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #0f1a14;
}

/* Pulsing live dot */
.byop-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0f1a14;
    opacity: 0.6;
    flex-shrink: 0;
    animation: byop-pulse 2s ease-in-out infinite;
}

@keyframes byop-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.35); }
}

/* Hide dot when key is not active (JS will toggle class) */
.header-byop-btn.byop-inactive .byop-pulse-dot {
    display: none;
}

/* Toast Notifications — fixed bottom right */
#toast-container {
    position: fixed;
    bottom: 5rem;
    right: 1.25rem;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    border-radius: 0.6rem;
    background: #0f1a14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(84, 183, 110, 0.06);
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    color: var(--light);
    min-width: 220px;
    max-width: 320px;
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-hiding {
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--accent);
    color: #0f1a14;
}

.toast-text {
    line-height: 1.4;
    flex: 1;
}

.toast-error {
    border-left-color: #EF4444;
}
.toast-error .toast-icon {
    background: #EF4444;
    color: white;
}

.toast-warning {
    border-left-color: #F59E0B;
}
.toast-warning .toast-icon {
    background: #F59E0B;
    color: #0f1a14;
}

.btn-export {
    border-color: rgba(84, 183, 110, 0.35);
    color: var(--accent);
    box-shadow: 0 0 10px rgba(84, 183, 110, 0.08);
}

.btn-export:hover:not(:disabled) {
    border-color: rgba(84, 183, 110, 0.6);
    color: var(--accent);
    box-shadow: 0 0 16px rgba(84, 183, 110, 0.2);
    background: rgba(84, 183, 110, 0.06);
}

/* Edit Tracks Hint Banner */
.edit-hint-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.875rem;
    margin-top: 0.5rem;
    background: rgba(84, 183, 110, 0.07);
    border: 1px solid rgba(84, 183, 110, 0.2);
    border-left: 3px solid var(--accent);
    border-radius: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-gray-300);
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: hint-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hint-slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.edit-hint-icon {
    color: var(--accent);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.edit-hint-text {
    flex: 1;
    line-height: 1.4;
}

.edit-hint-text strong {
    color: var(--accent);
    font-weight: 600;
}

.edit-hint-tab-btn {
    background: rgba(84, 183, 110, 0.12);
    border: 1px solid rgba(84, 183, 110, 0.3);
    color: var(--accent);
    border-radius: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.edit-hint-tab-btn:hover {
    background: rgba(84, 183, 110, 0.22);
}

.edit-hint-close {
    background: transparent;
    border: none;
    color: var(--text-gray-500);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.edit-hint-close:hover {
    color: var(--light);
}

/* Model Selector Tabs */
.model-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.model-tabs-locked {
    grid-template-columns: 1fr 1fr;
}

.model-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 7px 6px;
    border-radius: 0.4rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    gap: 1px;
    text-decoration: none;
}

.model-tab:hover:not(.active):not([disabled]) {
    background: rgba(255, 255, 255, 0.05);
}

.model-tab.active {
    background: var(--dark-surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.model-tab[data-model="midijourney-large"].active,
.model-tab[data-model="claude-sonnet"].active {
    background: rgba(255, 214, 0, 0.08);
    box-shadow: 0 0 8px rgba(255, 214, 0, 0.15);
}

.model-tab-icon {
    font-size: 0.6rem;
    color: #FFD600;
    opacity: 0.7;
}

.model-tab[data-model="midijourney-large"].active .model-tab-icon,
.model-tab[data-model="claude-sonnet"].active .model-tab-icon {
    opacity: 1;
}

.model-tab-label {
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-gray-400);
    transition: color 0.2s;
}

.model-tab.active .model-tab-label {
    color: var(--light);
}

.model-tab[data-model="midijourney-large"] .model-tab-label,
.model-tab[data-model="claude-sonnet"] .model-tab-label {
    color: rgba(255, 214, 0, 0.5);
}

.model-tab[data-model="midijourney-large"].active .model-tab-label,
.model-tab[data-model="claude-sonnet"].active .model-tab-label {
    color: #FFD600;
}

.model-tab-sub {
    font-size: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-gray-500);
    letter-spacing: 0.01em;
}

.model-tab.active .model-tab-sub {
    color: var(--text-gray-400);
}

/* Locked upgrade tab */
.model-tab-upgrade {
    opacity: 0.6;
    cursor: pointer;
}

.model-tab-upgrade:hover {
    opacity: 0.9;
    background: rgba(255, 214, 0, 0.06) !important;
}

.model-tab-lock {
    font-size: 0.7rem;
    line-height: 1;
}

.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--dark-surface);
    color: var(--text-gray-300);
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

/* Arrow pointing up toward button */
.tooltip-text::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.tooltip-wrapper:hover .tooltip-text {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.site-footer {
    background-color: var(--dark-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    /* Gradient fade to black */
    background: linear-gradient(to bottom, var(--dark-bg) 0%, #141a1e 100%);
}

.site-credits {
    text-align: center;
    padding: 1rem 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
}

/* Subtle gradient line at top of credits */
.site-credits::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(84, 183, 110, 0.3), transparent);
}

.site-credits-text {
    color: var(--text-gray-500);
    font-size: 0.72rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-gray-400);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

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

.footer-dot {
    color: rgba(255, 255, 255, 0.12);
}

/* Custom Floating Support Button */
#floating-support-btn {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    left: auto;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem 0.6rem 0.85rem;
    background: var(--dark-surface);
    border: 1px solid rgba(84, 183, 110, 0.25);
    border-radius: 2rem;
    color: var(--accent);
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(84, 183, 110, 0.08);
    transition: all 0.25s ease;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
}

#floating-support-btn:hover {
    background: rgba(84, 183, 110, 0.1);
    border-color: rgba(84, 183, 110, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(84, 183, 110, 0.15);
    transform: translateY(-2px);
}

.floating-support-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.floating-support-text {
    transition: opacity 0.25s ease, max-width 0.25s ease;
}

/* Mobile: show icon only */
@media (max-width: 480px) {
    #floating-support-btn {
        padding: 0.65rem;
        border-radius: 50%;
        max-width: unset;
        width: 2.75rem;
        height: 2.75rem;
        justify-content: center;
    }
    .floating-support-text {
        display: none;
    }
}

/* DAW Side-by-Side Layout */
.daw-layout {
    display: flex;
    flex-direction: column;
}

.daw-controls {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.daw-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.daw-controls-header .card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.daw-visualizer {
    flex: 1;
    min-height: 16rem;
}

.daw-visualizer .visualization-area {
    border-radius: 0 0 1rem 1rem;
    border: none;
    border-top: 1px solid rgba(84, 183, 110, 0.15);
    height: 100%;
    min-height: 16rem;
}

.playback-mode-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Desktop: side-by-side */
@media (min-width: 768px) {
    .daw-layout {
        flex-direction: row;
        min-height: 340px;
    }

    .daw-controls {
        width: 38%;
        flex-shrink: 0;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.07);
        padding: 1.25rem;
        overflow-y: auto;
    }

    .daw-visualizer {
        flex: 1;
    }

    .daw-visualizer .visualization-area {
        border-radius: 0 1rem 1rem 0;
        border-top: none;
        min-height: 340px;
    }
}

.composition-card {
    padding: 0 !important;
}

.metadata-display {
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-gray-400);
    line-height: 1.5;
}
.metadata-display p {
    margin-top: 0.3rem;
    line-height: 1.5;
    font-size: 0.78rem;
    margin-bottom: 0;
}
.metadata-display h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    letter-spacing: -0.02em;
}

.track-selection-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

/* "All Tracks" spans full width */
.track-selector[data-track-type="all"] {
    grid-column: span 2;
}

.track-selector {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.35rem 0.5rem;
    border-radius: 0.4rem;
    background-color: var(--dark);
    border: 1px solid rgba(255,255,255,0.07);
    color: var(--text-gray-400);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.track-selector:hover {
    color: var(--light);
    border-color: rgba(255, 255, 255, 0.2);
}

.track-selector.active {
    background-color: var(--accent);
    color: var(--dark-bg);
    border-color: var(--accent);
    font-weight: 600;
}

.transport-controls-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.playback-mode-section {
    margin-bottom: 1rem;
}
.playback-mode-section .form-label-small {
    margin-bottom: 0.5rem;
}


/* Visualization */
.visualization-area {
    border-radius: 0.5rem;
    border: 1px solid rgba(84, 183, 110, 0.2);
    height: 14rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 0 1px rgba(84, 183, 110, 0.08),
                0 0 20px rgba(84, 183, 110, 0.06),
                inset 0 0 30px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.visualization-area:hover {
    border-color: rgba(84, 183, 110, 0.4);
    box-shadow: 0 0 0 1px rgba(84, 183, 110, 0.15),
                0 0 30px rgba(84, 183, 110, 0.12),
                inset 0 0 30px rgba(0, 0, 0, 0.3);
}
@media (min-width: 640px) {
    .visualization-area {
        height: 24rem;
    }
}

/* Wrapper for Selects to add custom dropdown arrow */
.select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%; /* Must match the select width */
}

.select-wrapper::after {
    content: '▼'; /* Unicode down arrow */
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.75rem;
    color: var(--text-gray-400);
    transition: color 0.2s;
}

.select-wrapper:focus-within::after {
    color: var(--accent);
}


/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    /* ✅ FIX: Reduce blur from 4px to 2px */
    backdrop-filter: blur(2px);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: var(--dark-surface);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.modal-content-large {
    max-width: 800px;
}

.modal-content-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
}

.close-button {
    background: transparent;
    border: none;
    color: var(--text-gray-400);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-button:hover {
    color: var(--light);
}

.modal-text {
    color: var(--text-gray-300);
    margin-bottom: 1.5rem;
}

.modal-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Tutorial Specific Styles */
/* Tutorial Progress Bar */
.tutorial-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px 3px 0 0;
    overflow: hidden;
    margin: -1.5rem -1.5rem 1.25rem;
}

.tutorial-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(84, 183, 110, 0.5);
}

/* Tutorial Header */
.tutorial-header-inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tutorial-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.tutorial-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--light);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.tutorial-body p {
    margin-bottom: 0.85rem;
    line-height: 1.7;
    color: var(--text-gray-300);
    font-size: 0.95rem;
}

.tutorial-body strong {
    color: var(--accent);
    font-weight: 600;
}

.tutorial-body em {
    color: var(--text-gray-400);
    font-style: italic;
}

.tutorial-body ul,
.tutorial-body ol {
    color: var(--text-gray-300);
    line-height: 1.8;
    font-size: 0.95rem;
}

.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tutorial-progress {
    font-size: 0.78rem;
    color: var(--text-gray-500);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
}

.tutorial-navigation {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-nav {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-gray-500);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.5rem 0.5rem;
    transition: color 0.2s;
}

.btn-ghost:hover {
    color: var(--text-gray-300);
}

.modal.active {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

/* Tutorial Highlight */
.tutorial-highlight {
    border: 2px solid var(--accent) !important;
    box-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow) !important;
    transition: all 0.3s ease-out;
    z-index: 1;
    transform: scale(1.01);
    animation: tutorial-pulse 2s ease-in-out infinite;
}

@keyframes tutorial-pulse {
    0%, 100% { box-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow) !important; }
    50% { box-shadow: 0 0 16px rgba(84,183,110,0.6), 0 0 32px rgba(84,183,110,0.3) !important; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* Range Input Styling */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--dark);
    border: 1px solid rgba(0,0,0,0.2);
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Custom Checkbox Styling for Accent Color */
input[type="checkbox"] {
    appearance: none;
    background-color: var(--dark);
    border: 2px solid var(--light);
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
    width: 1rem;
    height: 1rem;
    min-width: 1rem; 
    min-height: 1rem;
}

input[type="checkbox"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: var(--dark-bg);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(84, 183, 110, 0.8);
}
