/* 1. Global Reset & Layout Alignment */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body, html {
    width: 100%;
    min-height: 100vh;      /* 🔓 Allows the page canvas to grow taller than the screen on mobile */
    margin: 0;
    padding: 0;
    background-color: #0b0c10;
    display: flex;
    justify-content: center;
    align-items: center;    /* Perfect vertical centering on widescreen desktop layouts */
    overflow-x: hidden;
    overflow-y: auto;       /* 🔓 Enforces native vertical touch scrolling globally */
    position: relative;
}

/* 2. Hardware-Accelerated Video Canvas (Layer 1 - Deep Background) */
#video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1; /* Lowest structural layer */
    filter: brightness(0.35) contrast(1.1); /* Ensures high text readability on top */
}

/* 3. The Central Glassmorphism Hub (Layer 2 - Floating Foreground) */
.app-container {
    position: relative; /* Essential to activate stacking layers */
    z-index: 999;       /* Forces the element to float above the video canvas */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    width: 90%;
    max-width: 440px; /* Keep this narrow for Login & Loading states */
    padding: 32px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    color: #ffffff;
    box-sizing: border-box; /* Ensures padding doesn't break width calculations */
    margin: 0 auto;        /* Centers the glass container on the page */
    transition: max-width 0.4s ease, padding 0.4s ease; /* Smooth layout transition */
}



/* Widescreen Layout Partitioning Grid System */
.dashboard-grid-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}


/* Album Summary Block Element Styling */
.album-summary-box {
    background: rgba(0, 0, 0, 0.25); /* Slightly darker backing for better readability on blur */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-top: 25px;
    text-align: left;
    box-sizing: border-box;
}

.album-summary-box h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
}

.album-summary-box p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
}

.wiki-anchor-link {
    display: inline-block;
    margin-top: 15px;
    color: #1ed760;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.wiki-anchor-link:hover {
    text-decoration: underline;
}

/* 4. Album Component Layout Typography & Links */
.artist-name {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 18px;
    letter-spacing: -0.5px;
}

.album-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 4px;
    margin-bottom: 26px;
}

.artwork-container {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.08);
}

.artwork-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.streaming-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
}

.stream-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
}

.btn-spotify { background-color: #1DB954; color: #fff; }
.btn-apple { background-color: #FC3C44; color: #fff; }
.btn-youtube { background-color: #FF0000; color: #fff; }

.stream-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    filter: brightness(1.1);
}

/* Container spacing directly below the album name */
.genre-rank-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 15px;
}

/* Glassmorphism style genre badge */
.genre-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

/* Striking golden ranking layout badge */
.rank-badge {
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #fef08a; /* Soft golden tint */
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Dark blurred full-screen take-over wrapper */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glass pop-up card layout base framework */
.modal-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    color: white;
}

.modal-card h2 { margin: 0 0 8px 0; font-size: 1.5rem; font-weight: 700; }
.modal-subtitle { color: rgba(255,255,255,0.6); font-size: 0.9rem; margin-bottom: 20px; }

/* In-modal small album visual detail row */
.modal-album-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.2);
    padding: 12px;
    border-radius: 14px;
    text-align: left;
    margin-bottom: 25px;
}
#modal-album-cover { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
#modal-artist-name { margin: 0; font-size: 1rem; color: white; }
#modal-album-title { margin: 3px 0 0 0; font-size: 0.85rem; color: rgba(255,255,255,0.5); }

/* Buttons configurations layout controls */
.modal-btn-row { display: flex; gap: 12px; }
.modal-btn {
    flex: 1; padding: 12px; border: none; border-radius: 12px;
    font-weight: 600; cursor: pointer; font-size: 0.95rem; transition: background 0.2s;
}
.btn-no { background: rgba(255,255,255,0.1); color: white; }
.btn-no:hover { background: rgba(255,255,255,0.15); }
.btn-yes { background: #1ed760; color: black; }
.btn-yes:hover { background: #1db954; }
.btn-cancel { background: transparent; color: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.1); }

/* Retro interactive review stars row formatting variables */
.modal-stars { display: flex; justify-content: center; gap: 10px; font-size: 2rem; }
.modal-star { color: rgba(255,255,255,0.2); cursor: pointer; transition: transform 0.1s; }
.modal-star:hover { color: #f59e0b; transform: scale(1.2); }

/* ✨ Consolidated Tablet & Desktop Layout Enhancements */
@media (min-width: 768px) {

    /* 1. Safely widen the main card wrapper on larger viewports */
    .app-container:has(#dashboard-state:not([style*="display: none"])) {
        max-width: 960px;
        padding: 40px;
    }

    /* 2. Transition from a vertical list into a side-by-side grid split */
    .dashboard-grid-layout {
        display: grid;
        grid-template-columns: 360px 1fr; /* Image column left, editorial column right */
        align-items: start;
    }

}

/* ==========================================================================
   📱 MOBILE & FOLDABLE SCREEN OPTIMIZATIONS (Targets screens under 768px wide)
   ========================================================================== */
@media (max-width: 767px) {
    /* Drop vertical centering on mobile so the card streams naturally from the top */
    body, html {
        align-items: flex-start !important;
    }

    /* Push the dashboard card box down 40px so it clears mobile browser bars entirely */
    .app-container {
        margin-top: 40px !important;
        margin-bottom: 40px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 20px !important;
        max-width: 92% !important;
    }

    /* Scale down the square artwork wrapper to save 60px of screen real estate */
    .artwork-container {
        width: 220px !important;
        height: 220px !important;
    }

    .artist-name {
        font-size: 1.35rem !important;
        margin-top: 12px !important;
    }

    .album-title {
        margin-bottom: 16px !important;
    }

    .streaming-grid {
        gap: 8px !important;
    }
}
