/* === Concurs public: tabs, sondaj/stats, podium, modale === */

.nav-tabs-container {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-tabs-container::-webkit-scrollbar {
    display: none;
}
.nav-tab {
    cursor: pointer;
    padding: 0.6rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
}
@media (min-width: 768px) {
    .nav-tab {
        padding: 1rem;
        font-size: 0.9rem;
        gap: 6px;
    }
}
.nav-tab:hover {
    color: #2563eb;
    background-color: #f1f5f9;
}
.nav-tab.active {
    color: #2563eb;
    border-color: #2563eb;
    background-color: white;
}

/* Înălțime bară taburi (sub header fix) */
:root {
    --concurs-tabs-h: 3.25rem;
}
@media (min-width: 768px) {
    :root {
        --concurs-tabs-h: 3.5rem;
    }
}

/* Conținut concurs / casting detalii — sub header fix */
.concurs-page {
    padding-top: var(--header-h);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}

@media (min-width: 1280px) {
    .concurs-page {
        padding-top: var(--header-h-xl);
    }
    #sticky-tabs {
        top: var(--header-h-xl);
    }
    .concurs-main {
        scroll-margin-top: calc(var(--header-h-xl) + var(--concurs-tabs-h));
    }
    #tab-stats,
    #tab-clasament,
    #tab-info,
    #tab-premiere {
        scroll-margin-top: calc(var(--header-h-xl) + var(--concurs-tabs-h) + 0.5rem);
    }
}

#sticky-tabs {
    top: var(--header-h);
    z-index: 45;
    flex-shrink: 0;
}

@media (min-width: 1280px) {
    #sticky-tabs {
        top: var(--header-h-xl);
    }
}

.concurs-main {
    flex: 1 1 auto;
    scroll-margin-top: calc(var(--header-h) + var(--concurs-tabs-h));
}

@media (min-width: 1280px) {
    .concurs-main {
        scroll-margin-top: calc(var(--header-h-xl) + var(--concurs-tabs-h));
    }
}

#tab-stats,
#tab-clasament,
#tab-info,
#tab-premiere {
    scroll-margin-top: calc(var(--header-h) + var(--concurs-tabs-h) + 0.5rem);
}

/* Toolbar sesiune (Sondaj) — rămâne deasupra tabelului la scroll */
.concurs-session-toolbar {
    position: relative;
    z-index: 12;
    background: #fff;
    padding-bottom: 0.25rem;
    margin-bottom: 0.25rem;
}

.concurs-stats-card {
    overflow: visible !important;
}

#sessionChartSelect {
    position: relative;
    z-index: 15;
}

#sessionCatchesTable {
    position: relative;
    z-index: 1;
    margin-top: 0.5rem;
}

/* Antet tabel în modal echipă — sub header modal, nu viewport */
.modal-team-body thead.sticky {
    top: 0;
    z-index: 5;
}

.badge-cmmc {
    background: linear-gradient(to right, #f59e0b, #d97706);
    color: white;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Carduri sondaj / statistici */
.stat-card {
    position: relative;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
    border-radius: 0.75rem 0.75rem 0 0;
    z-index: 1;
}

.pie-chart {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    margin: 20px auto;
    position: relative;
    border: 8px solid white;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
    background: #e2e8f0;
}
.pie-chart::after {
    content: var(--comp-pie-label, "DISTRIBUȚIE");
    position: absolute;
    inset: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #475569;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* —— Top Greutate pe Sesiune (grafic bare clasament) —— */
.session-bars-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.session-bars-empty,
.stats-bars-empty {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    padding: 1.25rem 0.5rem;
}
.session-bars-empty i,
.stats-bars-empty i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
    opacity: 0.45;
}

.session-bar-row {
    display: grid;
    grid-template-columns: 1.75rem minmax(4.5rem, 26%) 1fr auto;
    gap: 0.4rem 0.5rem;
    align-items: center;
    padding: 0.2rem 0;
}
@media (min-width: 768px) {
    .session-bar-row {
        grid-template-columns: 2rem minmax(5.5rem, 22%) 1fr auto;
        gap: 0.5rem 0.65rem;
    }
}

.session-bar-rank {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
@media (min-width: 768px) {
    .session-bar-rank {
        width: 2rem;
        height: 2rem;
        font-size: 0.72rem;
    }
}
.session-bar-rank--1 {
    background: linear-gradient(135deg, #fde047, #f59e0b);
    color: #78350f;
}
.session-bar-rank--2 {
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    color: #334155;
}
.session-bar-rank--3 {
    background: linear-gradient(135deg, #fdba74, #d97706);
    color: #fff;
}

.session-bar-team {
    font-size: 0.65rem;
    font-weight: 800;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}
@media (min-width: 768px) {
    .session-bar-team {
        font-size: 0.75rem;
    }
}

.session-bar-track {
    position: relative;
    height: 1.65rem;
    background: #cbd5e1;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(15, 23, 42, 0.12);
    border: 1px solid #94a3b8;
    min-width: 0;
}
@media (min-width: 768px) {
    .session-bar-track {
        height: 2rem;
        border-radius: 0.6rem;
    }
}
.session-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 45%, #38bdf8 100%);
    border-radius: 0.45rem;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 2px 0 8px rgba(37, 99, 235, 0.35);
}
.session-bar-row:hover .session-bar-fill {
    filter: brightness(1.08);
}

.session-bar-total-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 4.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #bfdbfe;
    background: linear-gradient(180deg, #eff6ff, #dbeafe);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}
.session-bar-total-box--has .session-bar-value {
    font-size: 0.72rem;
    font-weight: 900;
    color: #1d4ed8;
    line-height: 1.1;
}
@media (min-width: 768px) {
    .session-bar-total-box--has .session-bar-value {
        font-size: 0.82rem;
    }
}
.session-bar-unit {
    font-size: 0.55rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* —— Top Cantitate (bare skew / grafic) —— */
.stats-bar-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.bar-skew-row {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    gap: 0.4rem;
    align-items: center;
}
@media (min-width: 768px) {
    .bar-skew-row {
        grid-template-columns: 1.75rem 1fr;
        gap: 0.5rem;
    }
}

.bar-skew-rank {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bar-skew-rank--1 {
    background: linear-gradient(135deg, #fde047, #f59e0b);
    color: #78350f;
}
.bar-skew-rank--2 {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #334155;
}
.bar-skew-rank--3 {
    background: linear-gradient(135deg, #fdba74, #b45309);
    color: #fff;
}

.bar-skew-container {
    width: 100%;
    min-width: 0;
}

.bar-skew-track {
    height: 1.85rem;
    background: #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(15, 23, 42, 0.1);
    border: 1px solid #cbd5e1;
}
@media (min-width: 768px) {
    .bar-skew-track {
        height: 2.35rem;
        border-radius: 0.6rem;
    }
}

.bar-skew-fill {
    height: 100%;
    display: flex;
    align-items: center;
    transform: skewX(-14deg);
    transform-origin: left center;
    margin-left: -0.65rem;
    padding-left: 1.1rem;
    padding-right: 0.65rem;
    min-width: 0;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.15);
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-content-unskew {
    transform: skewX(14deg);
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    min-width: 0;
}
.bar-skew-name {
    font-size: 0.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.bar-skew-weight {
    font-size: 0.65rem;
    flex-shrink: 0;
    white-space: nowrap;
}
@media (min-width: 768px) {
    .bar-skew-name,
    .bar-skew-weight {
        font-size: 0.78rem;
    }
}

.bg-grad-blue {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
}
.bg-grad-green {
    background: linear-gradient(90deg, #047857, #22c55e);
}
.bg-grad-orange {
    background: linear-gradient(90deg, #c2410c, #fb923c);
}
.bg-grad-purple {
    background: linear-gradient(90deg, #5b21b6, #a78bfa);
}

.bar-skew-row:hover .bar-skew-fill {
    filter: brightness(1.06);
}

/* Podium premiere */
.gold-bg {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}
.silver-bg {
    background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
}
.bronze-bg {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
.podium-step {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.podium-step:hover {
    transform: translateY(-4px);
}

/* Modale concurs (deasupra header z-50, dock z-60, share z-90) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    box-sizing: border-box;
}
.modal-content {
    background: white;
    width: 100%;
    max-width: 900px;
    max-height: min(94dvh, 900px);
    height: auto;
    min-height: 0;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.modal-team-header {
    flex-shrink: 0;
}

.modal-body-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Mobil: sumar sus, tabel jos cu scroll propriu */
@media (max-width: 767px) {
    .modal-body-scroll .sidebar-panel {
        flex-shrink: 0;
        max-height: 42vh;
        overflow-y: auto;
    }
    .modal-body-scroll .main-panel {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .modal-body-scroll .main-panel #tmCatchContentGrouped {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (min-width: 768px) {
    .modal-body-scroll {
        flex-direction: row;
        align-items: stretch;
    }
    .modal-body-scroll .sidebar-panel {
        width: 240px;
        max-width: 42%;
        flex-shrink: 0;
        overflow-y: auto;
        max-height: 100%;
    }
    .modal-body-scroll .main-panel {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        max-height: 100%;
    }
    .modal-body-scroll .main-panel #tmCatchContentGrouped {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
}

/* Scrollbar zone sondaj / tabele */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
