/* TD Dashboard Styles */

.td-dashboard-section {
    background: white;
    margin: 2rem auto;
    padding: 2rem 0;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    min-height: 70vh;
}

.td-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 2rem;
}

.td-page-header h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin: 0;
}

/* ========== My Leagues Section ========== */

.td-section-header {
    padding: 0 20px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.td-section-header h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
}

.td-section-header .section-count {
    background: #e8f0fe;
    color: #2B5A9E;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.td-leagues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 0 20px;
    margin-bottom: 2.5rem;
}

.td-league-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.td-league-card:hover {
    border-color: #2B5A9E;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.td-league-card .league-abbr {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.td-league-card .league-info {
    flex: 1;
    min-width: 0;
}

.td-league-card .league-info .league-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-league-card .league-info .league-meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.15rem;
}

.td-league-card .league-tourney-count {
    text-align: center;
    flex-shrink: 0;
}

.td-league-card .league-tourney-count .count-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2B5A9E;
    display: block;
}

.td-league-card .league-tourney-count .count-label {
    font-size: 0.7rem;
    color: #888;
}

/* ========== Divider ========== */

.td-divider {
    border: none;
    border-top: 2px solid #e9ecef;
    margin: 0 20px 2rem;
}

/* ========== Filters ========== */

.td-filters {
    display: flex;
    gap: 1rem;
    padding: 0 20px;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

.td-filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.td-filter-group-compact {
    flex: 0 0 auto;
    min-width: 140px;
}

.td-filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.35rem;
}

.td-filter-input,
.td-filter-select {
    padding: 0.6rem 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.td-filter-input:focus,
.td-filter-select:focus {
    outline: none;
    border-color: #2B5A9E;
    box-shadow: 0 0 0 3px rgba(43, 90, 158, 0.1);
}

/* ========== Tournaments Table ========== */

.td-tournaments-list {
    padding: 0 20px;
}

.td-tournament-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.td-tournament-row:hover {
    background: #f8f9fa;
}

.td-tournament-row:last-child {
    border-bottom: none;
}

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

.td-tourney-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.td-tourney-meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.15rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.td-tourney-league-badge {
    background: #e8f0fe;
    color: #2B5A9E;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.td-tourney-stats {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
    align-items: center;
}

.td-tourney-stat {
    text-align: center;
}

.td-tourney-stat .stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #2B5A9E;
    display: block;
}

.td-tourney-stat .stat-label {
    font-size: 0.7rem;
    color: #888;
}

.td-status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.td-status-badge.upcoming {
    background: #fff3cd;
    color: #856404;
}

.td-status-badge.live {
    background: #f8d7da;
    color: #721c24;
}

.td-status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.td-status-badge.cancelled {
    background: #e2e3e5;
    color: #383d41;
}

/* ========== Action Buttons ========== */

.td-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.td-action-btn {
    padding: 0.35rem 0.65rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    color: #555;
    transition: all 0.2s;
    white-space: nowrap;
}

.td-action-btn:hover {
    border-color: #2B5A9E;
    color: #2B5A9E;
    background: #f0f7ff;
}

.td-action-btn.duplicate {
    color: #27ae60;
}

.td-action-btn.duplicate:hover {
    border-color: #27ae60;
    background: #e8f8e8;
}

/* ========== Empty States ========== */

.td-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #999;
}

.td-empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.td-empty-state .empty-text {
    font-size: 1rem;
    font-weight: 500;
    color: #666;
}

.td-empty-state .empty-subtext {
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.25rem;
}

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

.td-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
    font-size: 1rem;
}

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

@media (max-width: 768px) {
    .td-dashboard-section {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 1.25rem 0;
    }

    .td-page-header {
        padding: 0 15px;
        margin-bottom: 1.5rem;
    }

    .td-page-header h1 {
        font-size: 1.4rem;
    }

    .td-section-header {
        padding: 0 15px;
    }

    .td-leagues-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }

    .td-divider {
        margin: 0 15px 1.5rem;
    }

    .td-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 0 15px;
        gap: 0.75rem;
    }

    .td-filters .td-filter-group:first-child {
        grid-column: 1 / -1;
    }

    .td-filters .td-filter-group-compact {
        min-width: 0;
    }

    .td-tournaments-list {
        padding: 0 15px;
    }

    .td-tournament-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 0;
        gap: 0.5rem;
    }

    .td-tourney-stats {
        display: none;
    }

    .td-actions {
        width: 100%;
    }

    .td-action-btn {
        flex: 1;
        text-align: center;
    }
}
