/**
 * Estilos CSS Premium do World Cup Predictor
 */

:root {
    --wc-pred-primary: #15803d; /* Verde Relva */
    --wc-pred-primary-light: #f0fdf4; /* Fundo menta suave */
    --wc-pred-secondary: #16a34a; /* Verde Relva Intermédio */
    --wc-pred-accent: #f59e0b; /* Amarelo ouro para troféus/destaques */
    --wc-pred-text-main: #0f172a;
    --wc-pred-text-muted: #475569;
    --wc-pred-bg-container: #ffffff;
    --wc-pred-bg-card: #f8fafc;
    --wc-pred-border: #d1fae5; /* Margens menta claras */
    --wc-pred-success: #10b981;
    --wc-pred-success-bg: #d1fae5;
    --wc-pred-warning: #f59e0b;
    --wc-pred-warning-bg: #fef3c7;
    --wc-pred-danger: #ef4444;
    --wc-pred-danger-bg: #fee2e2;
    --wc-pred-radius-large: 16px;
    --wc-pred-radius-medium: 12px;
    --wc-pred-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.08), 0 8px 10px -6px rgba(22, 163, 74, 0.08);
    --wc-pred-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-pred-widget {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 700px;
    margin: 30px auto;
    background: var(--wc-pred-bg-container);
    border: 1px solid var(--wc-pred-border);
    border-radius: var(--wc-pred-radius-large);
    box-shadow: var(--wc-pred-shadow);
    overflow: hidden;
    color: var(--wc-pred-text-main);
    box-sizing: border-box;
}

.wc-pred-widget * {
    box-sizing: border-box;
}

/* Header */
.wc-pred-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--wc-pred-primary) 0%, #14532d 100%);
    color: #ffffff;
}

.wc-pred-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wc-pred-icon {
    font-size: 32px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
    animation: bounce-trophy 2s infinite ease-in-out;
}

@keyframes bounce-trophy {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.wc-pred-brand h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #ffffff;
}

.wc-pred-brand p {
    margin: 2px 0 0 0;
    font-size: 13px;
    color: #a7f3d0;
    font-weight: 500;
}

.wc-pred-user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.15);
}

.wc-pred-logout-btn {
    color: #fca5a5;
    text-decoration: none;
    font-weight: 700;
    transition: var(--wc-pred-transition);
}

.wc-pred-logout-btn:hover {
    color: #ef4444;
    transform: translateX(2px);
}

/* Ecrã de Registo / Login */
.wc-pred-auth-container {
    padding: 30px;
    background: radial-gradient(circle at top right, #f8fafc, #ffffff);
}

.wc-pred-auth-card {
    text-align: center;
    max-width: 450px;
    margin: 0 auto;
    padding: 10px 0;
}

.wc-pred-auth-card h4 {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--wc-pred-primary);
    letter-spacing: -0.025em;
}

.wc-pred-auth-desc {
    font-size: 14px;
    color: var(--wc-pred-text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.wc-pred-google-auth-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.wc-pred-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--wc-pred-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 20px 0;
}

.wc-pred-divider::before, .wc-pred-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--wc-pred-border);
}

.wc-pred-divider:not(:empty)::before {
    margin-right: 15px;
}

.wc-pred-divider:not(:empty)::after {
    margin-left: 15px;
}

.wc-pred-magic-form {
    margin-top: 10px;
}

.wc-pred-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.wc-pred-email-input, 
.wc-pred-input-group input[type="email"] {
    flex: 1;
    padding: 14px 16px;
    border: 1.5px solid var(--wc-pred-border);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: var(--wc-pred-transition);
}

.wc-pred-input-group input[type="email"]:focus {
    border-color: var(--wc-pred-primary);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.wc-pred-input-group button {
    background: var(--wc-pred-primary);
    color: #ffffff;
    border: none;
    padding: 0 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--wc-pred-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.wc-pred-input-group button:hover {
    background: #166534;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.wc-pred-input-info {
    font-size: 12px;
    color: var(--wc-pred-text-muted);
    margin: 0;
}

/* Abas de Navegação */
.wc-pred-tabs-wrapper {
    background: #ffffff;
}

.wc-pred-nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--wc-pred-border);
    background: #f8fafc;
}

.wc-pred-tab-link {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 16px;
    font-weight: 700;
    font-size: 14px;
    color: var(--wc-pred-text-muted);
    cursor: pointer;
    transition: var(--wc-pred-transition);
    outline: none;
    text-align: center;
}

.wc-pred-tab-link:hover {
    color: var(--wc-pred-primary);
    background: rgba(22, 163, 74, 0.02);
}

.wc-pred-tab-link.active {
    color: var(--wc-pred-primary);
    border-bottom-color: var(--wc-pred-primary);
    background: #ffffff;
}

/* Conteúdo das Abas */
.wc-pred-tab-content {
    display: none;
    padding: 24px;
    animation: fade-in-tab 0.3s ease-out;
}

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

@keyframes fade-in-tab {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cartão de Jogo */
.wc-pred-matches-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wc-pred-match-card {
    background: var(--wc-pred-bg-card);
    border: 1px solid var(--wc-pred-border);
    border-radius: var(--wc-pred-radius-medium);
    padding: 16px;
    transition: var(--wc-pred-transition);
}

.wc-pred-match-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.wc-pred-match-card.locked {
    background: #f1f5f9;
    border-color: var(--wc-pred-border);
}

.wc-pred-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.wc-pred-tag-phase {
    background: var(--wc-pred-primary-light);
    color: var(--wc-pred-primary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

.wc-pred-card-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--wc-pred-text-muted);
}

.wc-pred-card-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wc-pred-team-col {
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.wc-pred-flag {
    width: 44px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.wc-pred-team-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--wc-pred-text-main);
}

/* Inputs de Palpite */
.wc-pred-inputs-col {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wc-pred-guess-form {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.wc-pred-guess-form input[type="number"] {
    width: 44px;
    height: 38px;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    border: 1.5px solid var(--wc-pred-border);
    border-radius: 8px;
    outline: none;
    -moz-appearance: textfield;
    transition: var(--wc-pred-transition);
}

.wc-pred-guess-form input[type="number"]::-webkit-outer-spin-button,
.wc-pred-guess-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wc-pred-guess-form input[type="number"]:focus {
    border-color: var(--wc-pred-primary);
    background: #ffffff;
}

.score-separator {
    color: var(--wc-pred-text-muted);
    font-weight: bold;
    font-size: 14px;
}

.wc-pred-save-guess-btn {
    background: var(--wc-pred-secondary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wc-pred-transition);
    outline: none;
}

.wc-pred-save-guess-btn:hover {
    background: #0f766e;
    transform: scale(1.08);
}

.wc-pred-save-guess-btn.update {
    background: var(--wc-pred-primary);
}

.wc-pred-save-guess-btn.update:hover {
    background: #166534;
}

.wc-pred-locked-scores {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.wc-pred-locked-scores .score-box {
    background: #cbd5e1;
    color: #334155;
    font-weight: 800;
    font-size: 15px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.wc-pred-locked-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--wc-pred-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wc-pred-guess-status {
    font-size: 11px;
    margin-top: 12px;
    text-align: center;
    font-weight: 600;
    padding: 6px;
    border-radius: 6px;
}

.wc-pred-guess-status.success {
    background: var(--wc-pred-success-bg);
    color: #065f46;
}

.wc-pred-guess-status.warning {
    background: var(--wc-pred-warning-bg);
    color: #92400e;
}

/* Aba Classificação / Leaderboards */
.wc-pred-ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--wc-pred-bg-card);
    padding: 12px 16px;
    border-radius: var(--wc-pred-radius-medium);
    border: 1px solid var(--wc-pred-border);
}

.wc-pred-ranking-header label {
    font-weight: 700;
    font-size: 13px;
    color: var(--wc-pred-text-main);
}

.wc-pred-select-modern {
    padding: 8px 12px;
    border: 1.5px solid var(--wc-pred-border);
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    outline: none;
    color: var(--wc-pred-primary);
    cursor: pointer;
    background: #ffffff;
}

.wc-pred-select-modern:focus {
    border-color: var(--wc-pred-primary);
}

.wc-pred-table-wrapper {
    overflow-x: auto;
}

.wc-pred-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.wc-pred-table th {
    color: var(--wc-pred-text-muted);
    font-weight: 700;
    padding: 12px 8px;
    border-bottom: 1.5px solid var(--wc-pred-border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wc-pred-table td {
    padding: 14px 8px;
    border-bottom: 1px solid var(--wc-pred-border);
    vertical-align: middle;
}

.wc-pred-table tr.current-user {
    background: var(--wc-pred-primary-light);
}

.col-pos {
    width: 15%;
    text-align: center;
}

.col-user {
    width: 55%;
    font-weight: 600;
}

.user-display-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.me-label {
    background: var(--wc-pred-primary);
    color: #ffffff;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 800;
}

.col-guesses {
    width: 15%;
    text-align: center;
    color: var(--wc-pred-text-muted);
}

.col-pts {
    width: 15%;
    text-align: right;
    padding-right: 12px !important;
}

.wc-pred-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 11px;
    color: var(--wc-pred-text-main);
    background: #e2e8f0;
}

.wc-pred-badge.podium-1 {
    background: #fef08a;
    color: #854d0e;
    box-shadow: 0 2px 4px rgba(234, 179, 8, 0.2);
}

.wc-pred-badge.podium-2 {
    background: #e2e8f0;
    color: #475569;
}

.wc-pred-badge.podium-3 {
    background: #ffedd5;
    color: #c2410c;
}

/* Aba Histórico de Palpites */
.wc-pred-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wc-pred-history-item {
    background: var(--wc-pred-bg-card);
    border: 1px solid var(--wc-pred-border);
    border-radius: var(--wc-pred-radius-medium);
    padding: 12px 16px;
}

.wc-pred-history-item.finished {
    border-left: 4px solid var(--wc-pred-border);
}

.wc-pred-history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wc-pred-tag-phase.mini {
    font-size: 9px;
    padding: 2px 6px;
}

.wc-pred-history-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-left, .team-right {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 38%;
}

.team-right {
    justify-content: flex-end;
}

.team-name-short {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wc-pred-flag.mini {
    width: 24px;
    height: 16px;
}

.history-score-display {
    width: 24%;
    text-align: center;
}

.guess-score {
    font-size: 11px;
    color: var(--wc-pred-text-muted);
}

.guess-score strong {
    font-size: 13px;
    color: var(--wc-pred-text-main);
}

.real-score {
    font-size: 10px;
    font-weight: 700;
    margin-top: 2px;
}

.real-score.scheduled {
    color: var(--wc-pred-text-muted);
    background: #cbd5e1;
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 8px;
}

.color-real {
    color: var(--wc-pred-success);
}

.wc-pred-history-points {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
}

.wc-pred-history-points.gained {
    background: var(--wc-pred-success-bg);
    color: #065f46;
}

.wc-pred-history-points.zero {
    background: var(--wc-pred-danger-bg);
    color: #991b1b;
}

/* Spinner e Estados de Carregamento */
.wc-pred-loading {
    text-align: center;
    padding: 40px;
    color: var(--wc-pred-text-muted);
    font-weight: 600;
    font-size: 14px;
}

.wc-pred-loading::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    margin: 12px auto 0;
    border: 3px solid rgba(0,0,0,0.1);
    border-left-color: var(--wc-pred-primary);
    border-radius: 50%;
    animation: wc-spin 0.8s linear infinite;
}

@keyframes wc-spin {
    to { transform: rotate(360deg); }
}

.wc-pred-loading-spinner {
    border: 2px solid rgba(255,255,255,0.2);
    border-left-color: #ffffff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: wc-spin 0.8s linear infinite;
    display: inline-block;
}

/* Toast */
.wc-pred-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0f172a;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 999999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    width: 90%;
    max-width: 350px;
}

.wc-pred-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.wc-pred-toast.success {
    background: #0f172a;
}

.wc-pred-toast.error {
    background: #ef4444;
}

/* Inserção automática container styling */
.wp-wc-pred-auto-container {
    margin-top: 40px;
    border-top: 1px solid var(--wc-pred-border);
    padding-top: 20px;
}

/* Estilos da caixa de login integrada */
.wc-pred-auth-container.inline-auth {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 2px dashed #86efac;
    border-radius: var(--wc-pred-radius-medium);
    padding: 24px;
    margin-top: 10px;
}

.wc-pred-auth-container.inline-auth .wc-pred-auth-card {
    max-width: 100%;
}
