:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --success: #10b981;
    --border: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 550px;
    padding: 2rem;
    margin: 4rem auto 2rem auto;
}

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

header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #a78bfa, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    border: 2px dashed var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

.upload-section:hover {
    border-color: var(--primary);
}

input[type="file"] {
    display: none;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

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

#fileName {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    word-break: break-all;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

select, input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: 1rem;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.actions {
    margin-top: 2rem;
}

button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 6px;
    background-color: var(--success);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover:not(:disabled) {
    opacity: 0.9;
}

button:disabled {
    background-color: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.status-area {
    margin-top: 1.5rem;
    text-align: center;
}

#statusText {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.download-btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}

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

/* Drag and Drop Active State */
.upload-section.drag-active {
    border-color: var(--primary);
    background-color: rgba(139, 92, 246, 0.1);
    transform: scale(1.02);
    transition: all 0.2s ease-in-out;
}

/* Cymatic Animation Loader */
.cymatic-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 2rem auto;
    display: none;
}
.cymatic-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: pulseCymatic 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}
.cymatic-ring:nth-child(2) { animation-delay: -0.66s; }
.cymatic-ring:nth-child(3) { animation-delay: -1.33s; }

@keyframes pulseCymatic {
    0% { width: 0; height: 0; opacity: 1; border-width: 4px; }
    100% { width: 100px; height: 100px; opacity: 0; border-width: 1px; }
}

/* Before & After Audio Player */
.audio-compare-section {
    background: #0f111a;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    border: 1px solid var(--border);
    text-align: center;
}
.audio-compare-section h3 {
    margin-top: 0;
    color: var(--text-main);
}
.audio-compare-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}
.audio-btn {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.audio-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* Live Counter */
.live-counter-container {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.live-counter-container .pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px var(--success);
    animation: blink 1.5s infinite;
}
@keyframes blink { 0% {opacity: 1;} 50% {opacity: 0.3;} 100% {opacity: 1;} }

/* Sticky Mobile Footer */
.mobile-sticky-footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 1rem;
    border-top: 1px solid var(--border);
    z-index: 100;
    text-align: center;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.5);
}
.mobile-sticky-footer button {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .mobile-sticky-footer.visible {
        display: block;
    }
}
