/**
 * TargetAce Challenge Ladder Frontend Styles
 */

/* Ladders List Grid */
.targetace-ladders-list {
    margin: 2rem 0;
}

.ladders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.ladder-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.ladder-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.ladder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ladder-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.ladder-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ladder-status.open_for_entry {
    background: #28a745;
    color: white;
}

.ladder-status.in_progress {
    background: #ffc107;
    color: #333;
}

.ladder-status.completed {
    background: #6c757d;
    color: white;
}

.ladder-meta {
    margin: 1rem 0;
}

.ladder-meta p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

.ladder-description {
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

.ladder-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.ladder-actions .button {
    flex: 1;
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.ladder-actions .button-primary {
    background: #007bff;
    color: white;
}

.ladder-actions .button-primary:hover {
    background: #0056b3;
}

/* Single Ladder View */
.targetace-ladder-single {
    margin: 2rem 0;
}

.ladder-header-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #007bff;
}

.ladder-header-full h2 {
    margin: 0;
    color: #333;
}

.ladder-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ladder-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.info-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.ladder-description-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.ladder-description-box h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.ladder-description-box p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

.ladder-rules {
    background: #fffbf0;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.ladder-rules h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.ladder-rules ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ladder-rules li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ffe699;
}

.ladder-rules li:last-child {
    border-bottom: none;
}

.ladder-join-section {
    background: #e7f3ff;
    border: 1px solid #007bff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

.ladder-join-section p {
    margin: 0;
    color: #0056b3;
    font-weight: 500;
}

/* Standings Table */
.targetace-ladder-standings {
    margin: 2rem 0;
}

.targetace-ladder-standings h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: #333;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.standings-table thead {
    background: #007bff;
    color: white;
}

.standings-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.standings-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

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

.standings-table tbody tr:last-child {
    border-bottom: none;
}

.standings-table td {
    padding: 1rem;
}

/* Position badges */
.position-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.position-badge.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.position-badge.silver {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #333;
}

.position-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #e8a87c);
    color: white;
}

/* Stats */
.stat-value {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.stat-value.win {
    background: #d4edda;
    color: #155724;
}

.stat-value.loss {
    background: #f8d7da;
    color: #721c24;
}

.win-percentage {
    font-weight: 600;
    color: #007bff;
}

.challenges-count {
    color: #6c757d;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .ladders-grid {
        grid-template-columns: 1fr;
    }
    
    .ladder-info-grid {
        grid-template-columns: 1fr;
    }
    
    .ladder-header-full {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .standings-table {
        font-size: 0.85rem;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* No content messages */
.targetace-no-ladders,
.no-participants,
.no-standings,
.error {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-style: italic;
}

.error {
    background: #f8d7da;
    color: #721c24;
}
