:root {
    --bg-color: #0a0a0a;
    --surface-color: #141414;
    --surface-light: #222;
    --primary-color: #a3ff00; /* Neon Lime Green */
    --primary-glow: rgba(163, 255, 0, 0.4);
    --danger-color: #ff4444;
    --warn-color: #ffb020;
    --text-color: #ffffff;
    --text-muted: #888899;
    --border-color: #333;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: radial-gradient(circle at 50% 0%, rgba(163, 255, 0, 0.08) 0%, transparent 70%);
}

.app-container {
    width: 100%;
    max-width: 1150px;
    padding: 2.5rem;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(163, 255, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 1rem;
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 800;
    box-shadow: 0 0 15px var(--primary-glow);
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--primary-glow);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(163, 255, 0, 0.05);
    box-shadow: 0 0 40px rgba(163, 255, 0, 0.1) inset;
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    pointer-events: none;
}

.drop-content p {
    font-size: 1.2rem;
    font-weight: 600;
}

.drop-content span.sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: -1rem;
}

.drop-content svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 15px var(--primary-glow));
    transition: var(--transition);
}

.drop-zone:hover .drop-content svg {
    transform: translateY(-10px) scale(1.1);
}

.hidden {
    display: none !important;
}

.editor {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    position: relative;
    align-items: flex-start;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-height: 640px;
}

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

.sidebar-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-header .count {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-small {
    padding: 0.4rem;
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: inline-flex;
    transition: var(--transition);
}

.btn-small:hover {
    background: var(--primary-color);
    color: var(--bg-color);
}

.file-list {
    list-style: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-right: 0.5rem;
}

.file-list::-webkit-scrollbar {
    width: 6px;
}
.file-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface-light);
    border: 1px solid transparent;
    position: relative;
}

.file-item:hover {
    border-color: rgba(163, 255, 0, 0.3);
}

.file-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(163, 255, 0, 0.1);
}

.file-item.done {
    opacity: 0.55;
}

.file-item-main {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.file-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
    font-weight: 500;
}

.file-item-level {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.file-item-level.analyzing {
    color: var(--primary-color);
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-delete:hover {
    color: var(--danger-color);
    background: rgba(255, 68, 68, 0.1);
}

.main-editor {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.card {
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.settings-col {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    min-width: 200px;
}

.settings-col label.field-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.pill-toggle {
    display: flex;
    background: var(--surface-light);
    border-radius: 12px;
    overflow: hidden;
    padding: 4px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.pill-toggle input {
    display: none;
}

.pill-toggle label {
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: var(--transition);
    color: var(--text-muted);
    white-space: nowrap;
}

.pill-toggle input:checked + label {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.pro-select, .pro-input {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.pro-select:focus, .pro-input:focus {
    border-color: var(--primary-color);
}

.target-input-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.target-input-group .pro-input {
    width: 90px;
}

.target-unit {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.pro-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.pro-checkbox:hover {
    color: var(--text-color);
}

.pro-checkbox input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.pro-checkbox .hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 400;
}

/* Preview / Meters */
.preview-file-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meter-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.meter-header .value {
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}

.meter-track {
    position: relative;
    height: 14px;
    background: var(--surface-light);
    border-radius: 7px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #5577ff, var(--primary-color));
    border-radius: 7px 0 0 7px;
    width: 0%;
    transition: width 0.25s ease;
}

.meter-fill.after {
    background: linear-gradient(90deg, var(--primary-color), #d4ff66);
}

.meter-target-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--warn-color);
    left: 100%;
    box-shadow: 0 0 6px var(--warn-color);
}

.gain-readout {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    text-align: right;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-preview-play {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-preview-play:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-preview-play.playing {
    background: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--primary-color);
}

.preview-time {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: auto;
}

.empty-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem 0;
}

/* Export panel */
.export-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.filename-input {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    flex-grow: 1;
    outline: none;
    transition: var(--transition);
}

.filename-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(163, 255, 0, 0.15);
}

.filename-input::placeholder {
    color: var(--text-muted);
}

.btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-color);
    outline: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    gap: 0.5rem;
    box-shadow: 0 0 20px var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.btn-primary:hover {
    box-shadow: 0 0 35px var(--primary-glow);
    transform: translateY(-3px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.export-progress {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.progress-track {
    height: 10px;
    background: var(--surface-light);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #5577ff, var(--primary-color));
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px var(--primary-glow);
}

#loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
}

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

@media (max-width: 1000px) {
    .editor {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        max-height: 260px;
    }
    .export-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
