/**
 * BTFC Match Cards Widget Styles
 * Clean, modern design matching the match card layout
 */

.btfc-match-cards-widget {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 100%;
    margin: 10px 0;
}

.btfc-match-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btfc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btfc-team-label,
.btfc-card-type {
    font-size: 12px;
    color: #666666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btfc-teams-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.btfc-team-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btfc-team-crest {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.btfc-team-name {
    font-size: 16px;
    font-weight: 700;
    color: #333333;
    flex: 1;
    line-height: 1.2;
}

.btfc-match-score {
    font-size: 24px;
    font-weight: 700;
    color: #2D398C;
    margin-left: auto;
}

.btfc-match-time {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666666;
}

.btfc-match-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 15px;
}

.btfc-competition {
    font-size: 14px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 2px;
}

.btfc-match-date,
.btfc-venue {
    font-size: 13px;
    color: #333333 !important;
    font-weight: 500;
}

/* Ensure date text is black with higher specificity */
.btfc-match-cards-widget .btfc-match-date,
.btfc-match-cards-widget .btfc-venue,
.btfc-match-card .btfc-match-date,
.btfc-match-card .btfc-venue {
    color: #333333 !important;
}

.btfc-match-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.btfc-match-centre-button {
    text-align: center;
}

.btfc-match-centre-button a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #2D398C;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btfc-match-centre-button a:hover {
    background-color: #2D398C;
    color: #ffffff;
    border-color: #2D398C;
}

.btfc-buy-tickets-button {
    text-align: center;
}

.btfc-buy-tickets-button a {
    display: inline-block !important;
    padding: 6px 8px !important;
    background-color: #2D398C;
    color: #ffffff;
    text-decoration: none;
    font-size: 12px !important;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: auto !important;
    min-width: unset !important;
    max-width: none !important;
    text-align: center;
}

/* More specific selector to override any other styles */
.btfc-match-cards-widget .btfc-buy-tickets-button a {
    padding: 6px 8px !important;
    width: auto !important;
    min-width: unset !important;
    font-size: 12px !important;
}

.btfc-buy-tickets-button a:hover {
    background-color: #1e2a5e;
    color: #ffffff;
}

.btfc-travel-info-button {
    text-align: center;
}

.btfc-travel-info-button a {
    display: inline-block !important;
    padding: 6px 8px !important;
    background-color: #666666;
    color: #ffffff;
    text-decoration: none;
    font-size: 12px !important;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: auto !important;
    min-width: unset !important;
    max-width: none !important;
    text-align: center;
}

.btfc-travel-info-button a:hover {
    background-color: #555555;
    color: #ffffff;
}

/* More specific selector to override any other styles */
.btfc-match-cards-widget .btfc-travel-info-button a {
    padding: 6px 8px !important;
    width: auto !important;
    min-width: unset !important;
    font-size: 12px !important;
}

/* Next Match specific styles */
.btfc-next-match {
    border-left: 4px solid #4CAF50;
}

/* Latest Result specific styles */
.btfc-latest-result {
    border-left: 4px solid #FF9800;
}

/* Responsive design */
@media (max-width: 768px) {
    .btfc-match-cards-widget {
        gap: 15px;
    }
    
    .btfc-match-card {
        padding: 15px;
    }
    
    .btfc-team-name {
        font-size: 14px;
    }
    
    .btfc-match-score {
        font-size: 20px;
    }
    
    .btfc-match-buttons {
        gap: 6px;
    }
    
    .btfc-team-row {
        gap: 10px;
    }
    
    .btfc-team-crest {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .btfc-match-card {
        padding: 12px;
    }
    
    .btfc-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 12px;
    }
    
    .btfc-team-label,
    .btfc-card-type {
        font-size: 11px;
    }
    
    .btfc-team-name {
        font-size: 13px;
    }
    
    .btfc-match-score {
        font-size: 18px;
    }
    
    .btfc-competition {
        font-size: 13px;
    }
    
    .btfc-match-date,
    .btfc-venue {
        font-size: 12px;
    }
}

/* Error state */
.btfc-widget-error {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    text-align: center;
}

/* No matches state */
.btfc-no-matches {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    text-align: center;
}

/* Loading state */
.btfc-match-cards-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btfc-match-cards-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2D398C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tabbed Match Widget Styles */
.btfc-tabbed-match-widget {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 100%;
}

.btfc-main-match {
    /* Main match card inherits existing styles */
}

.btfc-main-match-content {
    /* Content wrapper for main match in tabs */
}

.btfc-tab-navigation {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    margin: 0;
}

.btfc-tab-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 600;
    color: #666666;
    text-decoration: none;
}

.btfc-tab-button:hover {
    background: #e9ecef;
    color: #333333;
}

.btfc-tab-button.active {
    background: #2D398C;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(45, 57, 140, 0.2);
}

.btfc-tab-button .tab-icon {
    font-size: 14px;
    line-height: 1;
}

.btfc-tab-button .tab-text {
    font-size: 12px;
    font-weight: 600;
}

.btfc-tab-content {
    position: relative;
    min-height: 200px;
}

.btfc-tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.btfc-tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btfc-matches-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Compact Match Card Styles */
.btfc-compact-match-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.btfc-compact-match-card:hover {
    border-color: #2D398C;
    box-shadow: 0 2px 8px rgba(45, 57, 140, 0.1);
    transform: translateY(-1px);
}

.btfc-compact-teams {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.btfc-compact-team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btfc-compact-crest {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.btfc-compact-team-name {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btfc-compact-score {
    font-size: 16px;
    font-weight: 700;
    color: #2D398C;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

.btfc-compact-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 80px;
    text-align: right;
}

.btfc-compact-competition {
    font-size: 11px;
    font-weight: 600;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btfc-compact-date {
    font-size: 11px;
    color: #666666;
    font-weight: 500;
}

.btfc-compact-time {
    margin-left: 4px;
    font-size: 10px;
    color: #888888;
}

.btfc-compact-venue {
    font-size: 10px;
    color: #888888;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btfc-compact-link {
    flex-shrink: 0;
}

.btfc-compact-button {
    display: inline-block;
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #2D398C;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.btfc-compact-button:hover {
    background: #2D398C;
    color: #ffffff;
    border-color: #2D398C;
}

/* Responsive adjustments for tabs */
@media (max-width: 768px) {
    .btfc-tab-navigation {
        padding: 3px;
        gap: 3px;
    }
    
    .btfc-tab-button {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .btfc-tab-button .tab-text {
        font-size: 11px;
    }
    
    .btfc-compact-match-card {
        padding: 10px;
        gap: 10px;
    }
    
    .btfc-compact-crest {
        width: 18px;
        height: 18px;
    }
    
    .btfc-compact-team-name {
        font-size: 12px;
    }
    
    .btfc-compact-score {
        font-size: 14px;
    }
    
    .btfc-compact-details {
        min-width: 70px;
    }
    
    .btfc-compact-competition {
        font-size: 10px;
    }
    
    .btfc-compact-date {
        font-size: 10px;
    }
    
    .btfc-compact-venue {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .btfc-tab-button {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .btfc-tab-button .tab-icon {
        font-size: 12px;
    }
    
    .btfc-tab-button .tab-text {
        font-size: 10px;
    }
    
    .btfc-compact-match-card {
        padding: 8px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .btfc-compact-teams {
        gap: 4px;
    }
    
    .btfc-compact-details {
        text-align: left;
        min-width: auto;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .btfc-compact-link {
        align-self: center;
        margin-top: 4px;
    }
}

/* Upcoming Games Table Styles */
.btfc-upcoming-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
}

.btfc-upcoming-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 400px;
}

.btfc-upcoming-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.btfc-upcoming-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #333333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #e0e0e0;
}

.btfc-upcoming-table th:last-child {
    border-right: none;
}

.btfc-upcoming-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    vertical-align: middle;
}

.btfc-upcoming-table td:last-child {
    border-right: none;
}

.btfc-upcoming-row:hover {
    background: #f8f9fa;
}

.btfc-upcoming-row:last-child td {
    border-bottom: none;
}

/* Date Column */
.btfc-table-date {
    width: 60px;
    text-align: center;
}

.btfc-date-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.btfc-date-day {
    font-size: 16px;
    font-weight: 700;
    color: #2D398C;
    line-height: 1;
}

.btfc-date-month {
    font-size: 10px;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Time Column */
.btfc-table-time {
    width: 50px;
    text-align: center;
}

.btfc-time-text {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
}

/* Opponent Column */
.btfc-table-opponent {
    min-width: 120px;
    max-width: 120px;
}

.btfc-opponent-name {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Home/Away Column */
.btfc-table-home-away {
    width: 50px;
    text-align: center;
}

.btfc-home-away-badge {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btfc-home-away-badge.home {
    background: #28a745;
}

.btfc-home-away-badge.away {
    background: #dc3545;
}

/* Actions Column */
.btfc-table-actions {
    width: 120px;
    text-align: center;
}

.btfc-table-button {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #2D398C;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btfc-table-button:hover {
    background: #2D398C;
    color: #ffffff;
    border-color: #2D398C;
}

.btfc-tickets-button {
    background: #28a745;
    color: #ffffff;
    border-color: #28a745;
}

.btfc-tickets-button:hover {
    background: #218838;
    border-color: #218838;
}

.btfc-travel-button {
    background: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.btfc-travel-button:hover {
    background: #5a6268;
    border-color: #5a6268;
}

/* Responsive adjustments for table */
@media (max-width: 768px) {
    .btfc-upcoming-table {
        min-width: 350px;
        font-size: 12px;
    }
    
    .btfc-upcoming-table th,
    .btfc-upcoming-table td {
        padding: 8px 6px;
    }
    
    .btfc-date-day {
        font-size: 14px;
    }
    
    .btfc-date-month {
        font-size: 9px;
    }
    
    .btfc-time-text {
        font-size: 12px;
    }
    
    .btfc-opponent-name {
        font-size: 12px;
    }
    
    .btfc-home-away-badge {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .btfc-table-button {
        padding: 3px 6px;
        font-size: 9px;
        margin: 1px;
    }
}

@media (max-width: 480px) {
    .btfc-upcoming-table {
        min-width: 320px;
    }
    
    .btfc-upcoming-table th,
    .btfc-upcoming-table td {
        padding: 6px 4px;
    }
    
    .btfc-table-opponent {
        min-width: 100px;
        max-width: 100px;
    }
    
    .btfc-table-home-away {
        width: 40px;
    }
    
    .btfc-table-actions {
        width: 100px;
    }
    
    .btfc-opponent-name {
        font-size: 11px;
    }
    
    .btfc-home-away-badge {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
}

/* Results Table Styles */
.btfc-results-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
}

.btfc-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 400px;
}

.btfc-results-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.btfc-results-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #333333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #e0e0e0;
}

.btfc-results-table th:last-child {
    border-right: none;
}

.btfc-results-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    vertical-align: middle;
}

.btfc-results-table td:last-child {
    border-right: none;
}

.btfc-result-row:hover {
    background: #f8f9fa;
}

.btfc-result-row:last-child td {
    border-bottom: none;
}

/* Score Column */
.btfc-table-score {
    width: 80px;
    text-align: center;
}

.btfc-score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btfc-home-score,
.btfc-away-score {
    font-size: 16px;
    font-weight: 700;
    color: #2D398C;
    min-width: 20px;
    text-align: center;
}

.btfc-score-separator {
    font-size: 14px;
    font-weight: 600;
    color: #666666;
}

/* Responsive adjustments for results table */
@media (max-width: 768px) {
    .btfc-results-table {
        min-width: 350px;
        font-size: 12px;
    }
    
    .btfc-results-table th,
    .btfc-results-table td {
        padding: 8px 6px;
    }
    
    .btfc-home-score,
    .btfc-away-score {
        font-size: 14px;
    }
    
    .btfc-score-separator {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .btfc-results-table {
        min-width: 320px;
    }
    
    .btfc-results-table th,
    .btfc-results-table td {
        padding: 6px 4px;
    }
    
    .btfc-table-score {
        width: 70px;
    }
    
    .btfc-home-score,
    .btfc-away-score {
        font-size: 13px;
        min-width: 18px;
    }
    
    .btfc-score-separator {
        font-size: 11px;
    }
}