/* ==========================================================================
   GOLDEBET - UTILITIES CSS
   Estilos utilitários, overrides específicos e fixes de layout
   ========================================================================== */

/* =============
   LAYOUT OVERRIDES
   ============= */
/* FORÇAR CONTEXTO CORRETO PARA HEADER FIXO */
html, body {
    position: static !important;
    transform: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
}

/* HEADER PRINCIPAL FIXO - REGRA MÁXIMA PRIORIDADE */
header.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1020 !important;
    margin: 0 !important;
    transform: none !important;
}

.dashboard-container {
    margin: 0px auto;
    padding: 0 0;
}

/* Remover scroll horizontal desnecessário */
html, body {
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
    height: auto;
    max-height: none;
}

* {
    box-sizing: border-box;
}

/* =============
   WELCOME CARD
   ============= */
.welcome-card {
    background: var(--card-dark);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);    
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 40px var(--shadow-dark),
        0 0 0 1px rgba(255, 215, 0, 0.1);
}

.welcome-card h2 {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.logout-btn {
    background: linear-gradient(135deg, #FA0000, #cc3333);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 71, 87, 0.3);
}

/* =============
   DASHBOARD INFO
   ============= */
.dashboard-info {
    background: var(--card-dark);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 40px var(--shadow-dark),
        0 0 0 1px rgba(255, 215, 0, 0.1);
}

.dashboard-info h3 {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.dashboard-info p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.dashboard-info ul {
    list-style: none;
    padding: 0;
}

.dashboard-info li {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    padding-left: 1rem;
}

/* =============
   MAIN CONTENT LAYOUT
   ============= */
.main-content-wrapper {
    margin-left: 280px; /* Espaço para o sidebar no desktop */
    margin-top: 80px; /* Espaço para o header fixo */
    transition: margin-left 0.3s ease;
}

/* Garantir que o botão Aulas seja clicável */
.external-link[data-external="true"] {
    pointer-events: auto !important;
    z-index: 9999 !important;
    position: relative !important;
}

.external-link[data-external="true"]:hover {
    background: rgba(132, 61, 158, 0.1) !important;
}

/* =============
   RESPONSIVE LAYOUT
   ============= */
@media (max-width: 768px) {
    
    .main-content-wrapper {
        margin-left: 0 !important; /* Sem margem no mobile */
        margin-top: 40px !important; /* Espaço para o header fixo também no mobile */
    }
    
    /* Header mobile */
    .header-right {
        gap: var(--spacing-sm);
    }
    
    .btn-deposit {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--font-size-xs);
    }
    
    .dropdown-menu {
        right: -20px;
        min-width: 180px;
    }
    
    /* Logo responsiva */
    .logo-icon {
        height: 40px; /* Reduzido 30% de 35px */
        max-width: 84px; /* Reduzido 30% de 120px */
    }
    
    /* Header principal SEMPRE fixo - MOBILE também */
    header.header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1020 !important;
        margin: 0 !important;
        transform: none !important;
        padding: 10px 20px;
    }
}

/* =============
   ANIMATIONS
   ============= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============
   CONTAINER SIZES
   ============= */
/* Container principal ocupando largura completa */
#gameMainContainer {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: none;
    height: auto;
}

#gameAndHistoryContainer {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: none;
    height: auto;
}

/* Histórico com largura fixa otimizada */
.history-container.desktop-only {
    width: 450px;
    flex-shrink: 0;
    height: 580px; /* 520px do iframe + 60px do botão */
}

/* Quadradinhos do histórico responsivos */
.history-number {
    font-size: 13px;
    font-weight: 700;
    width: 100%;
}

/* Container da sessão de jogo ocupa largura completa */
.game-session {
    width: 100%;
    max-width: none;
    padding: var(--spacing-lg);
}

/* =============
   MOBILE SPECIFIC FIXES
   ============= */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto !important;
        height: auto !important;
        max-height: none !important;
        position: static !important;
    }
    
    .history-number {
        font-size: 11px;
    }
    
    .history-grid.mobile-grid {
        gap: 2px;
    }
}

/* =============
   DESKTOP SPECIFIC FIXES
   ============= */
@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
}

/* =============
   GAME SESSION ACTIVE STATES
   ============= */
/* Esconder sidebar quando jogo está ativo - APENAS NO DESKTOP */
@media (min-width: 769px) {
    .game-session-active .sidebar {
        transform: translateX(-100%);
    }
    
    .game-session-active .main-content-wrapper {
        margin-left: 0;
    }
}

/* NO MOBILE, permitir que o sidebar apareça mesmo com jogo ativo */
@media (max-width: 768px) {
    .game-session-active .sidebar.active {
        transform: translateX(0) !important; /* Força aparição quando ativo */
        z-index: 1016 !important; /* Garante que fica por cima */
    }
}
