/* ==================================================
   League Shared Styles
   Shared CSS for LeagueStandings, LeagueDetails, and related league pages
   ================================================== */

/* ==================================================
   PAGE LAYOUT
   ================================================== */

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==================================================
   HERO SECTION
   ================================================== */

.hero-section {
    background: transparent;
    border-radius: 0;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    border: none;
    position: relative;
}

.hero-status-chip {
    position: static;
    display: inline-block;
    margin-left: 1rem;
}

.league-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.meta-item ::deep .mud-icon-root {
    font-size: 1.2rem !important;
    color: var(--mud-palette-primary);
}

/* ==================================================
   RESPONSIVE VISIBILITY CLASSES
   ================================================== */

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }
}

/* ==================================================
   RACE WEEK HEADER
   ================================================== */

@media (max-width: 767px) {
    .race-week-header-wrapper {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    .race-week-text,
    .race-week-nav,
    .race-week-franchises {
        width: 100%;
        margin-left: 0 !important;
    }

    .race-week-franchises {
        margin-top: 8px;
    }
}

/* ==================================================
   STATS GRID & CARDS
   ================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: rgba(39, 39, 47, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(57, 181, 74, 0.4);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Oxanium', sans-serif;
}

/* ==================================================
   USER STATS CARD - DESIGN VARIANTS
   ================================================== */

.user-stats-card {
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.1), rgba(128, 128, 128, 0.05));
    border: 2px solid rgba(128, 128, 128, 0.2);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0;
}

.stat-position-badge {
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.15), rgba(128, 128, 128, 0.05));
    border-right: 2px solid rgba(128, 128, 128, 0.15);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.25rem;
}

.position-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
}

.stat-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.stat-points {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-points-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
}

.stat-points-value {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: 'Oxanium', sans-serif;
    color: white;
}

.stat-team-name {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: white;
    font-weight: 600;
    font-family: 'Oxanium', sans-serif;
}

/* DESIGN 2: Compact Vertical Card */
.user-stats-card.design-2 {
    grid-template-columns: 1fr !important;
    padding: 2rem 1.5rem;
    gap: 1rem;
}

.user-stats-card.design-2 .stat-position-badge {
    border: none;
    border-bottom: 3px solid var(--mud-palette-primary);
    padding: 1rem;
    grid-column: 1;
}

.user-stats-card.design-2 .position-number {
    font-size: 3rem;
}

.user-stats-card.design-2 .stat-details {
    padding: 0;
    gap: 1.25rem;
}

/* DESIGN 3: Medal Podium */
.user-stats-card.design-3 {
    grid-template-columns: 1fr !important;
    padding: 2rem 1.5rem;
    text-align: center;
    gap: 1rem;
    background: rgba(39, 39, 47, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-stats-card.design-3 .stat-position-badge {
    border: none;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    padding: 0;
    gap: 0;
}

.user-stats-card.design-3.rank-1 .stat-position-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.user-stats-card.design-3.rank-2 .stat-position-badge {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.3);
}

.user-stats-card.design-3.rank-3 .stat-position-badge {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.3);
}

.user-stats-card.design-3 .position-number {
    font-size: 2.5rem;
    color: white;
}

.user-stats-card.design-3 .stat-details {
    padding: 0;
    text-align: center;
    align-items: center;
}

/* DESIGN 4: Minimalist Row */
.user-stats-card.design-4 {
    grid-template-columns: auto 1fr auto !important;
    padding: 1.25rem 1.5rem;
    background: rgba(39, 39, 47, 0.4);
    border: 1px solid rgba(57, 181, 74, 0.2);
    gap: 2rem;
    align-items: center;
}

.user-stats-card.design-4 .stat-position-badge {
    border: none;
    padding: 0;
    background: none;
    gap: 0.25rem;
    min-width: auto;
}

.user-stats-card.design-4 .position-number {
    font-size: 2rem;
}

.user-stats-card.design-4 .stat-details {
    padding: 0;
    gap: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
}

.user-stats-card.design-4 .stat-points {
    gap: 1rem;
}

.user-stats-card.design-4 .stat-team-name {
    text-align: right;
}

/* ==================================================
   ACTION BARS (Desktop & Mobile)
   ================================================== */

.action-bar-desktop {
    display: flex;
    gap: 10px;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.action-bar-mobile {
    display: none !important;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
    background: rgba(39, 39, 47, 0.8) !important;
    border: 1px solid rgba(57, 181, 74, 0.2) !important;
}

.action-button {
    height: 56px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-button {
    flex: 1;
    min-width: 200px;
    height: 56px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Desktop action buttons (for standings pages) */
.action-buttons-desktop {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.action-buttons-mobile {
    display: none !important;
    flex-direction: column;
    gap: 0.5rem;
    padding: 8px !important;
    margin-bottom: 8px !important;
    
    border-radius: 12px;
}

/* ==================================================
   FILTER BAR & CHIPS
   ================================================== */

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-chips {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-chip {
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip.active {
    background: var(--mud-palette-primary) !important;
    color: white !important;
}

/* ==================================================
   CUSTOM TABLE (Standings Table)
   ================================================== */

.custom-table {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(39, 39, 47, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.table-header {
    display: flex;
    background: rgba(60, 60, 68, 0.8);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.table-row {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    background: rgba(39, 39, 47, 0.6);
}

.table-row:nth-child(even) {
    background: rgba(50, 50, 58, 0.6);
}

.table-row:hover {
    background: rgba(60, 60, 68, 0.6);
}

.table-cell {
    padding: 16px 12px;
    display: flex;
    align-items: center;
}

.position-col {
    width: 80px;
    justify-content: center;
}

.team-col {
    flex: 1;
    min-width: 0;
}

.points-col {
    width: 100px;
    justify-content: flex-end;
    padding-right: 24px;
}

.team-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.team-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    font-family: 'Oxanium', sans-serif;
    letter-spacing: 0.5px;
}

.player-name {
    font-size: 0.75rem;
    opacity: 0.6;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.7);
    text-transform: capitalize;
}

.points-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Skeleton table row styling */
.skeleton-row {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(39, 39, 47, 0.6);
    padding: 16px 12px;
}

.skeleton-row:nth-child(even) {
    background: rgba(50, 50, 58, 0.6);
}

/* ==================================================
   RACE WEEKS TABLE (Details Page)
   ================================================== */

.race-weeks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(39, 39, 47, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.race-weeks-table thead {
    background: rgba(60, 60, 68, 0.8);
}

.race-weeks-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.race-weeks-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.race-weeks-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.race-weeks-table tbody tr:hover {
    background: rgba(50, 50, 58, 0.8);
}

.race-weeks-table tbody tr:last-child td {
    border-bottom: none;
}

.race-weeks-table tbody tr.current-race-week {
    background: rgba(57, 181, 74, 0.08);
    border-left: 4px solid var(--mud-palette-primary);
}

.race-weeks-table tbody tr.current-race-week:hover {
    background: rgba(57, 181, 74, 0.12);
}

.race-weeks-table tbody tr.current-race-week .table-week-badge {
    background: linear-gradient(135deg, rgba(57, 181, 74, 0.3), rgba(57, 181, 74, 0.2));
    border-width: 3px;
}

.table-week-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(57, 181, 74, 0.2), rgba(57, 181, 74, 0.1));
    border: 2px solid var(--mud-palette-primary);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'Oxanium', sans-serif;
    color: var(--mud-palette-primary);
}

.table-dates {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ==================================================
   RACE WEEK COMPACT CARDS
   ================================================== */

.race-week-compact {
    background: rgba(39, 39, 47, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.race-week-compact:hover {
    border-color: rgba(57, 181, 74, 0.5);
    background: rgba(50, 50, 58, 0.8);
    transform: translateX(4px);
}

.week-badge {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(57, 181, 74, 0.2), rgba(57, 181, 74, 0.1));
    border: 2px solid var(--mud-palette-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Oxanium', sans-serif;
    color: var(--mud-palette-primary);
}

.week-info {
    flex: 1;
    min-width: 0;
}

.week-dates {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.week-details {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.week-status {
    flex-shrink: 0;
}

/* ==================================================
   POSITION BADGES (Rankings)
   ================================================== */

.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.position-1 {
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: #1a2a2a;
}

.position-2 {
    background: linear-gradient(135deg, #C0C0C0, #999999);
    color: white;
}

.position-3 {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: white;
}

.position-number {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: 'Oxanium', sans-serif;
    color: white;
}

.position-number.rank-1 {
    color: #FFD700;
}

.position-number.rank-2 {
    color: #C0C0C0;
}

.position-number.rank-3 {
    color: #CD7F32;
}

/* ==================================================
   EMPTY & LOADING STATES
   ================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(39, 39, 47, 0.95);
    margin: 20px;
    border-radius: 12px;
}

.loading-container {
    padding: 60px 20px;
    text-align: center;
    background: rgba(39, 39, 47, 0.95);
    margin: 20px;
    border-radius: 12px;
}

/* ==================================================
   RESPONSIVE STYLES - TABLET (max-width: 768px)
   ================================================== */

@media (max-width: 768px) {
    .page-container {
        padding: 1rem 0.5rem;
    }

    .hero-section {
        padding: 1rem 0;
        border-radius: 0;
    }

    .hero-status-chip {
        display: block;
        margin-left: 0;
        margin-top: 0.75rem;
    }

    .league-meta {
        gap: 1rem;
        font-size: 0.8rem;
    }

    .meta-item {
        font-size: 0.8rem;
    }

    .meta-item ::deep .mud-icon-root {
        font-size: 1rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-team-name {
        font-size: 0.7rem;
    }

    .user-stats-card {
        grid-template-columns: 100px 1fr !important;
    }

    .stat-position-badge {
        padding: 1rem !important;
    }

    .position-number {
        font-size: 2rem !important;
    }

    .stat-details {
        padding: 1rem !important;
    }

    .stat-points-value {
        font-size: 1.5rem !important;
    }

    .action-bar-desktop {
        display: none !important;
    }

    .action-bar-mobile {
        display: flex !important;
    }

    .action-button {
        height: 48px;
        font-size: 1rem;
    }

    .primary-button {
        min-width: 150px;
        height: 48px;
        font-size: 0.95rem;
        flex: 1;
        width: 100%;
    }

    .filter-bar {
        margin: 1.5rem 0;
    }

    .filter-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .week-badge {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .race-week-compact {
        padding: 0.875rem;
        gap: 1rem;
    }

    .week-dates {
        font-size: 0.8rem;
    }

    .week-details {
        font-size: 0.875rem;
    }

    /* Hide Franchises column on mobile */
    .race-weeks-table th:nth-child(4),
    .race-weeks-table td:nth-child(4),
    .skeleton-franchises-col {
        display: none;
    }

    .race-weeks-table th,
    .race-weeks-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .table-week-badge {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Custom table mobile adjustments */
    .position-col {
        width: 60px;
    }

    .points-col {
        width: 80px;
        padding-right: 12px;
    }

    .table-cell {
        padding: 12px 8px;
    }

    .team-name {
        font-size: 0.85rem;
    }

    .player-name {
        font-size: 0.7rem;
    }

    .points-value {
        font-size: 1rem;
    }

    .position-badge {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* ==================================================
   RESPONSIVE STYLES - MOBILE ACTION BARS
   ================================================== */

@media (max-width: 767px) {
    .action-buttons-desktop {
        display: none !important;
    }

    .action-buttons-mobile {
        display: flex !important;
    }

    .action-button {
        height: 48px;
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .action-buttons-mobile {
        display: none !important;
    }

    .action-buttons-desktop {
        display: flex !important;
    }
}

@media (min-width: 769px) {
    .action-bar-mobile {
        display: none !important;
    }

    .action-bar-desktop {
        display: flex !important;
    }
}

/* ==================================================
   RESPONSIVE STYLES - SMALL MOBILE (max-width: 480px)
   ================================================== */

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-chips {
        width: 100%;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-controls {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 425px) {
    .position-col {
        width: 50px;
    }

    .points-col {
        width: 70px;
    }

    .table-header {
        font-size: 0.65rem;
    }
}
