/* Football Tables Frontend CSS */

/* Staged Table Styling */
.staged-table-container {
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.stage-tabs-header {
    display: flex;
    background: #343a40;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #495057;
}

.stage-tab-btn {
    flex: 1;
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
    font-size: 0.9rem;
    border-right: 1px solid #495057;
}

.stage-tab-btn:last-child {
    border-right: none;
}

.stage-tab-btn:hover {
    background: #5a6268;
}

.stage-tab-btn.active {
    background: #007bff;
    color: #fff;
    font-weight: 500;
}

.stage-tabs-row td {
    border-bottom: none !important;
}

.table-headers th {
    border-top: none !important;
}

.stage-content {
    transition: opacity 0.3s ease;
}

/* Season Selector Styling */

.season-selector-wrapper .form-select {
    border: 1px solid #d0d7de;
    border-radius: 0.375rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    line-height: 1.2;
}

.season-selector-wrapper .form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.season-selector-wrapper .form-select:hover {
    border-color: #86b7fe;
}

.entry-title {
    margin-bottom: 0.5rem;
}

/* Remove only unwanted bottom lines and separators while preserving content styling */
.af-single-article {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

.af-single-article:last-child {
    border-bottom: none !important;
}

/* Remove any separator lines and pseudo-elements that create bottom lines */
.af-single-article:after,
.entry-content-wrap:after,
.entry-content:after {
    display: none !important;
    content: none !important;
}

/* Clean spacing between articles */
.af-single-article + .af-single-article {
    margin-top: 0 !important;
    border-top: none !important;
}

/* Target specific containers that might have bottom borders */
.site-main {
    border-bottom: none !important;
}

.site-main:after {
    display: none !important;
    content: none !important;
}

#primary {
    border-bottom: none !important;
}

#primary:after {
    display: none !important;
    content: none !important;
}

.content-area {
    border-bottom: none !important;
}

.content-area:after {
    display: none !important;
    content: none !important;
}

/* Remove any bottom borders from the main content container */
#main {
    border-bottom: none !important;
}

#main:after {
    display: none !important;
    content: none !important;
}

/* Target the section block that might have a bottom border */
.section-block-upper {
    border-bottom: none !important;
}

.section-block-upper:after {
    display: none !important;
    content: none !important;
}

/* Blanket rule to remove any remaining bottom borders in content area */
#primary *,
.content-area *,
.site-main *,
#main * {
    border-bottom: none !important;
}

#primary *:after,
.content-area *:after,
.site-main *:after,
#main *:after {
    display: none !important;
    content: none !important;
}

/* Special targeting for potential parent theme elements */
div[class*="entry"],
div[class*="article"],
div[class*="content"],
div[class*="post"] {
    border-bottom: none !important;
}

div[class*="entry"]:after,
div[class*="article"]:after,
div[class*="content"]:after,
div[class*="post"]:after {
    display: none !important;
    content: none !important;
}

/* Super aggressive approach - remove all borders and lines */
* {
    border-bottom: none !important;
}

*:after,
*:before {
    border-bottom: none !important;
}

/* Target any potential HR elements or separators */
hr {
    display: none !important;
}

/* Remove any box shadows that might look like lines */
* {
    box-shadow: none !important;
}

/* Target specific theme elements that might create separators */
.site-content *,
.main-content *,
.primary-content * {
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Last 5 Results Styling - Override Bootstrap */
.league-table .badge.bg-success,
span.badge.bg-success {
    background-color: #28a745 !important; /* Enhanced green for Win */
    color: #ffffff !important;
    border: 1px solid #28a745 !important;
    min-width: 24px !important;
    text-align: center !important;
    display: inline-block !important;
}

.league-table .badge.bg-warning,
span.badge.bg-warning {
    background-color: #ffc107 !important; /* Enhanced orange for Draw */
    color: #212529 !important;
    border: 1px solid #ffc107 !important;
    min-width: 24px !important;
    text-align: center !important;
    display: inline-block !important;
}

.league-table .badge.bg-danger,
span.badge.bg-danger {
    background-color: #dc3545 !important; /* Enhanced red for Loss */
    color: #ffffff !important;
    border: 1px solid #dc3545 !important;
    min-width: 24px !important;
    text-align: center !important;
    display: inline-block !important;
}

.league-table .badge.bg-secondary,
span.badge.bg-secondary {
    background-color: #6c757d !important; /* Grey for no game played */
    color: #ffffff !important;
    border: 1px solid #6c757d !important;
    min-width: 24px !important;
    text-align: center !important;
    display: inline-block !important;
}

/* Last 5 Results Container for Consistent Width */
.last-5-container {
    display: inline-flex;
    align-items: center;
    min-width: 140px; /* Fixed width for 5 badges + spacing */
    justify-content: flex-start;
}

/* League Tables Styling */
.league-table {
    margin-bottom: 2rem;
}

.league-table h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.league-table .table {
    background-color: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.league-table .table thead th {
    background-color: #343a40;
    color: white;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    border: none;
    padding: 1rem 0.75rem;
}

.league-table .table tbody td {
    text-align: center;
    vertical-align: middle;
    padding: 0.75rem;
    border-color: #dee2e6;
}

.league-table .table tbody td:first-child,
.league-table .table tbody td:nth-child(2) {
    text-align: left;
}

.league-table .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Position styling */
.league-table .table tbody td:first-child {
    font-weight: bold;
    color: #495057;
}

/* Team name styling */
.league-table .table tbody td:nth-child(2) {
    font-weight: 500;
    color: #212529;
}

/* Points styling */
.league-table .table tbody td:nth-last-child(2) {
    font-weight: bold;
    color: #28a745;
}

/* Last 5 results styling */
.last-5-results .badge {
    font-size: 0.7rem;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 1px;
}

/* Goalscorers Table */
.goalscorers-table h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #28a745;
    padding-bottom: 0.5rem;
}

.goalscorers-table .table thead th {
    background-color: #28a745;
    color: white;
}

/* Matches Table */
.matches-table h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #17a2b8;
    padding-bottom: 0.5rem;
}

.matches-table .table thead th {
    background-color: #17a2b8;
    color: white;
}

.matches-table .table tbody td:nth-child(3) {
    font-weight: bold;
    color: #212529;
}

/* Enhanced Stage Tabs */
.stage-tabs {
    margin-bottom: 2rem;
}

.stage-tabs .nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.5rem;
}

.stage-tabs .nav-tabs .nav-item {
    margin-bottom: 0;
}

.stage-tabs .nav-tabs .nav-link {
    color: #495057;
    border: none;
    border-radius: 0.375rem;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    margin: 0 0.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: transparent;
}

.stage-tabs .nav-tabs .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.stage-tabs .nav-tabs .nav-link:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.stage-tabs .nav-tabs .nav-link:hover::before {
    left: 100%;
}

.stage-tabs .nav-tabs .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.stage-tabs .nav-tabs .nav-link.active::before {
    display: none;
}

.stage-tabs .tab-content {
    padding: 1.5rem;
    background: white;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.stage-tabs .tab-pane {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stage Tab Indicators */
.stage-tabs .nav-tabs .nav-link .stage-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.stage-tabs .nav-tabs .nav-link.active .stage-indicator {
    background: white;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

/* Season Selector */
.season-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.season-selector label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0;
}

.season-selector select {
    min-width: 120px;
}

/* Last Updated */
.last-updated {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}

/* Entry Content Styling */
.entry-content-wrap {
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.entry-content h2 {
    color: #333;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

.entry-content h2:first-child {
    margin-top: 0;
}

/* Responsive Tables */
.table-responsive {
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .league-table .table thead th,
    .league-table .table tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
    
    .season-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .season-selector select {
        min-width: 100px;
    }
    
    .entry-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .last-5-results .badge {
        font-size: 0.6rem;
        width: 1.2rem;
        height: 1.2rem;
    }
}

/* Loading States */
.loading-overlay {
    position: relative;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #dee2e6;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alert Styling */
.alert {
    border-radius: 0.5rem;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #e7f3ff;
    color: #0856a3;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Match Pagination */
.match-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem 0;
}

.match-pagination button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.match-pagination .match-info {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Table Position Colors (Optional Enhancement) */
.league-table .table tbody tr:nth-child(-n+4) td:first-child {
    color: #28a745; /* Champions League positions */
}

.league-table .table tbody tr:nth-child(n+5):nth-child(-n+6) td:first-child {
    color: #17a2b8; /* Europa League positions */
}

.league-table .table tbody tr:nth-last-child(-n+3) td:first-child {
    color: #dc3545; /* Relegation positions */
}

/* Smooth transitions */
.entry-content {
    transition: opacity 0.3s ease;
}

.nav-tabs .nav-link {
    transition: all 0.3s ease;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}
