/**
 * Frontend styles for Football Data Plugin
 *
 * @package Football_Data_Plugin
 * @since 1.0.0
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.football-data-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
}

.football-data-container * {
    box-sizing: border-box;
}

/* ==========================================================================
   Standings Table
   ========================================================================== */

.football-data-standings {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

.football-data-standings-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.football-data-standings-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.football-data-standings-subtitle {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.football-data-standings-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.football-data-standings-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #dee2e6;
}

.football-data-standings-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.football-data-standings-table tbody tr:hover {
    background: #f8f9fa;
}

.football-data-standings-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.football-data-standings-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

/* Position column */
.football-data-standings-table .position {
    font-weight: 700;
    font-size: 16px;
    width: 50px;
}

.football-data-standings-table .position.top-4 {
    color: #28a745;
}

.football-data-standings-table .position.relegation {
    color: #dc3545;
}

/* Team column */
.football-data-standings-table .team {
    text-align: left;
    padding-left: 15px;
    font-weight: 500;
}

.football-data-standings-table .team-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 50%;
}

.football-data-standings-table .team-name {
    vertical-align: middle;
}

/* Points column */
.football-data-standings-table .points {
    font-weight: 700;
    font-size: 16px;
    color: #495057;
}

/* Form column */
.football-data-standings-table .form {
    font-size: 12px;
}

.football-data-standings-table .form-result {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    margin: 0 1px;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

.football-data-standings-table .form-result.w {
    background: #28a745;
}

.football-data-standings-table .form-result.d {
    background: #ffc107;
    color: #212529;
}

.football-data-standings-table .form-result.l {
    background: #dc3545;
}

/* ==========================================================================
   Matches List
   ========================================================================== */

.football-data-matches {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

.football-data-matches-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.football-data-matches-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.football-data-matches-subtitle {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Round header styles */
.football-data-round-header {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 10px 20px;
    margin: 20px 0 10px 0;
}

.football-data-round-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    text-align: center;
}

.football-data-match {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
    position: relative;
}

.football-data-match:hover {
    background: #f8f9fa;
}

.football-data-match:last-child {
    border-bottom: none;
}

/* Live match pulsating background */
.football-data-match.live-match {
    background: rgba(255, 193, 7, 0.1);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0% {
        background: rgba(255, 193, 7, 0.1);
    }
    50% {
        background: rgba(255, 193, 7, 0.2);
    }
    100% {
        background: rgba(255, 193, 7, 0.1);
    }
}

.football-data-match-teams {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.football-data-match-team {
    display: flex;
    align-items: center;
    flex: 1;
}

.football-data-match-team.away {
    justify-content: flex-end;
}

.football-data-match-team-logo {
    width: 32px;
    height: 32px;
    margin: 0 10px;
    border-radius: 50%;
}

.football-data-match-team-name {
    font-weight: 500;
    font-size: 14px;
}

.football-data-match-vs {
    margin: 0 15px;
    font-weight: 600;
    color: #6c757d;
    font-size: 12px;
}

/* Match datetime styles */
.football-data-match-datetime {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 20px;
    min-width: 80px;
}

.football-data-match-datetime .football-data-match-date {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.football-data-match-datetime .football-data-match-time {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

/* Match result styles */
.football-data-match-result {
    margin: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-score {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.match-score.live-score {
    color: #dc3545;
    font-weight: 700;
}

.match-vs {
    font-weight: 600;
    color: #6c757d;
}

.football-data-match-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.football-data-match-status {
    margin-bottom: 5px;
}

.football-data-match-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
}

.football-data-match-time {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.football-data-match-venue {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.football-data-match-countdown {
    font-size: 12px;
    color: #dc3545;
    font-weight: 600;
    margin-top: 2px;
}

/* ==========================================================================
   Team Card
   ========================================================================== */

.football-data-team {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

.football-data-team-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.football-data-team-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.football-data-team-name {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.football-data-team-league {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.football-data-team-stats {
    padding: 20px;
}

.football-data-team-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.football-data-team-stat {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.football-data-team-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #495057;
    margin-bottom: 5px;
}

.football-data-team-stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Predictions Widget
   ========================================================================== */

.football-data-predictions {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

.football-data-predictions-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.football-data-predictions-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.football-data-predictions-subtitle {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.football-data-prediction {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    transition: background 0.2s ease;
}

.football-data-prediction:hover {
    background: #f8f9fa;
}

.football-data-prediction:last-child {
    border-bottom: none;
}

.football-data-prediction-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.football-data-prediction-teams {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.football-data-prediction-team {
    font-weight: 500;
    font-size: 14px;
}

.football-data-prediction-vs {
    margin: 0 15px;
    color: #6c757d;
    font-size: 12px;
}

.football-data-prediction-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6c757d;
}

.football-data-prediction-confidence {
    display: flex;
    align-items: center;
}

.football-data-prediction-confidence-bar {
    width: 60px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-right: 8px;
    overflow: hidden;
}

.football-data-prediction-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transition: width 0.3s ease;
}

.football-data-prediction-confidence-score {
    font-weight: 600;
    color: #495057;
}

/* ==========================================================================
   Dark Theme
   ========================================================================== */

.football-data-container.theme-dark {
    color: #e9ecef;
}

.football-data-container.theme-dark .football-data-standings,
.football-data-container.theme-dark .football-data-matches,
.football-data-container.theme-dark .football-data-team,
.football-data-container.theme-dark .football-data-predictions {
    background: #343a40;
    color: #e9ecef;
}

.football-data-container.theme-dark .football-data-standings-table th {
    background: #495057;
    color: #e9ecef;
    border-bottom-color: #6c757d;
}

.football-data-container.theme-dark .football-data-standings-table td {
    border-bottom-color: #6c757d;
}

.football-data-container.theme-dark .football-data-standings-table tbody tr:hover {
    background: #495057;
}

.football-data-container.theme-dark .football-data-standings-table tbody tr:nth-child(even) {
    background: #3d4449;
}

.football-data-container.theme-dark .football-data-standings-table tbody tr:nth-child(even):hover {
    background: #495057;
}

.football-data-container.theme-dark .football-data-match {
    border-bottom-color: #6c757d;
}

.football-data-container.theme-dark .football-data-match:hover {
    background: #495057;
}

.football-data-container.theme-dark .football-data-team-stat {
    background: #495057;
}

.football-data-container.theme-dark .football-data-prediction {
    border-bottom-color: #6c757d;
}

.football-data-container.theme-dark .football-data-prediction:hover {
    background: #495057;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .football-data-standings-table {
        font-size: 12px;
    }
    
    .football-data-standings-table th,
    .football-data-standings-table td {
        padding: 8px 4px;
    }
    
    .football-data-standings-table .team {
        padding-left: 8px;
    }
    
    .football-data-standings-table .team-logo {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }
    
    .football-data-match {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }
    
    .football-data-match-teams {
        margin-bottom: 10px;
    }
    
    .football-data-match-info {
        min-width: auto;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .football-data-team-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .football-data-prediction-match {
        flex-direction: column;
        align-items: stretch;
    }
    
    .football-data-prediction-teams {
        margin-bottom: 10px;
    }
    
    .football-data-prediction-details {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .football-data-standings-header,
    .football-data-matches-header,
    .football-data-team-header,
    .football-data-predictions-header {
        padding: 15px;
    }
    
    .football-data-standings-title,
    .football-data-matches-title,
    .football-data-team-name,
    .football-data-predictions-title {
        font-size: 20px;
    }
    
    .football-data-team-logo {
        width: 60px;
        height: 60px;
    }
    
    .football-data-team-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.football-data-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.football-data-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: football-data-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes football-data-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Error States
   ========================================================================== */

.football-data-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    text-align: center;
}

.football-data-pro-only {
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    margin: 20px 0;
    text-align: center;
}

/* ==========================================================================
   Branding
   ========================================================================== */

.football-data-branding {
    text-align: center;
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 11px;
    color: #6c757d;
}

.football-data-branding a {
    color: #007cba;
    text-decoration: none;
}

.football-data-branding a:hover {
    text-decoration: underline;
}

.football-data-container.theme-dark .football-data-branding {
    background: #495057;
    border-top-color: #6c757d;
    color: #adb5bd;
}

.football-data-container.theme-dark .football-data-branding a {
    color: #17a2b8;
}

/* ==========================================================================
   Custom Colors (PRO Feature)
   ========================================================================== */

.football-data-container.custom-colors .football-data-standings-header,
.football-data-container.custom-colors .football-data-matches-header,
.football-data-container.custom-colors .football-data-team-header,
.football-data-container.custom-colors .football-data-predictions-header {
    background: var(--football-data-primary-color, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
}

.football-data-container.custom-colors .football-data-standings-table .position.top-4 {
    color: var(--football-data-success-color, #28a745);
}

.football-data-container.custom-colors .football-data-standings-table .position.relegation {
    color: var(--football-data-danger-color, #dc3545);
}

.football-data-container.custom-colors .football-data-standings-table .points {
    color: var(--football-data-accent-color, #495057);
}
