/* ============================================================
   VoteID — style.css
   Font: DM Sans (Google Fonts)
   Tema: Merah, Maroon, Gold, Putih
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
    --red-dark:   #7B1010;
    --red-main:   #9B1C1C;
    --red-mid:    #B91C1C;
    --gold:       #C9A84C;
    --gold-light: #F0D080;
    --white:      #FFFFFF;
    --off-white:  #FDF8F8;
    --gray-100:   #F3F4F6;
    --gray-200:   #E5E7EB;
    --gray-400:   #9CA3AF;
    --gray-500:   #6B7280;
    --gray-700:   #374151;
    --gray-900:   #111827;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.14);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --transition: all .2s ease;
    --font: 'DM Sans', system-ui, sans-serif;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--off-white);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}
img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.navbar__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.navbar__logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--red-main);
    letter-spacing: -.02em;
}
.navbar__logo span { color: var(--gold); }
.navbar__menu {
    display: flex;
    gap: .25rem;
}
.navbar__menu a {
    padding: .4rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: var(--transition);
}
.navbar__menu a:hover,
.navbar__menu a.active {
    background: var(--gray-100);
    color: var(--red-main);
}

/* ── HERO ───────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(160deg, var(--red-dark) 0%, var(--red-main) 60%, #C0392B 100%);
    padding: 2rem 1.25rem 3.5rem;
    text-align: center;
    position: relative;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero__banner {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 1.25rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.hero__banner img { width: 100%; }
.hero__title {
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    font-weight: 800;
    color: var(--white);
    letter-spacing: .03em;
    line-height: 1.3;
    margin-bottom: .5rem;
}
.hero__badge {
    display: inline-block;
    padding: .3rem .9rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px;
    font-size: .8rem;
    color: var(--gold-light);
    font-weight: 600;
}

/* ── TAB NAVIGATION ─────────────────────────────────────────── */
.tab-nav {
    background: var(--white);
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 57px;
    z-index: 90;
}
.tab-nav__inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-nav__inner::-webkit-scrollbar { display: none; }
.tab-nav a {
    flex-shrink: 0;
    padding: .875rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
}
.tab-nav a:hover { color: var(--red-main); }
.tab-nav a.active {
    color: var(--red-main);
    border-bottom-color: var(--red-main);
}

/* ── CONTAINER ──────────────────────────────────────────────── */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

/* ── SECTION TITLE ──────────────────────────────────────────── */
.section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
}
.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.1em;
    background: var(--red-main);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── LEADERBOARD ────────────────────────────────────────────── */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.podium__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    flex: 1;
    max-width: 140px;
}
.podium__item.rank-1 { order: 2; }
.podium__item.rank-2 { order: 1; }
.podium__item.rank-3 { order: 3; }
.podium__photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gray-200);
    background: var(--gray-100);
}
.podium__item.rank-1 .podium__photo {
    width: 80px;
    height: 80px;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(201,168,76,.2);
}
.podium__item.rank-2 .podium__photo { border-color: #C0C0C0; }
.podium__item.rank-3 .podium__photo { border-color: #CD7F32; }
.podium__crown {
    font-size: 1.5rem;
    line-height: 1;
}
.podium__name {
    font-size: .7rem;
    font-weight: 700;
    text-align: center;
    color: var(--gray-900);
    line-height: 1.3;
}
.podium__votes {
    font-size: .75rem;
    font-weight: 700;
    color: var(--red-main);
}
.podium__base {
    width: 100%;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--white);
}
.podium__item.rank-1 .podium__base { height: 60px; background: var(--gold); }
.podium__item.rank-2 .podium__base { height: 44px; background: #9E9E9E; }
.podium__item.rank-3 .podium__base { height: 32px; background: #A0522D; }

/* Tabel ranking lengkap */
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table tr { border-bottom: 1px solid var(--gray-100); }
.leaderboard-table tr:last-child { border-bottom: none; }
.leaderboard-table td { padding: .75rem .5rem; vertical-align: middle; }
.lb-rank {
    font-size: .875rem;
    font-weight: 700;
    color: var(--gray-400);
    width: 32px;
    text-align: center;
}
.lb-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--gray-100);
}
.lb-name { font-size: .875rem; font-weight: 600; color: var(--gray-900); }
.lb-class { font-size: .75rem; color: var(--gray-500); }
.lb-votes {
    font-size: .875rem;
    font-weight: 700;
    color: var(--red-main);
    text-align: right;
    white-space: nowrap;
}

/* ── FINALIS GRID ────────────────────────────────────────────── */
.search-box {
    position: relative;
    margin-bottom: 1.25rem;
}
.search-box input {
    width: 100%;
    padding: .75rem 1rem .75rem 2.5rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: .9rem;
    background: var(--white);
    outline: none;
    transition: var(--transition);
}
.search-box input:focus { border-color: var(--red-main); }
.search-box__icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
    pointer-events: none;
}

.finalis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .875rem;
}
@media (min-width: 540px) {
    .finalis-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 760px) {
    .finalis-grid { grid-template-columns: repeat(4, 1fr); }
}

.finalis-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--gray-100);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.finalis-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-200);
    transform: translateY(-2px);
}
.finalis-card__photo {
    aspect-ratio: 3/4;
    width: 100%;
    object-fit: cover;
    background: var(--gray-100);
}
.finalis-card__body {
    padding: .625rem .75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.finalis-card__number {
    font-size: .7rem;
    font-weight: 600;
    color: var(--gray-400);
}
.finalis-card__name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.3;
}
.finalis-card__class {
    font-size: .7rem;
    color: var(--gray-500);
}
.finalis-card__footer {
    padding: .5rem .75rem .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--gray-100);
    margin-top: auto;
}
.finalis-card__price {
    font-size: .7rem;
    color: var(--gray-500);
}
.finalis-card__price span {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: var(--gray-900);
}
.finalis-card__votes {
    font-size: .75rem;
    font-weight: 700;
    color: var(--red-main);
}
.btn-vote-card {
    display: block;
    width: calc(100% - 1.5rem);
    margin: 0 .75rem .75rem;
    padding: .5rem;
    background: var(--red-main);
    color: var(--white);
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}
.btn-vote-card:hover { background: var(--red-mid); }

/* ── MODAL VOTE ─────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay.show {
    display: flex;
}
@media (min-width: 540px) {
    .modal-overlay { align-items: center; }
}
.modal {
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.5rem;
}
@media (min-width: 540px) {
    .modal { border-radius: var(--radius-lg); }
}
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.modal__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}
.modal__close {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    transition: var(--transition);
}
.modal__close:hover { background: var(--gray-200); }

/* ── FORM VOTE ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .4rem;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: .65rem .875rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .9rem;
    outline: none;
    transition: var(--transition);
    background: var(--white);
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--red-main);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* Qty vote stepper */
.qty-stepper {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.qty-stepper button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    transition: var(--transition);
}
.qty-stepper button:hover { border-color: var(--red-main); color: var(--red-main); }
.qty-stepper input {
    width: 64px !important;
    text-align: center;
    font-weight: 700;
    font-size: 1rem !important;
}

/* Total harga di modal */
.vote-summary {
    background: var(--off-white);
    border-radius: var(--radius-sm);
    padding: .875rem 1rem;
    margin-bottom: 1.25rem;
}
.vote-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: .875rem;
    color: var(--gray-700);
    margin-bottom: .25rem;
}
.vote-summary__total {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    border-top: 1px solid var(--gray-200);
    padding-top: .5rem;
    margin-top: .5rem;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.btn-primary {
    background: var(--red-main);
    color: var(--white);
    width: 100%;
}
.btn-primary:hover { background: var(--red-mid); }
.btn-primary:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
}

/* ── SUPPORTS / KOMENTAR ─────────────────────────────────────── */
.support-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.support-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: .875rem 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}
.support-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .375rem;
}
.support-card__name {
    font-size: .875rem;
    font-weight: 700;
    color: var(--gray-900);
}
.support-card__date {
    font-size: .75rem;
    color: var(--gray-400);
}
.support-card__for {
    font-size: .75rem;
    color: var(--red-main);
    font-weight: 600;
    margin-bottom: .375rem;
}
.support-card__message {
    font-size: .875rem;
    color: var(--gray-700);
    line-height: 1.5;
}

/* ── EVENT INFO ──────────────────────────────────────────────── */
.event-info-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    margin-bottom: 1rem;
}
.event-info-card__row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .625rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: .875rem;
}
.event-info-card__row:last-child { border-bottom: none; }
.event-info-card__icon { font-size: 1rem; flex-shrink: 0; margin-top: .1rem; }
.event-info-card__label {
    color: var(--gray-500);
    min-width: 90px;
    flex-shrink: 0;
}
.event-info-card__value { font-weight: 600; color: var(--gray-900); }

/* ── TOAST ───────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--gray-900);
    color: var(--white);
    padding: .625rem 1.25rem;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 999;
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
    background: var(--red-dark);
    color: rgba(255,255,255,.7);
    text-align: center;
    padding: 1.5rem;
    font-size: .8rem;
    line-height: 1.8;
    margin-top: 2rem;
}
.site-footer strong { color: var(--gold-light); }

/* ── UTILITY ─────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted   { color: var(--gray-500); font-size: .85rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }