/* ============================================
   WhosBest.org — Dark Theme (Spotify-inspired)
   Tokens: bg #121212, surface #1E1E1E, border #282828
   muted #727272, body #B3B3B3, heading #FFFFFF
   accent #1DB954, accent-hover #1ED760
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #121212;
    color: #B3B3B3;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body { background: #121212; }

h1:focus, h2:focus, h3:focus, div:focus, main:focus, section:focus,
[tabindex="-1"]:focus { outline: none; }

a { color: #1DB954; text-decoration: none; transition: color 0.2s; }
a:hover { color: #1ED760; }

h1, h2, h3, h4 { color: #FFFFFF; font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 0.5rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin-bottom: 1rem; }
h3 { font-size: 1.2rem; }

/* ============================================
   Home Page
   ============================================ */
.home-hero {
    text-align: center;
    padding: 4rem 0 3rem;
}

.home-hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: #1DB954;
    background: linear-gradient(135deg, #FFFFFF 0%, #1DB954 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    outline: none;
    border: none;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.home-hero p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: #B3B3B3;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-cta {
    display: inline-block;
    background: #1DB954;
    color: #000000 !important;
    font-weight: 700;
    padding: 0.875rem 2.5rem;
    border-radius: 50px;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.hero-cta:hover {
    background: #1ED760;
    transform: scale(1.04);
    color: #000000 !important;
}

/* Category grid */
.home-categories { padding: 2rem 0; }
.home-categories h2 { text-align: center; margin-bottom: 2rem; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.category-card {
    background: #1E1E1E;
    border: 1px solid #282828;
    border-radius: 12px;
    padding: 1.75rem;
    text-decoration: none;
    transition: all 0.25s;
    display: block;
}
.category-card:hover {
    background: #282828;
    border-color: #1DB954;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(29, 185, 84, 0.15);
}
.category-card h3 { color: #FFFFFF; margin-bottom: 0.5rem; }
.category-card p { color: #B3B3B3; font-size: 0.9rem; margin: 0; }
.category-card-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #282828;
}
.provider-count {
    font-size: 0.8rem;
    color: #1DB954;
    font-weight: 600;
}

/* Search Input */
.search-input {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1.25rem;
    background: #1E1E1E;
    border: 1px solid #282828;
    border-radius: 50px;
    color: #FFFFFF;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.search-input:focus {
    outline: none;
    border-color: #1DB954;
}
.search-input::placeholder {
    color: #727272;
}

/* ============================================
   Rankings Page
   ============================================ */
.subtitle {
    color: #727272;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #1E1E1E;
    border: 1px solid #282828;
    border-radius: 12px;
    position: relative;
    transition: all 0.25s;
    align-items: flex-start;
}
.ranking-card:hover {
    background: #282828;
    border-color: #1DB954;
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.1);
}
.ranking-card.sponsored {
    border-color: #F5A623;
    border-width: 2px;
}

.sponsored-label {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #F5A623;
    color: #000000;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rank-badge {
    min-width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1DB954, #169c46);
    color: #000000;
    font-size: 1.35rem;
    font-weight: 800;
    border-radius: 12px;
    flex-shrink: 0;
}

.rank-info { flex: 1; min-width: 0; }
.rank-info h3 { margin: 0 0 0.75rem; font-size: 1.25rem; }
.rank-info h3 a { color: #FFFFFF; text-decoration: none; }
.rank-info h3 a:hover { color: #1DB954; }

.score-bar {
    height: 8px;
    background: #282828;
    border-radius: 4px;
    position: relative;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #1DB954, #F5A623);
    border-radius: 4px;
    transition: width 0.8s ease-out;
}
.score-text {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1DB954;
    margin-bottom: 0.5rem;
}

.score-breakdown {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #727272;
    margin-bottom: 0.75rem;
}
.score-breakdown span {
    padding: 4px 10px;
    background: #282828;
    border-radius: 4px;
}

.narrative {
    color: #B3B3B3;
    font-size: 0.9rem;
    line-height: 1.6;
}

.rank-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: center;
    flex-shrink: 0;
}

.btn-visit, .btn-profile {
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-visit { background: #1DB954; color: #000000; }
.btn-visit:hover { background: #1ED760; color: #000000; }
.btn-profile { background: transparent; color: #FFFFFF; border: 1px solid #727272; }
.btn-profile:hover { border-color: #FFFFFF; }

/* ============================================
   Provider Profile — Cards
   ============================================ */
.profile-header { margin-bottom: 2rem; }
.profile-tags { margin-top: 0.75rem; }

.profile-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.profile-left, .profile-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-card {
    background: #1E1E1E;
    border: 1px solid #282828;
    border-radius: 12px;
    padding: 1.75rem;
}

.profile-card h2 { font-size: 1.2rem; margin-bottom: 1rem; }
.profile-description { color: #B3B3B3; line-height: 1.7; }

.contact-grid { display: flex; flex-direction: column; gap: 1rem; }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-icon { font-size: 1.25rem; width: 32px; text-align: center; flex-shrink: 0; margin-top: 2px; }
.contact-label { font-size: 0.75rem; text-transform: uppercase; color: #727272; letter-spacing: 0.5px; margin-bottom: 2px; }
.contact-value { color: #E0E0E0; font-size: 0.95rem; }

.verified-badge {
    display: inline-block;
    background: #1DB954;
    color: #000000;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 0.75rem;
    vertical-align: middle;
}

.category-tag {
    display: inline-block;
    background: #282828;
    color: #B3B3B3;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Score Hero */
.score-hero-card { border-color: #1DB954; border-width: 2px; }
.score-hero { display: flex; align-items: center; gap: 2rem; }

.score-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1DB954 0%, #169c46 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.score-circle-value { font-size: 2.5rem; font-weight: 800; color: #000000; line-height: 1; }
.score-circle-label { font-size: 0.8rem; font-weight: 600; color: rgba(0,0,0,0.6); }

.score-hero-meta { display: flex; flex-direction: column; gap: 0.5rem; }
.score-hero-tier { font-size: 0.75rem; color: #727272; letter-spacing: 1px; font-weight: 600; }
.score-hero-date { font-size: 0.8rem; color: #727272; }

.score-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.score-card {
    background: #1E1E1E;
    border: 1px solid #282828;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.score-card.featured { border-color: #F5A623; }
.score-card-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.score-card-name { font-size: 0.85rem; color: #B3B3B3; font-weight: 500; }
.score-card-value { font-size: 1rem; font-weight: 700; color: #FFFFFF; }
.score-card-max { font-size: 0.75rem; color: #727272; font-weight: 400; }
.score-card-bar { height: 6px; background: #282828; border-radius: 3px; overflow: hidden; }
.score-card-fill { height: 100%; background: linear-gradient(90deg, #1DB954, #1ED760); border-radius: 3px; transition: width 0.8s ease-out; }
.score-card-fill.featured-fill { background: linear-gradient(90deg, #F5A623, #F7C948); }

.narrative-card { margin-top: 1.5rem; }
.narrative-card h3 { margin-bottom: 0.75rem; font-size: 1rem; }

/* ============================================
   Utility
   ============================================ */
.loading {
    text-align: center;
    padding: 4rem 0;
    color: #727272;
}
.loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 1rem auto;
    border: 3px solid #282828;
    border-top-color: #1DB954;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: #727272;
}

#blazor-error-ui {
    background: #E74C3C;
    color: white;
    padding: 0.5rem;
    text-align: center;
    display: none;
}

/* ============================================
   Mobile — unified at 880px to match nav
   ============================================ */
@media (max-width: 880px) {
    .home-hero { padding: 2.5rem 0 2rem; }

    .ranking-card { flex-direction: column; gap: 1rem; }
    .rank-actions { flex-direction: row; flex-wrap: wrap; }
    .rank-badge { min-width: 48px; height: 48px; font-size: 1.15rem; }

    .profile-layout { grid-template-columns: 1fr; }
    .score-cards-grid { grid-template-columns: 1fr; }
    .score-hero { flex-direction: column; text-align: center; }
    .score-circle { width: 96px; height: 96px; }
    .score-circle-value { font-size: 2rem; }
}
