/* ============================================================
   CHECKMY.MUSIC — Global Stylesheet v3
   Contexts:
     1. Loading screen  → lava full-screen (fixed, z-index 9999)
     2. Main page       → near-white bg + colorful gradient at bottom
     3. Processing overlay → lava full-screen (fixed, z-index 500)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700;800;900&family=Space+Mono:wght@400;700&display=swap');

:root {
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono:    'Space Mono', monospace;
    --font-body:    'Space Grotesk', sans-serif;

    --lava-blue:    #3A5BFF;
    --lava-purple:  #8B3FFF;
    --lava-pink:    #E0308A;
    --lava-red:     #FF3B30;
    --lava-orange:  #FF7A00;

    --page-bg:      #f2f0f8;   /* near-white with a hint of lavender */
    --text-dark:    #111118;
    --text-mid:     #44445a;
    --text-light:   #8888aa;
    --white:        #ffffff;
    --black:        #0a0a0a;
    --dark-grey:    #2c2c2c;
}

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

html, body {
    width: 100%;
    min-height: 100%;
    font-family: var(--font-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   BODY — near-white background for the main page
   ============================================================ */
body {
    background: var(--page-bg);
    color: var(--text-dark);
}

/* ============================================================
   LAVA BACKGROUND — used ONLY inside loading & processing
   This div is hidden by default; shown only in those contexts
   ============================================================ */
.lava-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.lava-bg::before {
    content: '';
    position: absolute;
    width: 80vw; height: 80vw;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.92;
    background: radial-gradient(circle, var(--lava-blue) 0%, var(--lava-purple) 60%, transparent 100%);
    top: -20%; left: -15%;
    animation: lava-a 20s ease-in-out infinite alternate;
}

.lava-bg::after {
    content: '';
    position: absolute;
    width: 70vw; height: 70vw;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.92;
    background: radial-gradient(circle, var(--lava-orange) 0%, var(--lava-red) 40%, var(--lava-pink) 80%, transparent 100%);
    bottom: -20%; right: -10%;
    animation: lava-b 24s ease-in-out infinite alternate;
}

.lava-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.70;
    pointer-events: none;
}

.lava-blob-1 {
    width: 55vw; height: 55vw;
    background: radial-gradient(circle, var(--lava-purple) 0%, var(--lava-pink) 70%, transparent 100%);
    top: 30%; left: 15%;
    animation: lava-c 28s ease-in-out infinite alternate;
}

.lava-blob-2 {
    width: 45vw; height: 45vw;
    background: radial-gradient(circle, var(--lava-red) 0%, var(--lava-orange) 60%, transparent 100%);
    top: 5%; right: 0%;
    animation: lava-d 22s ease-in-out infinite alternate;
}

@keyframes lava-a {
    0%   { transform: translate(0,0) scale(1); }
    33%  { transform: translate(14vw,10vh) scale(1.12); }
    66%  { transform: translate(6vw,22vh) scale(0.94); }
    100% { transform: translate(20vw,6vh) scale(1.06); }
}
@keyframes lava-b {
    0%   { transform: translate(0,0) scale(1); }
    33%  { transform: translate(-12vw,-14vh) scale(1.10); }
    66%  { transform: translate(-22vw,-6vh) scale(0.90); }
    100% { transform: translate(-9vw,-20vh) scale(1.14); }
}
@keyframes lava-c {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(-18vw,12vh) scale(1.18); }
    100% { transform: translate(12vw,-10vh) scale(0.88); }
}
@keyframes lava-d {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(10vw,18vh) scale(1.12); }
    100% { transform: translate(-6vw,6vh) scale(0.94); }
}

/* ============================================================
   LOADING SCREEN
   Full-screen lava — sits on top of everything (z-index 9999)
   ============================================================ */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #1a0533;   /* dark base so lava blobs have contrast */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#loading-screen .lava-bg { position: absolute; }

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#loading-screen.hidden { display: none; }

.loading-logo {
    position: relative;
    z-index: 1;
    width: clamp(56px, 8vw, 88px);
    height: auto;
    color: white;
    animation: logo-pulse 2.8s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%       { transform: scale(1.07); opacity: 0.80; }
}

/* ============================================================
   TRANSITION OVERLAY  (white flash between loading → page)
   ============================================================ */
#transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    opacity: 0;
    background: var(--white);
    transition: opacity 0.35s ease;
}
#transition-overlay.flash-in  { opacity: 0.90; }
#transition-overlay.flash-out { opacity: 0; transition: opacity 0.9s ease; }

/* ============================================================
   SITE WRAPPER — the actual page content
   ============================================================ */
.site-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   PAGE BOTTOM GRADIENT
   Colorful lava gradient that bleeds up from the bottom of
   the main page — matching the reference screenshot exactly
   ============================================================ */
.page-bottom-gradient {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75vh;
    pointer-events: none;
    z-index: 0;

    /* Vertical columns of color fading up into white — like the ref */
    background:
        radial-gradient(ellipse 30% 80% at 15% 100%, rgba(58,91,255,0.55) 0%, transparent 70%),
        radial-gradient(ellipse 25% 70% at 38% 100%, rgba(139,63,255,0.50) 0%, transparent 65%),
        radial-gradient(ellipse 30% 80% at 60% 100%, rgba(58,91,255,0.55) 0%, transparent 70%),
        radial-gradient(ellipse 25% 65% at 80% 100%, rgba(224,48,138,0.45) 0%, transparent 65%),
        radial-gradient(ellipse 20% 60% at 95% 100%, rgba(255,122,0,0.45) 0%, transparent 65%),
        linear-gradient(to top, rgba(255,59,48,0.35) 0%, transparent 60%);

    animation: gradient-shift 18s ease-in-out infinite alternate;
}

@keyframes gradient-shift {
    0%   { opacity: 0.85; transform: scaleX(1); }
    50%  { opacity: 1;    transform: scaleX(1.04); }
    100% { opacity: 0.85; transform: scaleX(1.97); }
    0%   { opacity: 0.85; transform: scaleZ(1.5); }
    100% { opacity: 1; transform: scaleZ(2.97); }
}

/* ============================================================
   NAVBAR — floating pill (suspended)
   ============================================================ */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 7px 7px 7px 18px;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
    gap: 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 8px;
}

.navbar-logo {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    color: var(--black);
}

.navbar-brand-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.09em;
    color: var(--text-dark);
    text-transform: uppercase;
}

.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2px;
    margin-right: 8px;
}

.navbar-nav li a {
    display: block;
    padding: 7px 13px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    text-decoration: none;
    border-radius: 100px;
    transition: background 0.2s, color 0.2s;
}

.navbar-nav li a:hover {
    background: rgba(0,0,0,0.06);
    color: var(--text-dark);
}

.btn-signup {
    display: inline-flex;
    align-items: center;
    padding: 9px 20px;
    background: var(--dark-grey);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.btn-signup:hover {
    background: #333;
    transform: scale(1.03);
}

/* ============================================================
   UPLOAD PAGE
   ============================================================ */
#upload-page {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 200px;
    min-height: 100vh;
    text-align: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(20px, 4vw, 40px);
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    text-transform: uppercase;
    margin-bottom: 44px;
    max-width: 860px;
}

/* ============================================================
   UPLOAD BAR — pill shaped, light glass on white bg
   ============================================================ */
.upload-bar-wrap {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.upload-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.80);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 10px;
    padding: 7px 7px 7px 22px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.upload-bar:hover,
.upload-bar.drag-over {
    background: rgba(255,255,255,0.95);
    border-color: rgba(0,0,0,0.18);
    box-shadow: 0 6px 28px rgba(0,0,0,0.12);
}

.upload-bar-label {
    flex: 1;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    color: var(--text-light);
    text-align: left;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-bar-label.has-file {
    color: var(--text-dark);
    font-weight: 500;
}

.upload-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 10px;
}

.bar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.2s;
    flex-shrink: 0;
    background: rgba(0,0,0,0.07);
    color: var(--text-dark);
}

.bar-btn:hover { transform: scale(1.08); background: rgba(0,0,0,0.12); }

.bar-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.bar-btn-record.recording {
    background: #FF3B30;
    color: white;
    animation: record-pulse 1s ease-in-out infinite;
}

@keyframes record-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,48,0.5); }
    50%       { box-shadow: 0 0 0 8px rgba(255,59,48,0); }
}

.bar-btn-submit {
    background: var(--black);
    color: var(--white);
    width: 42px;
    height: 42px;
    padding: 9px;
}

.bar-btn-submit:hover { background: #333; }

.bar-btn-submit:disabled {
    opacity: 0.30;
    cursor: not-allowed;
    transform: none !important;
}

.submit-logo-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Invert to white since button bg is black */
    filter: brightness(0) invert(1);
    display: block;
}

#record-status {
    display: block;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-light);
    min-height: 18px;
}
#record-status.hidden { display: none; }


/* ============================================================
   PROCESSING OVERLAY
   Full-screen lava — overlays the main page during analysis
   ============================================================ */
#processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: #1a0533;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    text-align: center;
}

#processing-overlay.active { display: flex; }

/* Lava inside processing overlay */
#processing-overlay .lava-bg { position: absolute; }

.processing-logo {
    position: relative;
    z-index: 1;
    width: 60px;
    height: 60px;
    color: white;
    animation: logo-pulse 2s ease-in-out infinite;
}

.processing-title {
    position: relative;
    z-index: 1;
    font-family: var(--font-heading);
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 800;
    color: white;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.processing-subtitle {
    position: relative;
    z-index: 1;
    font-size: 15px;
    color: rgba(255,255,255,0.60);
    max-width: 380px;
}

.processing-steps {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    max-width: 320px;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    opacity: 0.30;
    transition: opacity 0.4s, background 0.4s;
}

.processing-step.active {
    opacity: 1;
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.30);
}

.processing-step.done { opacity: 0.65; }

.step-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-icon svg { width: 15px; height: 15px; fill: white; }

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: white;
    text-align: left;
}

/* ============================================================
   RESULT PAGE
   ============================================================ */
#result-page {
    display: none;
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 120px 24px 80px;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

#result-page.visible { display: block; }

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 16px;
}

.result-title {
    font-family: var(--font-heading);
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.result-track-name {
    font-size: 15px;
    color: var(--text-light);
}

#result-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
}

.result-card {
    background: rgba(255,255,255,0.80);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.result-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.10); }

.result-card-title {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 12px;
}

.result-card h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.result-card p,
.result-card li {
    font-size: 14px;
    color: var(--text-mid);
    line-height: 1.65;
}

.result-card ul {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-card pre {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-mid);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

.similarity-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
}

.similarity-score.high   { background: rgba(255,59,48,0.10);  color: #c0392b; border: 1px solid rgba(255,59,48,0.25); }
.similarity-score.medium { background: rgba(255,122,0,0.10);  color: #e67e22; border: 1px solid rgba(255,122,0,0.25); }
.similarity-score.low    { background: rgba(52,199,89,0.10);  color: #27ae60; border: 1px solid rgba(52,199,89,0.25); }

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
    text-decoration: none;
}

.btn-action:hover { transform: scale(1.03); }
.btn-action svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.btn-action-primary   { background: var(--black); color: var(--white); }
.btn-action-secondary { background: rgba(0,0,0,0.07); color: var(--text-dark); border: 1px solid rgba(0,0,0,0.10); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px 24px;
    font-size: 12px;
    color: var(--text-dark);
    letter-spacing: 0.04em;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .navbar-nav { display: none; }
    .navbar { padding: 7px 7px 7px 14px; }
    .hero-title { font-size: clamp(26px, 7.5vw, 44px); }
    .upload-bar-wrap { max-width: 100%; }
    .page-bottom-gradient { height: 45vh; }
}

@media (max-width: 480px) {
    .navbar-brand-text { display: none; }
    .btn-signup { padding: 9px 14px; font-size: 12px; }
}
