/* =======================================================
   LEAGUE SECTION STYLES - BETWITHDUDA
   ======================================================= */

.league-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* League Header */
.league-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: rgb(27 21 57 / 90%);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 16px;
}

.league-title-section {
    flex: 1;
}

.league-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.league-title i {
    color: #fbbf24;
    font-size: 22px;
}

.league-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Status Badge */
.league-status-badge {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.league-status-badge.active {
    background: linear-gradient(135deg, #523675, #4e0596);
    color: #fff;
}

.league-status-badge i {
    font-size: 16px;
}

/* Loading, Error, Empty States */
.league-loading,
.league-error,
.league-empty {
    background: rgb(27 21 57 / 90%);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 50px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
}

.league-loading i,
.league-error i,
.league-empty i {
    font-size: 80px;
    margin-bottom: 30px;
    display: block;
}

.league-loading i {
    color: #fbbf24;
    animation: spin 1s linear infinite;
}

.league-error i {
    color: #ef4444;
}

.league-empty i {
    color: #6b7280;
}

.league-loading h3,
.league-error h3,
.league-empty h3 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.league-loading p,
.league-error p,
.league-empty p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

.retry-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    margin-top: 20px;
}

.retry-btn:hover {
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.6);
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Active League Section */
.active-league-section {
    background: rgb(27 21 57 / 90%);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.active-league-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-league-section h2 i {
    color: #10b981;
    font-size: 22px;
}

.active-league-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.active-league-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.active-league-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.active-league-stat:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(16, 185, 129, 0.3);
}

.active-league-stat .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 5px;
    display: block;
}

.active-league-stat .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* League History Section */
.league-history-section {
    background: rgb(27 21 57 / 90%);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.league-history-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.league-history-section h2 i {
    color: #fbbf24;
    font-size: 20px;
}

.league-history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.league-history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.league-history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-2px);
}

.league-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.league-item-title {
    flex: 1;
}

.league-item-title h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.league-item-title .league-status {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.league-status.completed {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid #6b7280;
}

.league-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.league-item-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.league-item-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.league-stat-item {
    text-align: center;
}

.league-stat-value {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    display: block;
}

.league-stat-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profit-positive { color: #22c55e; }
.profit-negative { color: #ef4444; }
.profit-neutral { color: #fbbf24; }

/* Estilos para o botão expandir/recolher */
.league-expand-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fbbf24;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.league-expand-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fbbf24;
    transform: translateY(-1px);
}

/* Estilos para os detalhes expandidos */
.league-expanded-details {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

.league-winner-section {
    margin-bottom: 25px;
}

.league-winner-section h4 {
    color: #fbbf24;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.winner-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 15px;
}

.winner-image {
    width: 50px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.winner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.winner-placeholder {
    width: 50px;
    height: 65px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.winner-info {
    flex: 1;
}

.winner-name {
    color: #fbbf24;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.winner-stats {
    color: #888;
    font-size: 14px;
}

/* Standings Table */
.standings-section {
    background: rgb(27 21 57 / 90%);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.standings-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.standings-section h2 i {
    color: #9333ea;
    font-size: 24px;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

.standings-table thead tr {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
}

.standings-table th {
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.standings-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.standings-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.position-cell {
    color: #fbbf24;
    font-weight: 700;
    font-size: 18px;
}

.player-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 40px;
    height: 52px;
    border-radius: 4px;
    object-fit: cover;
}

.player-placeholder {
    width: 40px;
    height: 52px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.player-name {
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.bonus-cell {
    color: #fbbf24;
    font-weight: 600;
}

.points-cell {
    color: #22c55e;
    font-weight: 700;
    font-size: 16px;
}

.wins-cell {
    color: #10b981;
}

.matches-cell {
    color: #9ca3af;
}

/* Journey Details */
.journey-details {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    display: none;
}

.journey-details.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.journey-details h4 {
    color: #c084fc;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.journey-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.journey-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
}

.journey-header {
    color: #fbbf24;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.journey-matches {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.journey-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.journey-match:last-child {
    border-bottom: none;
}

.match-players {
    color: white;
    font-weight: 500;
}

.match-result {
    color: #10b981;
    font-weight: 600;
}

.match-pending {
    color: #888;
    font-style: italic;
}

.league-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.league-last-update {
    background: rgb(27 21 57 / 90%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 16px;
    color: #ffffff;
    font-size: 12px;
    display: inline-block;
    margin-top: 10px;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsividade */
@media (max-width: 968px) {
    .league-container {
        padding: 15px;
    }
    
    .league-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 25px;
    }
    
    .league-title {
        font-size: 24px;
        justify-content: center;
    }
    
    .league-title i {
        font-size: 28px;
    }
    
    .active-league-section,
    .league-history-section,
    .standings-section {
        padding: 25px;
    }
    
    .active-league-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .league-item-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .standings-table {
        font-size: 12px;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 12px 8px;
    }
    
    .journey-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .league-item-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .winner-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

@media (max-width: 640px) {
    .league-header {
        padding: 20px;
    }
    
    .league-title {
        font-size: 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .league-subtitle {
        font-size: 14px;
    }
    
    .league-status-badge {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .active-league-section,
    .league-history-section,
    .standings-section {
        padding: 20px;
    }
    
    .active-league-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .league-item-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .standings-table {
        font-size: 11px;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 10px 6px;
    }
    
    .player-cell {
        gap: 8px;
    }
    
    .player-avatar,
    .player-placeholder {
        width: 30px;
        height: 40px;
    }
    
    .player-name {
        font-size: 14px;
    }
}