/* ===========================
   File: app.css
   Key & BPM Detector Styles
   =========================== */

/* --- ====Root & Reset - Purpose: Base styles, typography, and color system. Start====--- */
:root {
    --bg: #050816;
    --bg-elevated: #0b1020;
    --accent: #808080;
    --accent-soft: rgba(79, 70, 229, 0.15);
    --accent-strong: #4912c2;
    --accent-dark:#000;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-subtle: #1f2933;
    --danger: #f97373;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.75);
    --shadow-subtle: 0 10px 30px rgba(15, 23, 42, 0.6);
    --transition-fast: 0.18s ease-out;
    --transition-med: 0.25s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}
/* --- =====Root & Reset - End=====--- */

/* --- ====App Shell - Purpose: Centered card layout for desktop & mobile. Start====--- 
.app-shell {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 24px 16px;
}

.app-shell > * {
    width: 100%;
}
*/
.app-header,
.upload-section,
.status-section,
.results-section,
.notice-section,
.app-footer {
    max-width: 960px;
    margin: 0 auto;
}

.app-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.9));
    border-radius: var(--radius-lg);
    padding: 24px 20px 22px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(18px);
    margin-bottom: 18px;
    
}

.app-header1 {
background: linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(255, 255, 255, 1));
border-top:3px solid #FFA500; border-bottom:3px solid #FFA500;
    border-radius: var(--radius-lg);
    padding: 24px 20px 22px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(18px);
    margin-bottom: 18px;
    color:#000;
}
/* --- =====App Shell - End=====--- */

/* --- ====Header Styles - Purpose: Branding and audience messaging. Start====--- */
.app-title {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.app-subtitle {
    font-size: 0.98rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.app-target {
    font-size: 0.9rem;
    color: #e5e7eb;
}
/* --- =====Header Styles - End=====--- */

/* --- ====Upload Section Styles - Purpose: File input and CTA button. Start====--- */
.upload-section {
    background: rgba(15, 23, 42, 0.9);
    border-radius: var(--radius-lg);
    padding: 20px 18px 18px;
    box-shadow: var(--shadow-subtle);
    border: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.audio-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

#audio-file {
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: #020617;
    color: var(--text-main);
    font-size: 0.9rem;
}

#audio-file::file-selector-button {
    border: none;
    background: var(--accent);
    color: #e5e7eb;
    padding: 6px 12px;
    margin-right: 10px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

#audio-file::file-selector-button:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.primary-btn {
    margin-top: 4px;
    align-self: flex-start;
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #f9fafb;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.45);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(79, 70, 229, 0.55);
    filter: brightness(1.05);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

.helper-text {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
/* --- =====Upload Section Styles - End=====--- */

/* --- ====Status & Progress Styles - Purpose: Feedback during analysis. Start====--- */
.status-section {
    max-width: 960px;
    margin: 0 auto 12px;
}

.status-message {
    min-height: 20px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

/* Update these sections in your app.css */
.status-message--error { color: #ff6b6b !important; font-weight: bold; }
.status-message--success { color: #51cf66 !important; font-weight: bold; }
[hidden] { display: none !important; }

.progress-bar-wrapper {
    margin-top: 6px;
    width: 100%;
    max-width: 260px;
    height: 6px;
    border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    transition: width 0.2s ease-out;
}
/* --- =====Status & Progress Styles - End=====--- */

/* --- ====Results Styles - Purpose: Display key & BPM in cards. Start====--- */
.results-section {
    background: rgba(15, 23, 42, 0.95);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-subtle);
    margin-bottom: 16px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.result-card {
    background: radial-gradient(circle at top left, var(--accent-soft), #020617);
    border-radius: var(--radius-md);
    padding: 12px 12px 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-value {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.result-note {
    font-size: 0.78rem;
    color: var(--text-muted);
}
/* --- =====Results Styles - End=====--- */

/* --- ====Notice & Footer Styles - Purpose: Privacy and disclaimer messaging. Start====--- */
.notice-section {
    max-width: 960px;
    margin: 0 auto 10px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.7);
}

.notice-text {
    font-size: 0.86rem;
    color: var(--text-muted);
}

.app-footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 4px 0;
    text-align: center;
}

.footer-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.brand {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.9));
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 4px 0;
    text-align: center;
background: rgba(15, 23, 42, 0.7);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.brand-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}
/* --- =====Notice & Footer Styles - End=====--- */

/* --- ====Responsive Tweaks - Purpose: Mobile-first adjustments. Start====--- */
@media (min-width: 768px) {
    .app-shell {
        padding: 32px 24px;
    }

    .app-header {
        padding: 26px 24px 22px;
    }

    .upload-section {
        padding: 22px 20px 18px;
    }

    .results-section {
        padding: 20px 20px 18px;
    }
}
/* --- =====Responsive Tweaks - End=====--- */
