/* ============================================================
   AWG Dashboard - Tema Escuro Premium v2.0
   ============================================================ */

/* Reset e Base */
* { box-sizing: border-box; }

body {
    background-color: #0a0a0a !important;
    color: #E5E5E5 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

/* ============================================================
   DROPDOWNS - Forçar tema escuro
   ============================================================ */
.Select-control,
.Select-menu-outer,
.Select-menu,
.Select-option,
.Select-value,
.Select-input,
.Select-placeholder,
.Select--single > .Select-control .Select-value,
.VirtualizedSelectOption {
    background-color: #111111 !important;
    color: #E5E5E5 !important;
    border-color: #333333 !important;
}

.Select-control {
    background-color: #111111 !important;
    border: 1px solid #333333 !important;
    border-radius: 8px !important;
    min-height: 38px !important;
}

.Select-menu-outer {
    background-color: #1a1a1a !important;
    border: 1px solid #333333 !important;
    border-radius: 0 0 8px 8px !important;
    margin-top: -1px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
    z-index: 9999 !important;
}

.Select-option {
    background-color: #1a1a1a !important;
    color: #E5E5E5 !important;
    padding: 10px 12px !important;
}

.Select-option:hover,
.Select-option.is-focused {
    background-color: #2a2a2a !important;
    color: #C9A86A !important;
}

.Select-option.is-selected {
    background-color: #C9A86A !important;
    color: #0a0a0a !important;
    font-weight: 600 !important;
}

.Select-value-label,
.Select-value {
    color: #E5E5E5 !important;
}

.Select-placeholder {
    color: #666666 !important;
}

.Select-input > input {
    background-color: transparent !important;
    color: #E5E5E5 !important;
}

.Select-arrow-zone,
.Select-clear-zone {
    color: #666666 !important;
}

.Select-clear-zone:hover {
    color: #C9A86A !important;
}

/* Multi select */
.Select--multi .Select-value {
    background-color: #C9A86A !important;
    border-color: #C9A86A !important;
    color: #0a0a0a !important;
    border-radius: 4px !important;
}

/* ============================================================
   TABS - Estilo Premium
   ============================================================ */
.tab-container {
    background-color: transparent !important;
    border: none !important;
}

.custom-tab,
.tab-component {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    color: #999999 !important;
    padding: 14px 28px !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.custom-tab:hover,
.tab-component:hover {
    color: #C9A86A !important;
    background-color: rgba(201, 168, 106, 0.05) !important;
}

.custom-tab--selected,
.tab-component--selected {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 2px solid #C9A86A !important;
    color: #C9A86A !important;
    font-weight: 600 !important;
}

/* ============================================================
   INPUTS
   ============================================================ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea {
    background-color: #111111 !important;
    color: #E5E5E5 !important;
    border: 1px solid #333333 !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    font-size: 1rem !important;
    transition: border-color 0.2s ease !important;
}

input:focus,
textarea:focus {
    border-color: #C9A86A !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.15) !important;
}

input::placeholder,
textarea::placeholder {
    color: #555555 !important;
}

/* ============================================================
   BUTTONS
   ============================================================ */
button {
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

button:active {
    transform: translateY(0) !important;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* ============================================================
   PLOTLY
   ============================================================ */
.js-plotly-plot .plotly .modebar {
    background-color: transparent !important;
}

.js-plotly-plot .plotly .modebar-btn {
    color: #555555 !important;
}

.js-plotly-plot .plotly .modebar-btn:hover {
    color: #C9A86A !important;
}

/* ============================================================
   LOADING
   ============================================================ */
._dash-loading {
    background-color: #0a0a0a !important;
}

/* ============================================================
   MODO TV
   ============================================================ */
.modo-tv-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10000 !important;
    background-color: #0a0a0a !important;
    overflow: auto !important;
    padding: 20px !important;
}

/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes pulseGold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 106, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(201, 168, 106, 0); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes celebrate {
    0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes confetti {
    0% { transform: translateY(-100vh) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(720deg); }
}

.animate-fadeIn {
    animation: fadeInUp 0.4s ease-out;
}

.animate-pulse {
    animation: pulseGold 2s infinite;
}

.animate-celebrate {
    animation: celebrate 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================================
   CELEBRAÇÃO OVERLAY
   ============================================================ */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(10px);
}

.celebration-card {
    background: linear-gradient(145deg, #1a1a1a 0%, #111111 100%);
    border: 2px solid #C9A86A;
    border-radius: 24px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: 0 0 100px rgba(201, 168, 106, 0.3);
    animation: celebrate 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================================
   PODIUM (Ranking)
   ============================================================ */
.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}

.podium-place:hover {
    transform: translateY(-5px);
}

.podium-1 .podium-bar { 
    height: 180px; 
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
}
.podium-2 .podium-bar { 
    height: 140px; 
    background: linear-gradient(180deg, #C0C0C0 0%, #A0A0A0 100%);
}
.podium-3 .podium-bar { 
    height: 100px; 
    background: linear-gradient(180deg, #CD7F32 0%, #8B4513 100%);
}

.podium-bar {
    width: 120px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #0a0a0a;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-container {
    background-color: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    height: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-green { background: linear-gradient(90deg, #10b981 0%, #22c55e 100%); }
.progress-gold { background: linear-gradient(90deg, #C9A86A 0%, #E5C68D 100%); }
.progress-orange { background: linear-gradient(90deg, #f97316 0%, #fb923c 100%); }
.progress-red { background: linear-gradient(90deg, #ef4444 0%, #f87171 100%); }

/* ============================================================
   CARDS
   ============================================================ */
.card-glass {
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.card-gradient {
    background: linear-gradient(145deg, #151515 0%, #0d0d0d 100%);
    border: 1px solid #222222;
    border-radius: 16px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gold { background: rgba(201, 168, 106, 0.2); color: #C9A86A; border: 1px solid rgba(201, 168, 106, 0.3); }
.badge-green { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-orange { background: rgba(249, 115, 22, 0.2); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-red { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.3); }

/* ============================================================
   GLOW EFFECTS
   ============================================================ */
.glow-gold {
    box-shadow: 0 0 20px rgba(201, 168, 106, 0.3);
}

.glow-green {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* ============================================================
   NUMBER COUNTER
   ============================================================ */
.number-big {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

.number-huge {
    font-size: 4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 768px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr !important; }
    .number-huge { font-size: 2.5rem !important; }
}

/* ============================================================
   MODO TV — Compatibilidade / Responsividade (Smart TVs)
   ============================================================ */

/* Evita "corte" por excesso de altura em TVs antigas */
@media (max-height: 820px) {
  #tv-container .tv-ranking-podium {
    transform: scale(0.92);
    transform-origin: top center;
  }
  #tv-container .tv-ranking-row {
    padding: 10px 12px !important;
    margin-bottom: 8px !important;
  }
  #tv-container .tv-ranking-pos {
    width: 22px !important;
    font-size: 14px !important;
  }
  #tv-container .tv-ranking-name {
    font-size: 14px !important;
  }
  #tv-container .tv-ranking-value {
    font-size: 16px !important;
  }
}

/* TVs ainda menores */
@media (max-height: 720px) {
  #tv-container .tv-ranking-podium {
    transform: scale(0.88);
  }
  #tv-container .tv-ranking-row {
    padding: 8px 10px !important;
    margin-bottom: 6px !important;
  }
}

/* ============================================================
   CELEBRAÇÃO TV - Animações
   ============================================================ */

#tv-celebration-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Animação de entrada do card */
@keyframes celebrationPop {
  0% { 
    opacity: 0; 
    transform: scale(0.3) rotate(-5deg); 
  }
  50% { 
    transform: scale(1.05) rotate(2deg); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1) rotate(0deg); 
  }
}

/* Brilho pulsante do avatar */
@keyframes pulseNeon {
  0%, 100% { 
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5), 
                0 0 60px rgba(0, 212, 255, 0.3), 
                inset 0 0 30px rgba(0, 212, 255, 0.1);
  }
  50% { 
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.8), 
                0 0 100px rgba(0, 212, 255, 0.5), 
                inset 0 0 50px rgba(0, 212, 255, 0.2);
  }
}

/* Estrelas piscando */
@keyframes twinkle {
  0%, 100% { 
    opacity: 0.3; 
    transform: scale(1); 
  }
  50% { 
    opacity: 1; 
    transform: scale(1.3); 
  }
}

/* Classes antigas de celebração TV (compatibilidade) */
.tv-cele-wrap {
  width: min(92vw, 980px);
  padding: clamp(18px, 2.2vw, 38px);
  border-radius: 22px;
  background: rgba(10, 16, 28, 0.88);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
  text-align: center;
  animation: celebrationPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tv-cele-title {
  font-size: clamp(26px, 3.2vw, 64px);
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tv-cele-sub {
  font-size: clamp(14px, 1.8vw, 30px);
  color: #E5E7EB;
  margin-top: 6px;
}

/* ============================================================
   CELEBRAÇÃO COM CONFETE - Novas Animações
   ============================================================ */

/* Animação de queda do confete */
@keyframes confetti-fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Animação de brilho pulsante */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.5), 0 0 60px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 212, 255, 0.8), 0 0 100px rgba(0, 212, 255, 0.5);
    }
}

/* Animação de entrada bouncing */
@keyframes bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animação de flutuação */
@keyframes float-up {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Container do confete - DESABILITADO para performance no Fire TV Stick */
.celebration-confetti > div {
    /* animation: confetti-fall 4s ease-in-out infinite; */
    display: none;
}

/* Título da celebração - sem animação */
.celebration-title {
    /* animation: bounce-in 0.6s ease-out; */
}

/* Avatar com brilho - sem animação infinita */
.celebration-avatar {
    /* animation: pulse-glow 2s ease-in-out infinite; */
}

/* Troféu flutuante - sem animação infinita */
.celebration-trophy {
    /* animation: float-up 2s ease-in-out infinite; */
}

/* Card principal da celebração - sem animação */
.celebration-card {
    /* animation: bounce-in 0.5s ease-out; */
}
