/**
 * FootBet - Estilos de Predicciones
 * Diseño visual para mostrar predicciones con datos estructurados
 */

/* ===========================================
   CSS VARIABLES (Theme Integration)
   =========================================== */

:root {
    /* Plugin variables - use theme variables if available, otherwise fallback to defaults */
    --fb-primary: var(--primary, #1a7ee6);
    --fb-secondary: var(--secondary, #0f172a);
    --fb-accent-green: var(--accent-green, #10b981);
    --fb-accent-orange: var(--accent-orange, #f97316);
    --fb-accent-red: var(--accent-red, #ef4444);
    --fb-accent-yellow: var(--accent-yellow, #eab308);
    --fb-bg-light: var(--bg-light, #f8fafc);
    --fb-bg-gray: var(--bg-gray, #f1f5f9);
}

/* ===========================================
   WRAPPER PRINCIPAL
   =========================================== */
.fb-prediction-wrapper {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
}

.fb-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    color: #1f2937;
}

/* ===========================================
   HEADER DEL PARTIDO
   =========================================== */
.fb-match-header {
    background: var(--fb-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
    text-align: center;
}

.fb-league-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fb-league-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.fb-league-name {
    font-size: 0.875rem;
    opacity: 0.9;
}

.fb-teams-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.fb-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.fb-team-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    padding: 10px;
}

.fb-team-name {
    font-size: 1.125rem;
    font-weight: 600;
}

.fb-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 100px;
}

.fb-vs-text {
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0.7;
}

.fb-match-date {
    font-size: 0.875rem;
    opacity: 0.9;
}

.fb-venue {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===========================================
   CAJA DE PREDICCION PRINCIPAL
   =========================================== */
.fb-prediction-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fb-winner-prediction {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 8px;
    border-left: 4px solid #22c55e;
}

.fb-winner-label {
    font-weight: 500;
    color: #666;
}

.fb-winner-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #166534;
}

.fb-confidence {
    background: #22c55e;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Barras de probabilidad */
.fb-probabilities {
    margin-top: 1rem;
}

.fb-prob-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #374151;
}

.fb-prob-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.fb-prob-label {
    min-width: 100px;
    font-size: 0.875rem;
    color: #6b7280;
}

.fb-prob-bar {
    flex: 1;
    height: 24px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.fb-prob-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.fb-prob-fill.fb-home {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.fb-prob-fill.fb-draw {
    background: linear-gradient(90deg, #6b7280, #9ca3af);
}

.fb-prob-fill.fb-away {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.fb-prob-value {
    min-width: 45px;
    font-weight: 600;
    text-align: right;
    color: #374151;
}

/* Caja de consejo */
.fb-advice-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.fb-advice-icon {
    font-size: 1.5rem;
}

.fb-advice-text {
    font-weight: 500;
    color: #92400e;
}

/* ===========================================
   TIPS DE APUESTA
   =========================================== */
.fb-betting-tips {
    margin-bottom: 1.5rem;
}

.fb-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.fb-tip-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fb-tip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fb-tip-type {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.fb-tip-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.fb-tip-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #3b82f6;
    color: #fff;
    margin-bottom: 0.25rem;
}

.fb-tip-badge.fb-secondary {
    background: #8b5cf6;
}

.fb-tip-badge.fb-tertiary {
    background: #f59e0b;
}

/* ===========================================
   CONTENIDO DE ANALISIS
   =========================================== */
.fb-analysis-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.fb-analysis-content h3,
.fb-analysis-content h4 {
    color: #1f2937;
    margin-top: 1.5rem;
}

.fb-analysis-content h3:first-child {
    margin-top: 0;
}

.fb-analysis-content p {
    line-height: 1.7;
    color: #4b5563;
}

.fb-analysis-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.fb-analysis-content li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

/* ===========================================
   ESTADISTICAS
   =========================================== */
.fb-stats-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.fb-stats-comparison {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fb-stats-header {
    display: grid;
    grid-template-columns: 1fr 120px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 8px;
    font-weight: 600;
}

.fb-stat-team-name {
    text-align: center;
    font-size: 0.875rem;
    color: #374151;
}

.fb-stats-row {
    display: grid;
    grid-template-columns: 1fr 120px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.fb-stats-row:last-child {
    border-bottom: none;
}

.fb-stat-value {
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}

.fb-stat-label {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.fb-stat-better {
    color: #22c55e;
}

.fb-stat-worse {
    color: #ef4444;
}

/* ===========================================
   HEAD TO HEAD
   =========================================== */
.fb-h2h-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.fb-h2h-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fb-h2h-match {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.fb-h2h-date {
    min-width: 80px;
    font-size: 0.75rem;
    color: #6b7280;
}

.fb-h2h-teams {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.fb-h2h-home,
.fb-h2h-away {
    flex: 1;
    font-size: 0.875rem;
}

.fb-h2h-home {
    text-align: right;
}

.fb-h2h-away {
    text-align: left;
}

.fb-h2h-score {
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    background: #1f2937;
    color: #fff;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* ===========================================
   FORMA RECIENTE
   =========================================== */
.fb-form-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.fb-form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fb-form-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.fb-form-team-name {
    font-weight: 600;
    color: #374151;
}

.fb-form-badges {
    display: flex;
    gap: 0.25rem;
}

.fb-form-badge {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.fb-form-win {
    background: #22c55e;
}

.fb-form-draw {
    background: #6b7280;
}

.fb-form-loss {
    background: #ef4444;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
/* ===========================================
   SECTION TITLE STYLE (NO H TAG - SEO)
   =========================================== */
.fb-section-title-style {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    color: #1f2937;
}

/* ===========================================
   BET BUTTONS IN PREDICTIONS
   =========================================== */
.fb-winner-prediction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.fb-winner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
}

.fb-advice-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.fb-advice-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

/* Main bet button style - with high specificity to override theme */
.fb-prediction-wrapper .fb-prediction-bet-btn,
.fb-prediction-wrapper a.fb-prediction-bet-btn,
a.fb-prediction-bet-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem !important;
    border-radius: 6px !important;
    background: #10b981 !important;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease !important;
    white-space: nowrap;
    border: none !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3) !important;
    min-width: 100px;
    text-align: center;
}

.fb-prediction-wrapper .fb-prediction-bet-btn:hover,
.fb-prediction-wrapper a.fb-prediction-bet-btn:hover,
a.fb-prediction-bet-btn:hover {
    background: #059669 !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4) !important;
}

.fb-prediction-wrapper .fb-prediction-bet-btn:visited,
.fb-prediction-wrapper a.fb-prediction-bet-btn:visited,
a.fb-prediction-bet-btn:visited {
    color: #fff !important;
}

/* ===========================================
   BET BUTTONS IN TIP CARDS
   =========================================== */
.fb-tip-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* Tip card bet button - with high specificity to override theme */
.fb-prediction-wrapper .fb-tip-bet-btn,
.fb-prediction-wrapper a.fb-tip-bet-btn,
.fb-tip-card .fb-tip-bet-btn,
.fb-tip-card a.fb-tip-bet-btn,
a.fb-tip-bet-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-top: 0.75rem !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 6px !important;
    background: #10b981 !important;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease !important;
    white-space: nowrap;
    border: none !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3) !important;
}

.fb-prediction-wrapper .fb-tip-bet-btn:hover,
.fb-prediction-wrapper a.fb-tip-bet-btn:hover,
.fb-tip-card .fb-tip-bet-btn:hover,
.fb-tip-card a.fb-tip-bet-btn:hover,
a.fb-tip-bet-btn:hover {
    background: #059669 !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4) !important;
}

.fb-prediction-wrapper .fb-tip-bet-btn:visited,
.fb-prediction-wrapper a.fb-tip-bet-btn:visited,
.fb-tip-card .fb-tip-bet-btn:visited,
.fb-tip-card a.fb-tip-bet-btn:visited,
a.fb-tip-bet-btn:visited {
    color: #fff !important;
}

.fb-tip-odds {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fb-accent-green);
    margin-bottom: 0.5rem;
}

/* Tip badge variants */
.fb-tip-badge.fb-badge-pick {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.fb-tip-badge.fb-badge-btts {
    background: #8b5cf6;
}

.fb-tip-badge.fb-badge-goals {
    background: #06b6d4;
}

.fb-tip-badge.fb-badge-winner {
    background: #3b82f6;
}

/* Created tips have slightly different style */
.fb-tip-card-created {
    border-color: var(--fb-accent-green);
    border-width: 2px;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    .fb-teams-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .fb-team {
        flex-direction: row;
    }

    .fb-team-logo {
        width: 60px;
        height: 60px;
    }

    .fb-vs {
        flex-direction: row;
        gap: 0.75rem;
    }

    .fb-vs-text {
        font-size: 1.25rem;
    }

    .fb-prob-label {
        min-width: 70px;
        font-size: 0.75rem;
    }

    .fb-stats-header,
    .fb-stats-row {
        grid-template-columns: 1fr 80px 1fr;
    }

    .fb-h2h-match {
        flex-direction: column;
        text-align: center;
    }

    .fb-h2h-teams {
        flex-direction: column;
    }

    .fb-h2h-home,
    .fb-h2h-away {
        text-align: center;
    }

    .fb-form-team {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .fb-winner-prediction,
    .fb-advice-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .fb-prediction-bet-btn {
        width: 100%;
        text-align: center;
    }

    .fb-injuries-container,
    .fb-lineups-container {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   LEAGUE POSITION BADGE
   =========================================== */
.fb-team-position {
    display: inline-block;
    background: var(--fb-bg-gray);
    color: #666;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

/* ===========================================
   INJURIES / SUSPENSIONS
   =========================================== */
.fb-injuries-section {
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.fb-injuries-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.fb-injuries-team-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--fb-bg-gray);
}

.fb-injuries-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fb-injury-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #f0f0f0;
}

.fb-injury-item:last-child {
    border-bottom: none;
}

.fb-injury-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.fb-injury-player {
    font-weight: 600;
    color: #333;
}

.fb-injury-reason {
    color: #888;
    font-size: 0.8rem;
}

.fb-no-injuries {
    color: var(--fb-accent-green);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
}

/* ===========================================
   PROBABLE LINEUPS
   =========================================== */
.fb-lineups-section {
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.fb-lineups-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.fb-lineup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--fb-bg-gray);
}

.fb-lineup-team-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.fb-lineup-formation {
    background: var(--fb-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.fb-lineup-players {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fb-lineup-player {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--fb-bg-light);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    border-left: 3px solid #ccc;
}

.fb-lineup-player.fb-pos-gk { border-left-color: var(--fb-accent-orange); }
.fb-lineup-player.fb-pos-def { border-left-color: var(--fb-primary); }
.fb-lineup-player.fb-pos-mid { border-left-color: var(--fb-accent-green); }
.fb-lineup-player.fb-pos-fwd { border-left-color: var(--fb-accent-red); }

.fb-player-number {
    font-weight: 700;
    color: #666;
    font-size: 0.75rem;
}

.fb-lineup-coach {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}
