/* Custom visual improvements for Página - PREMIUM & FIXES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- CRITICAL BUG FIXES --- */

/* Fix "Ghost Site" Background Issue - NUCLEAR OPTION */
html,
body {
    background: #f4f6f9 !important;
    background-color: #f4f6f9 !important;
    background-image: none !important;
}

/* --- CRITICAL BUG FIXES & LAYOUT RESET --- */

/* 1. Global Reset & Wrapper Fix (Sticky Footer) */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    /* Essential for sticky footer */
    background: #f4f6f9 !important;
    background-color: #f4f6f9 !important;
    background-image: none !important;
    font-family: 'Inter', sans-serif !important;
    overflow-x: hidden;
    /* Prevent horizontal scrollbar from loose elements */
}

/* Force the body to be a flex container */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* The element that wraps the page content (ui-view) */
div[ui-view="page-content"],
.wrapper,
.main-content {
    flex: 1 0 auto;
    /* Grow to fill space */
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Ensure the container inside centers properly */
.container,
.container.ng-scope {
    width: 100% !important;
    max-width: 1140px !important;
    /* Standard Bootstrap width */
    margin: 0 auto !important;
    padding-left: 15px;
    padding-right: 15px;
    float: none !important;
    /* Kill legacy floats */
    display: block;
}

/* 2. Nuclear Clearfix (Fix for "Floated elements causing collapse") */
.clearfix::after,
.container::after,
.row::after,
.coluna-aposte::after {
    content: "";
    display: table;
    clear: both;
}

/* 3. Hide Ghost Elements */
.img-background-header,
.background-header,
#background-header,
#apfXq1fkqbocXZb {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 4. Layer Management (Z-Index Warfare) */
/* Header: High Check */
header.main-header {
    z-index: 1000 !important;
    position: relative !important;
}

/* Modals: Higher */
.modal-backdrop,
.modal {
    z-index: 1050 !important;
}

/* Dropdowns: High */
.dropdown-menu {
    z-index: 1020 !important;
}

/* Content: Base */
.container {
    z-index: 10;
    position: relative;
}

/* Footer: Base */
footer,
#rodape {
    z-index: 5;
    position: relative;
    flex-shrink: 0;
    /* Don't shrink */
}


/* Clean Header Styling */
header.main-header {
    background: linear-gradient(120deg, #0066b3 0%, #004a80 100%) !important;
    padding-bottom: 20px;
    z-index: 100 !important;
}

/* Fix "da CAIXA" alignment but DO NOT HIDE IT */
.barraCaixa {
    display: flex !important;
    justify-content: space-between;
    padding: 5px 20px;
    background-color: #f8f9fa;
    /* Should likely be light */
}

/* Fix Vertical Icons Overlap (Sidebar/Menu Leak) */
/* Ensure standard navbars don't float strangely */
ul.nav.navbar-nav {
    float: none !important;
    position: relative !important;
    width: auto !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Fix "Acessar" floating weirdly or overlapping */
login-header,
.menuSecundario {
    position: relative;
    z-index: 1001;
}

/* Ensure the main content covers any background garbage and has spacing */
#container-volante,
.coluna-aposte {
    background: #ffffff;
    position: relative;
    z-index: 10;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Premium shadow */
    margin-top: 20px;
    /* Add spacing from header */
}

.container.ng-scope {
    padding-top: 20px;
}

/* --- PREMIUM DESIGN SYSTEM --- */

/* General Reset & Typography */
body {
    font-family: 'Inter', 'Segoe UI', sans-serif !important;
    color: #1a202c;
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px;
    color: #0f172a;
}

.titulo-pagina h3 {
    color: #0066b3 !important;
    font-size: 1.8rem;
    /* Slightly larger */
    font-weight: 800 !important;
    text-transform: uppercase;
    background: transparent !important;
    margin-top: 10px;
}

/* Fix Header Info Spacing */
.titulo-pagina ul li {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 5px;
}

/* --- GAME GRID (LOTTERY NUMBERS) --- */

.escolhe-numero {
    display: grid;
    grid-template-columns: repeat(10, 1fr) !important;
    /* Force 10 columns for Mega-Sena standard */
    gap: 10px;
    justify-content: center;
    padding: 20px 0;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .escolhe-numero {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .escolhe-numero {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

.escolhe-numero li {
    list-style: none;
    margin: 0 !important;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Number Circles - Premium Look */
.escolhe-numero li a {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background-color: #f1f5f9;
    color: #475569 !important;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.escolhe-numero li a:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    color: #0066b3 !important;
    border-color: #0066b3;
}

/* Selected State - Mega-Sena Green */
.escolhe-numero li a.selected {
    background: linear-gradient(135deg, #209869 0%, #107c52 100%) !important;
    color: #ffffff !important;
    border: none;
    box-shadow: 0 8px 16px rgba(32, 152, 105, 0.4);
    transform: scale(1.1);
}

/* Selected State Focus Ring */
.escolhe-numero li a.selected:focus {
    box-shadow: 0 0 0 4px rgba(32, 152, 105, 0.3);
}


/* --- BUTTONS --- */

.btn,
button,
.botao {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    text-transform: uppercase;
    font-size: 0.9rem !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: normal !important;
}

/* Primary Actions */
.btn-primary,
.data-completar-jogo-mega-sena,
.data-limpar-volante-mega-sena,
#completeojogo {
    background: #0066b3 !important;
    border: none !important;
    color: white !important;
    /* Force white text */
    opacity: 1 !important;
}

.btn-primary:hover,
.data-completar-jogo-mega-sena:hover {
    background: #005091 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 179, 0.3);
    color: white !important;
}

/* Specific Fix for "Complete o Jogo" Button */
#completeojogo {
    width: 100%;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #0066b3 0%, #005091 100%) !important;
}

/* Secondary/Warning Actions (Add to Cart) */
.btn-warning,
.data-incluir-aposta-mega-sena {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

/* Outline Buttons (Limpar) */
#limparvolante {
    background: transparent !important;
    border: 2px solid #cbd5e1 !important;
    color: #64748b !important;
    box-shadow: none !important;
    width: 100%;
}

#limparvolante:hover {
    border-color: #94a3b8 !important;
    color: #475569 !important;
    background: #f8fafc !important;
}

/* --- CARDS & CONTAINERS --- */

/* Main Container */
.container.ng-scope {
    max-width: 1200px;
    margin: 40px auto;
}

/* Betting Area */
.coluna-aposte {
    background: white;
    padding: 40px !important;
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Surpresinha Section */
.surpresinha {
    background: linear-gradient(to right, #f0f9ff, #e0f2fe);
    padding: 20px;
    border-radius: 12px;
    border: 1px dashed #bae6fd;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.surpresinha p {
    margin: 0;
    color: #0c4a6e;
    font-size: 0.95rem;
    flex: 1;
    min-width: 200px;
    text-align: left;
}

.surpresinha button#surpresinha {
    white-space: nowrap;
    background: #0ea5e9 !important;
    color: white !important;
    border: none !important;
}

/* Inputs (+/-) */
.input-mais-menos {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.input-mais-menos .botao {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white !important;
    color: #0066b3 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 0 !important;
    font-size: 1.2rem !important;
}

.input-mais-menos .botao:hover {
    border-color: #0066b3 !important;
}

/* Total Bar */
.valor-aposta {
    background: #ffffff;
    color: #0f172a;
    padding: 20px 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.valor-aposta p {
    color: #334155;
    margin: 0;
    font-size: 1.1rem;
}

.valor-aposta .preco {
    font-size: 2rem;
    font-weight: 700;
    color: #4ade80;
    /* Bright green for money */
    margin-left: 10px;
}

/* --- FOOTER & EXTRAS --- */
/* --- FOOTER & EXTRAS --- */

/* Fix Footer Positioning & Bugs */
#rodape {
    padding-top: 60px;
    background: #f9fbfb !important;
    position: relative !important;
    display: block !important;
    clear: both !important;
    width: 100% !important;
    margin-top: auto !important;
}

/* Fix The Blue Bar at Bottom */
.rodape-azul {
    position: relative !important;
    /* Was absolute */
    width: 100% !important;
    left: auto !important;
    bottom: auto !important;
    margin-top: 20px !important;
    padding: 15px 0 !important;
    height: auto !important;
    background-color: #005CA9 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rodape-azul p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: normal !important;
    text-align: center;
}

/* Fix Lists in Footer */
.content-rodape .column-rodape {
    float: none !important;
    display: inline-block !important;
    /* Or flex */
    vertical-align: top;
    margin: 0 2% !important;
    width: auto !important;
    min-width: 200px;
}

/* Flexbox container for footer columns if possible */
.content-rodape {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.link-footer {
    height: auto !important;
    padding-bottom: 20px !important;
}
