@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.centered-box {
    max-width: 450px;
    margin: 5rem auto;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control[type="file"] {
    padding: 0.5rem;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--surface-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--surface-border);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    margin-bottom: 2rem;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.text-center {
    text-align: center;
}

.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 2rem; }

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 2rem;
}

.user-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.user-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.user-table td {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.user-table tr td:first-child {
    border-radius: 12px 0 0 12px;
}

.user-table tr td:last-child {
    border-radius: 0 12px 12px 0;
}

.user-table .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-table .avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--surface-border);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-user {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Prediction Module Styles */
.game-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.game-header {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.team-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.team-left { text-align: right; }
.team-right { text-align: left; }

.score-input {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--surface-border);
    border-radius: 12px;
    color: var(--text-main);
}

.score-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.score-divider {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-muted);
}

.predictions-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prediction-pill {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pill-label {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.pill-score {
    font-weight: 700;
    color: var(--primary-color);
}

/* Tab System */
.tab-container {
    margin-bottom: 2rem;
}

.tab-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

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

.tab-content {
    display: none;
}

#tab-user:checked ~ .tab-nav label[for="tab-user"],
#tab-game:checked ~ .tab-nav label[for="tab-game"],
#main-admin-resultados:checked ~ .tab-nav label[for="main-admin-resultados"],
#main-admin-previsoes:checked ~ .tab-nav label[for="main-admin-previsoes"],
#main-admin-usuarios:checked ~ .tab-nav label[for="main-admin-usuarios"],
#main-admin-credenciais:checked ~ .tab-nav label[for="main-admin-credenciais"] {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

#tab-user:checked ~ #content-user,
#tab-game:checked ~ #content-game,
#main-admin-resultados:checked ~ #content-main-resultados,
#main-admin-previsoes:checked ~ #content-main-previsoes,
#main-admin-usuarios:checked ~ #content-main-usuarios,
#main-admin-credenciais:checked ~ #content-main-credenciais {
    display: block;
}

.tab-input {
    display: none;
}

.flag-icon {
    width: 24px;
    height: auto;
    border-radius: 4px;
    vertical-align: middle;
    margin: 0 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* New prediction rules styles */
.deadline-info {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.5rem;
    font-weight: 500;
}

.time-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 1rem;
}

.time-br {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.9rem;
}

.time-local {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.actions-row {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
}

.score-input:disabled {
    opacity: 0.7;
    background: rgba(0,0,0,0.2);
    border-color: transparent;
    cursor: not-allowed;
}

.venue-info {
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-top: 5px;
    font-style: italic;
}

/* Tabs System */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(0,0,0,0.2);
    padding: 0.4rem;
    border-radius: 12px;
    width: fit-content;
}

.tab-link {
    padding: 0.6rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tab-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.tab-content-hidden {
    display: none;
}

.tab-content-active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Group Sections */
.group-section {
    margin-bottom: 3rem;
    background: rgba(0,0,0,0.1);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.group-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 4px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Compact Game Card */
.game-card.compact {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    transition: all 0.3s ease;
}

.game-card.compact:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.game-card.compact.has-prediction {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}

.game-card.compact.has-prediction:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.6);
}

.game-card.compact {
    position: relative;
    padding-top: 1.5rem; /* give space for badge */
}

.saved-badge {
    position: absolute;
    top: 5px;
    right: 15px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 0.2rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.game-info-mini {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.group-tag { color: var(--primary-color); }
.time-tag { color: var(--text-muted); }

.score-row-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.team-compact {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.flag-mini { width: 20px; height: auto; border-radius: 2px; }

.inputs-compact {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.score-input-mini {
    width: 36px;
    height: 36px;
    text-align: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.score-input-mini:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.score-input-mini:disabled {
    opacity: 0.6;
    background: rgba(0,0,0,0.3);
}

/* Hide spin buttons on number inputs */
.no-spinners::-webkit-outer-spin-button,
.no-spinners::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.no-spinners[type=number] {
    -moz-appearance: textfield;
}

.card-footer-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--surface-border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.venue-mini {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-mini {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-save {
    background: var(--primary-color);
    color: white;
}

.btn-edit {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--surface-border);
}

.locked-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* General Utility Extracted from Index */
.hero-title {
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}
.auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.auth-buttons .btn {
    max-width: 200px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    /* Layout */
    .container {
        padding: 1rem;
    }
    .centered-box {
        margin: 2rem auto;
    }
    .glass-panel {
        padding: 1.5rem;
    }
    
    /* Header */
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Hero */
    .hero-title {
        font-size: 3.5rem;
    }
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    .auth-buttons {
        flex-direction: column;
        align-items: center;
    }
    .auth-buttons .btn {
        max-width: 100%;
    }
    
    /* Pages & Games Grid */
    .title {
        font-size: 2rem;
    }
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tabs */
    .tabs-nav {
        width: 100%;
        justify-content: space-between;
    }
    .tab-link {
        flex: 1;
        text-align: center;
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Compact Card Adjustments */
    .game-info-mini {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    .score-row-compact {
        flex-direction: row;
        justify-content: center;
    }
    .team-compact {
        font-size: 0.8rem;
    }
    .team-compact.left, .team-compact.right {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
    .team-compact.left { flex-direction: column-reverse; }
    .score-input-mini {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    .card-footer-compact {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }
    .venue-mini {
        max-width: 100%;
        white-space: normal;
    }
}