/* 
   Bolão Copa 2026 - CSS Premium 
   Tema: Deep Emerald & Gold Glassmorphism 
*/

:root {
    --bg-primary: #06130d;
    --bg-secondary: rgba(10, 31, 21, 0.7);
    --accent-emerald: #10b981;
    --accent-gold: #fbbf24;
    --accent-gold-hover: #f59e0b;
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: rgba(16, 185, 129, 0.2);
    --border-color-focus: rgba(251, 191, 36, 0.5);
    --glass-bg: rgba(10, 31, 21, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-family: 'Outfit', 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 50% 0%, #0c2f1e 0%, var(--bg-primary) 70%);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 60px;
}

header {
    background: rgba(6, 19, 13, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand span {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background: var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-logout:hover {
    color: #ef4444;
}

main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 25px;
    margin-bottom: 30px;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--bg-primary);
    background: var(--accent-gold);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

/* Tabs Content */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

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

/* Matches Grid */
.matches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 900px) {
    .matches-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.group-title {
    font-size: 1.3rem;
    margin: 25px 0 15px 0;
    border-left: 4px solid var(--accent-gold);
    padding-left: 10px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Match Card */
.match-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.match-card:hover {
    transform: translateY(-2px);
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.match-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    width: 80px;
}

.match-teams-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-grow: 1;
}

.team-block {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 40%;
}

.team-block.team-left {
    justify-content: flex-end;
    text-align: right;
}

.team-block.team-right {
    justify-content: flex-start;
    text-align: left;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bet Inputs */
.score-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
}

.score-input {
    width: 58px;
    height: 40px;
    background: rgba(6, 19, 13, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-family);
    outline: none;
    transition: all 0.2s;
}

.score-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
    background: rgba(6, 19, 13, 0.95);
}

.score-input:disabled {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
}

.score-separator {
    font-weight: bold;
    color: var(--accent-gold);
    font-size: 0.8rem;
}

/* Points badge on dashboard */
.points-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-emerald);
    color: var(--bg-primary);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-bottom-left-radius: 8px;
    box-shadow: -2px 2px 5px rgba(0,0,0,0.1);
}

.points-badge.points-exact {
    background: var(--accent-gold);
}

.points-badge.points-zero {
    background: #4b5563;
    color: #fff;
}

/* Ranking Table */
.ranking-table-container {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.ranking-table th, .ranking-table td {
    padding: 14px 16px;
    text-align: left;
}

.ranking-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid var(--border-color);
    color: var(--accent-gold);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.ranking-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s;
}

.ranking-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ranking-table tr.current-user {
    background: rgba(251, 191, 36, 0.06);
    border-left: 3px solid var(--accent-gold);
}

.rank-number {
    font-weight: 800;
    font-size: 1.1rem;
}

.rank-1 { color: #fbbf24; }
.rank-2 { color: #d1d5db; }
.rank-3 { color: #b45309; }

/* Status alerts */
.save-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(16, 185, 129, 0.95);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease;
}

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

/* Rules list styling */
.rules-list {
    margin-top: 15px;
}

.rules-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rules-item-title {
    font-weight: 600;
}

.rules-item-points {
    color: var(--accent-gold);
    font-weight: bold;
}

/* Extra predictions card */
.extras-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media(min-width: 600px) {
    .extras-panel {
        grid-template-columns: 1fr 1fr;
    }
}

.extra-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.extra-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.extra-input, .prediction-extra-input {
    width: 100%;
    height: 45px;
    background: rgba(6, 19, 13, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0 15px;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}

.extra-input:focus, .prediction-extra-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* Button general */
.btn-primary {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-gold-hover);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

/* Login/Token input card */
.login-card {
    max-width: 450px;
    margin: 100px auto;
    text-align: center;
}

/* Modal details */
.view-bets-link {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent-gold);
    text-decoration: none;
    margin-top: 5px;
    transition: color 0.2s;
}

.view-bets-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Admin panel elements */
.admin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 0;
}

.admin-token {
    font-family: monospace;
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

.admin-match-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-match-card input {
    width: 58px;
    height: 38px;
    background: #000;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Custom Select Styling */
select.extra-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23fbbf24' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: calc(100% - 10px);
    background-position-y: 50%;
    padding-right: 35px !important;
}

select.extra-input::-ms-expand {
    display: none;
}

/* Reusable Admin Action Buttons */
.btn-action {
    display: inline-block;
    width: 140px;
    padding: 8px 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none !important;
    border-radius: 6px;
    transition: all 0.2s;
    margin: 3px 0;
    border: none;
}

.btn-action:hover, .btn-action:focus {
    text-decoration: none !important;
}

.btn-translucent-gold {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid var(--accent-gold) !important;
    color: var(--accent-gold) !important;
}

.btn-translucent-gold:hover {
    background: var(--accent-gold) !important;
    color: var(--bg-primary) !important;
}

.btn-save-score {
    text-transform: uppercase;
}

/* Toggle Switch Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .3s;
}

input:checked + .slider {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-emerald);
}

input:checked + .slider:before {
    background-color: var(--accent-emerald);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Unificação e Padronização de Títulos de Abas/Páginas */
.tab-section-title {
    font-size: 1.8rem !important;
    text-transform: uppercase !important;
    text-align: center !important;
    color: var(--accent-gold) !important;
    font-weight: 800 !important;
    letter-spacing: 1.5px !important;
    margin-top: 15px !important;
    margin-bottom: 25px !important;
    display: block !important;
    width: 100% !important;
}

/* ==========================================================================
   Responsividade para Telas Mobile (max-width: 600px)
   ========================================================================== */
@media (max-width: 600px) {
    /* Header do Site */
    .nav-container {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
        text-align: center;
    }
    
    .user-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    .user-badge {
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }

    /* Cards de Partidas do Usuário */
    .match-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    
    .match-info {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100% !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 6px;
        text-align: left;
        box-sizing: border-box;
    }
    
    .match-info div {
        font-size: 0.8rem;
    }
    
    .match-info div:nth-child(2) {
        margin-top: 0 !important;
        margin-left: auto;
        margin-right: 4px;
    }
    
    .match-teams-container {
        width: 100%;
        gap: 8px;
    }
    
    .team-block {
        width: 38% !important;
        gap: 4px;
    }
    
    .team-name {
        font-size: 0.85rem;
    }
    
    .score-input {
        width: 48px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    /* Cards de Partidas do Admin */
    .admin-match-card {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 12px;
        text-align: center;
    }
    
    .admin-match-card > div:first-child {
        width: 100% !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 6px;
        text-align: center !important;
    }
    
    .admin-match-card > div:nth-child(2) {
        width: 100% !important;
        justify-content: center;
    }
    
    .admin-match-card input {
        width: 48px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    /* Regras e Pontos Mobile */
    .rules-item > div:first-child {
        width: 80% !important;
        padding-right: 15px;
        box-sizing: border-box;
    }

    .rules-item-points {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 1.1;
        text-align: center;
        font-size: 1.1rem;
        width: 20% !important;
        box-sizing: border-box;
    }
    
    .rules-item-points .pts-text {
        display: none;
    }
    
    .rules-item-points::after {
        content: "pts";
        font-size: 0.75rem;
        color: var(--text-muted);
        display: block;
        margin-top: 2px;
        text-transform: lowercase;
    }

    /* Form do novo participante no mobile */
    #admin-users form {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    #admin-users form > div {
        width: 100% !important;
        min-width: 0 !important;
    }
    
    #admin-users form button {
        width: 100% !important;
        margin-top: 5px !important;
    }

    .admin-users-grid {
        display: block !important;
    }

    /* Otimizações do Container Glass Panel no Mobile */
    .glass-panel {
        padding: 15px !important;
        border-radius: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

