/* ========================================
   HOPE Hall of Fame - Main Styles
   Reference: Penpot design (1920px base)
   ======================================== */

/* --- Design Tokens from Penpot --- */
:root {
    --color-bg: #000000;
    --color-white: #FFFFFF;
    --color-gray: #B1B2B5;
    --color-red: #FF465A;
    --color-black: #000000;

    --font-primary: 'Noto Sans Thai', sans-serif;
    --max-width: 1440px;

    /* Hero button scale: 100% at 1920px */
    --hero-scale: clamp(0.3, calc(100vw / 1920), 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-white);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #111;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

/* Slideshow */
.hero__slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero__slide--active {
    opacity: 1;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg,
        rgba(0,0,0,0.3) 0%,
        rgba(0,0,0,0.1) 40%,
        rgba(0,0,0,0.5) 100%);
    pointer-events: none;
}

.hero__title {
    position: relative;
    z-index: 5;
    font-size: clamp(18px, 1.875vw, 36px);
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: clamp(44px, 3.6vw, 70px);
    text-align: center;
}

/* --- Header --- */
.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: clamp(12px, 1.77vw, 34px) clamp(16px, 2.03vw, 39px);
    z-index: 10;
}

/* Logo */
.header__logo {
    transform: scale(var(--hero-scale));
    transform-origin: top left;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.header__logo-img {
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.header__logo:hover .header__logo-img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8));
}

.header__logo:active .header__logo-img {
    transform: scale(1.05);
}

.header__logo-img--full {
    height: 47px;
}

.header__logo-img--mini {
    height: 28px;
    display: none;
}

/* Nav dots - same level as logo, centered */
.header__nav-dots {
    position: absolute;
    top: clamp(22px, 2.86vw, 55px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 99px;
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: transform 0.25s ease;
}

.header__nav-dots:hover {
    transform: translateX(-50%) scale(1.5);
}

.header__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.3s, transform 0.2s ease;
    cursor: pointer;
}

.header__dot--active {
    background: var(--color-white);
}

.header__dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Actions (right side) */
.header__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    transform: scale(var(--hero-scale));
    transform-origin: top right;
}

.header__btn-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: var(--color-white);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 99px;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    min-width: 160px;
    height: 44px;
    transition: transform 0.2s ease;
}

.header__btn:hover {
    transform: scale(1.1);
}

.header__btn-icon {
    flex-shrink: 0;
}

.header__btn-text {
    flex: 1;
}

.header__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-red);
    color: var(--color-white);
    font-size: 14px;
    font-weight: 700;
    min-width: 37px;
    height: 26px;
    border-radius: 99px;
    padding: 0 8px;
}

/* Bottom controls */
.hero__bottom-controls {
    position: absolute;
    bottom: 10%;
    right: 3.5%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    transform: scale(var(--hero-scale));
    transform-origin: bottom right;
}

/* Sound wrap + volume slider */
.hero__sound-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero__volume-slider {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 25px;
    padding: 20px 10px;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    margin-bottom: 6px;
}

/* Bridge gap between slider and button */
.hero__volume-slider::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 16px;
}

.hero__sound-wrap:hover .hero__volume-slider {
    opacity: 1;
    pointer-events: auto;
}

.hero__volume-range {
    writing-mode: vertical-lr;
    direction: rtl;
    appearance: none;
    -webkit-appearance: none;
    width: 8px;
    height: 150px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.hero__volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-white);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.hero__volume-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-white);
    border: none;
    cursor: pointer;
}

.hero__volume-range::-webkit-slider-runnable-track {
    background: transparent;
}

.hero__sound-btn,
.hero__lang-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease;
}

.hero__sound-btn:hover,
.hero__lang-btn:hover {
    transform: scale(1.15);
}

.hero__lang-btn {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-primary);
}

/* Arrows */
.hero__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(var(--hero-scale));
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: var(--color-white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease;
}

.hero__arrow:hover {
    transform: translateY(-50%) scale(calc(var(--hero-scale) * 1.15));
}

.hero__arrow--left {
    left: clamp(12px, 8.3%, 160px);
}

.hero__arrow--right {
    right: clamp(12px, 8.3%, 160px);
}

/* ========================================
   FIXED LOGO (scroll past hero)
   ======================================== */
.fixed-logo {
    position: fixed;
    top: clamp(12px, 1.77vw, 34px);
    left: clamp(16px, 2.03vw, 39px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.fixed-logo--visible {
    opacity: 1;
    pointer-events: auto;
}

.fixed-logo img {
    height: clamp(30px, 3.67vw, 70px);
    width: auto;
    filter: none;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.fixed-logo:hover img {
    transform: scale(1.2);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
}

.fixed-logo:active img {
    transform: scale(1.1);
}

/* ========================================
   RANKING WRAPPER
   ======================================== */
.ranking-wrapper {
    max-width: var(--max-width);
    margin: -50px auto 0;
    padding: 0 clamp(8px, 1.5vw, 24px);
    position: relative;
    z-index: 2;
}

/* --- Tab Selector --- */
.tab-selector {
    --tab-pad: clamp(3px, 0.31vw, 6px);
    --tab-radius: clamp(6px, 0.63vw, 12px);
    position: relative;
    display: flex;
    width: 100%;
    height: clamp(36px, 2.9vw, 56px);
    background: var(--color-white);
    border-radius: clamp(10px, 0.83vw, 16px) clamp(10px, 0.83vw, 16px) 0 0;
    padding: var(--tab-pad);
    gap: 4px;
}

.tab-selector__btn {
    flex: 1;
    height: 100%;
    border: none;
    font-family: var(--font-primary);
    font-size: clamp(12px, 1.04vw, 20px);
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--color-gray);
    border-radius: var(--tab-radius);
    transition: color 0.3s;
    position: relative;
    z-index: 2;
    letter-spacing: 0.03em;
}

.tab-selector__btn--active {
    color: var(--color-white);
}

/* Sliding indicator pill */
.tab-selector__indicator {
    position: absolute;
    top: var(--tab-pad);
    left: var(--tab-pad);
    width: calc(50% - var(--tab-pad) - 2px);
    height: calc(100% - var(--tab-pad) * 2);
    background: var(--color-red);
    border-radius: var(--tab-radius);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.year-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: var(--color-white);
    padding: 10px 12px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.year-selector__btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: clamp(12px, 0.9vw, 16px);
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.year-selector__btn:hover {
    border-color: var(--color-red);
    color: var(--color-red);
}

.year-selector__btn--active {
    background: var(--color-red);
    border-color: var(--color-red);
    color: #fff;
}

/* --- Content Area --- */
.ranking-content {
    width: 100%;
    background: var(--color-white);
    border-radius: 0 0 clamp(10px, 0.83vw, 16px) clamp(10px, 0.83vw, 16px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: none;
}

/* Tab content panels */
.ranking-tab-content {
    display: none;
}

.ranking-tab-content--active {
    display: block;
}

/* ========================================
   JOB DESCRIPTION HEADER (Personnel page)
   ======================================== */
.job-desc-header {
    display: flex;
    justify-content: center;
    gap: clamp(16px, 2.6vw, 50px);
    padding: clamp(16px, 2.08vw, 40px) clamp(8px, 1.04vw, 20px);
    background: var(--color-white);
}

.job-desc-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 0.52vw, 10px);
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0.3;
}

.job-desc-btn:hover {
    transform: scale(1.3);
    opacity: 0.8;
}

.job-desc-btn--active {
    transform: scale(1.15);
    opacity: 1;
}

.job-desc-btn--active:hover {
    transform: scale(1.2);
}

.job-desc-btn__circle {
    width: clamp(40px, 4.17vw, 80px);
    height: clamp(40px, 4.17vw, 80px);
    border-radius: 50%;
    background: var(--btn-color);
    transition: box-shadow 0.25s ease;
}

.job-desc-btn--active .job-desc-btn__circle {
    box-shadow: none;
}

.job-desc-btn__label {
    font-family: var(--font-primary);
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.3s;
    text-align: center;
    line-height: 1.3;
}

.job-desc-btn--active .job-desc-btn__label {
    color: #333;
}


/* Job pages */
.job-page {
    display: none;
}

.job-page--active {
    display: block;
}

/* SUP sub-tab selector (mirrors .tab-selector, gray theme) */
.sup-tab-selector {
    --tab-pad: clamp(3px, 0.31vw, 6px);
    --tab-radius: clamp(6px, 0.63vw, 12px);
    position: relative;
    display: flex;
    width: min(500px, 100% - clamp(16px, 1.5vw, 32px));
    height: clamp(36px, 2.9vw, 56px);
    background: #ececef;
    border-radius: clamp(10px, 0.83vw, 16px);
    padding: var(--tab-pad);
    gap: 4px;
    margin: clamp(12px, 1.2vw, 24px) auto;
}

.sup-tab-selector__btn {
    flex: 1;
    height: 100%;
    border: none;
    font-family: var(--font-primary);
    font-size: clamp(12px, 1.04vw, 20px);
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: #888;
    border-radius: var(--tab-radius);
    transition: color 0.3s;
    position: relative;
    z-index: 2;
    letter-spacing: 0.03em;
}

.sup-tab-selector__btn--active {
    color: #fff;
}

.sup-tab-selector__indicator {
    position: absolute;
    top: var(--tab-pad);
    left: var(--tab-pad);
    width: calc(50% - var(--tab-pad) - 2px);
    height: calc(100% - var(--tab-pad) * 2);
    background: #6b7280;
    border-radius: var(--tab-radius);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.sup-tab-content {
    display: none;
}

.sup-tab-content--active {
    display: block;
}

/* ========================================
   RANK SECTIONS
   ======================================== */
.rank-section {
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.rank-section + .rank-section::before {
    content: "";
    display: block;
    height: 10px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.1);
    margin: 16px clamp(8px, 3.9vw, 75px);
}

.rank-section__header {
    height: clamp(40px, 7.8vw, 150px);
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(8px, 3.9vw, 75px);
}

.rank-section__header-bar {
    width: 100%;
    max-width: 1269px;
    height: clamp(20px, 2.6vw, 50px);
    background: var(--color-gray);
    border-radius: clamp(6px, 0.68vw, 13px);
}

.rank-section__cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    background: var(--color-white);
    padding: clamp(4px, 0.52vw, 10px) clamp(8px, 1.04vw, 20px);
}

/* Rank-specific gaps - scale with viewport */
.rank-section__cards--r1 { gap: clamp(12px, 4.17vw, 80px); }
.rank-section__cards--r2 { gap: clamp(10px, 2.6vw, 50px); }
.rank-section__cards--r3 { gap: clamp(10px, 2.6vw, 50px); }
.rank-section__cards--r4 { gap: clamp(8px, 2.6vw, 50px); }
.rank-section__cards--r5 { gap: clamp(6px, 2.6vw, 50px); }
.rank-section__cards--r6 { gap: clamp(6px, 1.04vw, 20px); }

/* Mobile: tighten gap + padding so cards-per-row follows the rank's scale % naturally.
   Card width comes from inline style (size × scale) in createRankCard — desktop stays unchanged. */
@media (max-width: 768px) {
    .rank-section__cards--r1 {
        gap: clamp(6px, 1.5vw, 12px);
        padding-left: 6px;
        padding-right: 6px;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Logo swap (960px = 50% of 1920px) */
@media (max-width: 960px) {
    .header__logo-img--full { display: none; }
    .header__logo-img--mini { display: block; }
}

/* Tablet (768px) */
@media (max-width: 768px) {
    :root {
        --hero-scale: 0.525;
    }

    .header__nav-dots {
        display: none;
    }

    .header__actions {
        transform: none;
    }

    .header__btn-group {
        gap: 4px;
    }

    .header__btn {
        min-width: auto;
        padding: 5px 10px;
        font-size: 11px;
        height: 28px;
        gap: 6px;
        border-radius: 50px;
    }

    .header__btn-icon {
        width: 12px;
        height: 12px;
    }

    .header__badge {
        min-width: 24px;
        height: 18px;
        font-size: 10px;
        padding: 0 5px;
    }

    .hero {
        height: 56vw;
    }

    .hero__slide {
        object-position: center center;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    :root {
        --hero-scale: 0.6;
    }

    .header__actions {
        transform: none;
    }

    .header__btn-group {
        gap: 3px;
    }

    .header__btn {
        min-width: auto;
        padding: 4px 8px;
        font-size: 10px;
        height: 24px;
        gap: 4px;
        border-radius: 50px;
    }

    .header__btn-icon {
        width: 10px;
        height: 10px;
    }

    .header__badge {
        min-width: 20px;
        height: 16px;
        font-size: 9px;
        padding: 0 4px;
    }

    .header__logo {
        transform: scale(0.4);
        transform-origin: top left;
    }

    .header__logo-img--full { display: block; }
    .header__logo-img--mini { display: none; }

    .hero {
        height: 100vw;
    }
}

/* Small Mobile - Galaxy S8 (360px) */
@media (max-width: 360px) {
    .header__btn {
        padding: 3px 6px;
        font-size: 9px;
        height: 20px;
        gap: 3px;
    }

    .header__btn-icon {
        width: 8px;
        height: 8px;
    }

    .header__badge {
        min-width: 16px;
        height: 14px;
        font-size: 8px;
        padding: 0 3px;
    }

    .header__logo {
        transform: scale(0.35);
    }
}
