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

:root {
    --primary: #ff4b8b;
    --primary-hover: #e03572;
    --primary-light: #ffeaf1;
    --secondary: #ff7aa2;
    --accent: #d291ff;
    --accent-dark: #b164ec;
    --background: #fff5f7;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-solid: #ffffff;
    --text-main: #3c242c;
    --text-muted: #8a6c76;
    --border-color: rgba(255, 75, 139, 0.15);
    --shadow: 0 8px 32px 0 rgba(255, 75, 139, 0.08);
    --shadow-hover: 0 12px 40px 0 rgba(255, 75, 139, 0.15);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-heading: 'Fredoka', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

body {
    background: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(at 10% 20%, rgba(255, 122, 162, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(210, 145, 255, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Container principal */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header & Barra de Navegação */
header {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(45deg, var(--primary), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(255, 75, 139, 0.1);
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 50px;
}

.user-badge .name {
    font-weight: 600;
    font-size: 14px;
}

.user-badge .points {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Cards & Glassmorphism */
.card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Formulários & Inputs */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-main);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 75, 139, 0.1);
}

/* Botões */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 75, 139, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 75, 139, 0.4);
}

.btn-block {
    display: block;
    width: 100%;
}

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

.btn-secondary:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Páginas de Autenticação */
.auth-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-header {
    margin-bottom: 30px;
}

.auth-logo {
    font-family: var(--font-heading);
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 10px;
}

.auth-subtitle {
    color: var(--text-muted);
}

/* Abas de Navegação dos Grupos */
.groups-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 5px;
    margin-bottom: 25px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.groups-tabs::-webkit-scrollbar {
    height: 6px;
}

.groups-tabs::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}

.tab-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: var(--font-heading);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.tab-btn:hover, .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(255, 75, 139, 0.2);
}

/* Grade de Partidas */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.match-card {
    background: white;
    border: 1px solid rgba(255, 75, 139, 0.1);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.match-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 75, 139, 0.05);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.match-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.match-team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.match-team.team-home {
    justify-content: flex-end;
    text-align: right;
}

.match-team.team-away {
    justify-content: flex-start;
    text-align: left;
}

.team-flag {
    width: 28px;
    height: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: #f0f0f0;
    display: inline-block;
    object-fit: cover;
}

/* Inputs de palpite de placar */
.guess-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-input {
    width: 45px;
    height: 45px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--background);
    color: var(--text-main);
    transition: all 0.3s ease;
}

.score-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 75, 139, 0.2);
}

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

.match-vs {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 14px;
}

.match-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.save-status {
    color: #50fa7b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-status.show {
    opacity: 1;
}

.match-locked-badge {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* Ranking Table */
.ranking-table-container {
    overflow-x: auto;
}

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

.ranking-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
}

.ranking-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.ranking-row:hover {
    background: rgba(255, 75, 139, 0.02);
}

.rank-position {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    width: 50px;
}

.rank-position.pos-1 {
    color: #ffd700;
    font-size: 24px;
    text-shadow: 0 2px 5px rgba(255, 215, 0, 0.3);
}

.rank-position.pos-2 {
    color: #c0c0c0;
    font-size: 22px;
}

.rank-position.pos-3 {
    color: #cd7f32;
    font-size: 20px;
}

.rank-name {
    font-weight: 600;
    font-size: 16px;
}

.rank-points {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

/* Estilos para Palpites do Dia */
.date-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.date-select-input {
    padding: 10px 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 16px;
    background: white;
}

.daily-guesses-match {
    margin-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 20px;
}

.daily-guesses-match:last-child {
    border-bottom: none;
}

.match-info-header {
    background: var(--primary-light);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.match-info-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

.match-info-details {
    font-size: 13px;
    color: var(--text-muted);
}

.friends-guesses-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.friend-guess-card {
    background: white;
    border: 1px solid rgba(255, 75, 139, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.01);
}

.friend-guess-name {
    font-weight: 600;
    font-size: 14px;
}

.friend-guess-score {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    background: var(--background);
    padding: 4px 10px;
    border-radius: 8px;
    color: var(--text-main);
}

.friend-guess-score.locked-guess {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    background: #f0f0f0;
}

.points-pill {
    margin-left: 5px;
    font-size: 10px;
    background: #50fa7b;
    color: #1e1e2e;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* Painel de Admin */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.admin-match-teams {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.admin-match-team-name {
    font-weight: 600;
    width: 120px;
}

.admin-match-team-name.left {
    text-align: right;
}

.admin-match-team-name.right {
    text-align: left;
}

/* Rodapé */
footer {
    margin-top: auto;
    padding: 30px 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.4);
}

/* Alertas */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-danger {
    background: #ffe5e5;
    color: #cc0000;
    border: 1px solid #ffcccc;
}

.alert-success {
    background: #e6ffe6;
    color: #008000;
    border: 1px solid #ccffcc;
}

.alert-info {
    background: #e6f7ff;
    color: #0066cc;
    border: 1px solid #cceeff;
}

/* Responsividade de Celular */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .matches-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-match-row {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-match-team-name {
        width: auto;
    }
    
    .admin-match-team-name.left, .admin-match-team-name.right {
        text-align: center;
    }
}
