:root {
    --bg-odd: #181818;
    --bg-even: #343434;
    --bg-hover: #545454;
    --border: #3a3a3a;
    --header-bg: #3a0d24;
    --header-text: #f2f2f2;
    --accent: #8b1a3a;
    --accent-light: #c2547a;
    --top-rank-gold: #c9a84c;
}

.container {
    margin-inline: auto;
    padding: 2rem;
    width: 100%;
    max-width: 1100px;
    box-sizing: border-box;
}

/* ── Profile header ─────────────────────────────────────────────────── */

.user_profile_header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(145deg, rgba(58, 13, 36, 0.72), rgba(18, 18, 18, 0.88));
    border: 1px solid rgba(139, 26, 58, 0.4);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.1s;
}

.user_profile_avatar {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #1a1a2e);
    border: 2px solid rgba(139, 26, 58, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--header-text);
    font-family: 'NewRocker-Regular', serif;
}

.user_profile_info {
    flex: 1;
    min-width: 0;
}

.user_profile_name_row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.user_profile_username {
    font-family: 'NewRocker-Regular', serif;
    font-size: 2rem;
    color: var(--header-text);
    margin: 0;
    line-height: 1.1;
}

.user_profile_meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #aaa;
    font-size: 0.95rem;
}

.user_profile_role {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.7rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: rgba(200, 200, 200, 0.1);
    border: 1px solid rgba(200, 200, 200, 0.25);
    color: #f0f0f0;
}

.user_profile_role--admin {
    background: rgba(150, 20, 20, 0.35);
    border-color: rgba(220, 60, 60, 0.4);
    color: #e06060;
}

.user_profile_role--moderator {
    background: rgba(100, 30, 140, 0.35);
    border-color: rgba(170, 90, 210, 0.4);
    color: #c080e8;
}

/* ── Rank badge (shown in profile header) ───────────────────────────── */

.user_stats_rank_badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 0.4rem;
    background: rgba(58, 13, 36, 0.4);
    border: 1px solid rgba(139, 26, 58, 0.3);
    line-height: 1.15;
}

.user_stats_rank_badge--top10 {
    background: rgba(155, 125, 0, 0.25);
    border-color: rgba(201, 168, 76, 0.5);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.2);
}

.user_stats_rank_number {
    font-family: 'NewRocker-Regular', serif;
    font-size: 1.4rem;
    color: var(--header-text);
    line-height: 1;
}

.user_stats_rank_badge--top10 .user_stats_rank_number {
    color: var(--top-rank-gold);
}

.user_stats_rank_label {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.1rem;
    white-space: nowrap;
}

.user_stats_rank_badge--top10 .user_stats_rank_label {
    color: #b89a40;
}

/* ── Tab panels ─────────────────────────────────────────────────────── */

.user_content_switcher {
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.25s;
}

.user_tab_panel {
    padding-top: 1.5rem;
}

/* ── Contribution stats card ────────────────────────────────────────── */

.user_stats_card {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9), rgba(18, 18, 18, 0.95));
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.user_stats_no_contributions {
    color: #888;
    font-style: italic;
    text-align: center;
}

.user_stats_score_row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.user_stats_score {
    font-family: 'NewRocker-Regular', serif;
    font-size: 2.8rem;
    color: var(--header-text);
    line-height: 1;
}

.user_stats_score_label {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

.user_stats_breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.user_stats_breakdown .contributor_extra_info {
    flex: 1 1 200px;
}

/* ── Favourite bands list (compact cards) ───────────────────────────── */

.fav_bands_list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.5rem;
}

.fav_band_card {
    display: flex;
    align-items: center;
    padding: 10px 10px 10px 14px;
    gap: 12px;
    background: linear-gradient(to bottom right, rgba(50, 50, 50, 0.4), rgba(30, 30, 30, 0.4));
    background-color: rgba(32, 32, 32, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    text-decoration: none;
    color: var(--header-text);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.fav_band_card:hover {
    background-color: rgba(64, 28, 40, 0.7);
    border-color: rgba(194, 84, 122, 0.3);
    transform: translateY(-1px);
}

.fav_band_card_photo {
    flex-shrink: 0;
    width: 100px;
    aspect-ratio: 1.3;
    overflow: hidden;
    object-fit: cover;
    border-radius: 50%;
    border: solid 1.2px #3c0f0f;
    background: linear-gradient(135deg, rgba(38, 8, 20, 0.9), rgba(18, 18, 18, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
}

.fav_band_card_photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.fav_band_card_photo_placeholder {
    font-family: 'NewRocker-Regular', serif;
    font-size: 1.6rem;
    color: rgba(194, 84, 122, 0.7);
    text-transform: uppercase;
}

.fav_band_card_info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    min-width: 0;
}

.fav_band_card_top {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    min-width: 0;
}

.fav_band_card_name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.fav_band_card_genres {
    font-size: 0.78rem;
    line-height: 1.3;
    opacity: 0.9;
}

.fav_band_card_location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #aaa;
}

.fav_bands_empty {
    color: #888;
    font-style: italic;
    text-align: center;
}

/* ── Table (shared edit submissions table styles) ───────────────────── */

.table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.45;
    background: var(--bg-odd);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    overflow: hidden;
    table-layout: fixed;
}

.thead {
    display: table-header-group;
}

.thead .tr {
    background: var(--header-bg);
    color: var(--header-text);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .04em;
}

.th {
    display: table-cell;
}

.tbody {
    display: table-row-group;
}

.tr {
    display: table-row;
    transition: background-color .2s ease;
    color: inherit;
    text-decoration: none;
}

.tr--clickable {
    cursor: pointer;
}

.tr:nth-child(odd) {
    background: var(--bg-odd);
}

.tr:nth-child(even) {
    background: var(--bg-even);
}

.tr:hover {
    background: var(--bg-hover);
}

.td,
.th {
    padding: 0.65rem 0.85rem;
    display: table-cell;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.status {
    font-weight: 600;
}

.status.Approved { color: #6dbd6d; }
.status.Rejected { color: #cc4444; }
.status.Pending  { color: #c9a84c; }
.status.Requires\.Fixes { color: #e08040; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.75rem;
    font-size: 1.25rem;
}

.pagination a {
    color: var(--header-text);
    text-underline-offset: 0.2em;
    transition: color .15s;
}

.pagination a:hover {
    color: var(--accent-light);
}

.selected_page {
    font-weight: 700;
}

.pagination_break {
    color: #888;
}

.error_message {
    padding: 2rem;
    text-align: center;
    color: var(--header-text);
    background: var(--bg-odd);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
}

/* ── Loading indicator ──────────────────────────────────────────────── */

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }

.indicator_text {
    text-align: center;
    color: #888;
}

.indicator_image {
    display: block;
    margin: 0.5rem auto;
    filter: invert(1) opacity(0.5);
}

@media (max-width: 640px) {
    .user_profile_header {
        flex-direction: column;
        text-align: center;
    }
    .user_profile_name_row {
        justify-content: center;
    }
    .user_profile_meta {
        justify-content: center;
    }
    .table .thead {
        display: none;
    }
    .table .tr {
        display: flex;
        flex-wrap: wrap;
    }
    .table .td {
        flex: 1 1 50%;
        min-width: 0;
        padding: .4rem .5rem;
    }
}

/* ── Favourite band card — mobile / narrow layout ───────────────────── */

@media (max-width: 530px) {
    .fav_bands_list {
        grid-template-columns: 1fr;
    }

    .fav_band_card {
        flex-direction: column;
        align-items: center;
        padding: 14px 12px;
        gap: 10px;
        text-align: center;
    }

    .fav_band_card_photo {
        width: 120px;
    }

    .fav_band_card_top {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
    }

    .fav_band_card_name {
        white-space: normal;
    }

    .fav_band_card_location {
        justify-content: center;
    }
}

/* ── Animations ─────────────────────────────────────────────────────── */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(20px); }
    to   { transform: translateY(0); }
}

/* Tab panel enter transition (Alpine.js x-transition) */
.tab_fade_in {
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.tab_fade_in_from {
    opacity: 0 !important;
    transform: translateY(14px);
}
.tab_fade_in_to {
    opacity: 1 !important;
    transform: translateY(0);
}

/* Favourite band card entrance — initial load */
.fav_band_card {
    opacity: 0;
    animation: fadeIn 0.4s ease forwards, slideInUp 0.4s ease;
}

.fav_band_card:nth-child(1) { animation-delay: 0.05s; }
.fav_band_card:nth-child(2) { animation-delay: 0.10s; }
.fav_band_card:nth-child(3) { animation-delay: 0.15s; }
.fav_band_card:nth-child(4) { animation-delay: 0.20s; }
.fav_band_card:nth-child(5) { animation-delay: 0.25s; }
.fav_band_card:nth-child(n+6) { animation-delay: 0.30s; }

/* HTMX pagination swap */
.htmx-settling .fav_band_card,
.htmx-added .fav_band_card {
    opacity: 0;
    animation: fadeIn 0.4s ease forwards, slideInUp 0.4s ease;
}

.htmx-settling .fav_band_card:nth-child(1) { animation-delay: 0.05s; }
.htmx-settling .fav_band_card:nth-child(2) { animation-delay: 0.10s; }
.htmx-settling .fav_band_card:nth-child(3) { animation-delay: 0.15s; }
.htmx-settling .fav_band_card:nth-child(4) { animation-delay: 0.20s; }
.htmx-settling .fav_band_card:nth-child(5) { animation-delay: 0.25s; }
.htmx-settling .fav_band_card:nth-child(n+6) { animation-delay: 0.30s; }

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .user_profile_header,
    .user_content_switcher,
    .fav_band_card {
        animation: none;
        opacity: 1;
    }

    .tab_fade_in {
        transition: none;
    }

    .fav_band_card:hover {
        transform: none;
    }
}
