/**
 * WTTV Cup Scraper - Styles
 */

/* =============================================================================
   Tournament Overview
   ========================================================================== */

.wttv-tournament-overview {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Filters */
.wttv-filters {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.wttv-filter-group {
    margin-bottom: 15px;
}

.wttv-filter-group:last-child {
    margin-bottom: 0;
}

.wttv-filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.wttv-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.wttv-radio-group label {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    margin: 0;
}

.wttv-radio-group input[type="radio"] {
    margin: 0 5px 0 0;
    cursor: pointer;
}

/* Table Wrapper */
.wttv-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.wttv-table-wrapper.is-scrollable {
    box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.1);
}

/* Table */
.wttv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wttv-table thead {
    background: #2c3e50;
    color: #fff;
}

.wttv-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #1a252f;
    white-space: nowrap;
}

.wttv-table thead th.sort-asc::after {
    content: ' ▲';
    opacity: 0.7;
}

.wttv-table thead th.sort-desc::after {
    content: ' ▼';
    opacity: 0.7;
}

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

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

.wttv-table tbody tr.is-upcoming {
    background-color: #e8f5e9;
}

.wttv-table tbody tr.is-upcoming:hover {
    background-color: #c8e6c9;
}

.wttv-table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

.wttv-table .wttv-date,
.wttv-table .wttv-time {
    white-space: nowrap;
    color: #555;
}

.wttv-table .wttv-name a {
    color: #2980b9;
    text-decoration: none;
    font-weight: 500;
}

.wttv-table .wttv-name a:hover {
    color: #1a5f8a;
    text-decoration: underline;
}

.wttv-table .wttv-organizer {
    display: block;
    font-size: 12px;
    color: #777;
    margin-top: 3px;
}

/* Status badges */
.wttv-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.wttv-status-frei {
    background: #4caf50;
    color: #fff;
}

.wttv-status-offen {
    background: #ff9800;
    color: #fff;
}

.wttv-status-belegt {
    background: #f44336;
    color: #fff;
}

/* Info section */
.wttv-info {
    text-align: center;
    color: #777;
    font-size: 13px;
    margin-top: 10px;
}

/* =============================================================================
   Tournament Detail
   ========================================================================== */

.wttv-tournament-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.wttv-navigation {
    margin-bottom: 20px;
}

.wttv-back-button {
    display: inline-block;
    padding: 8px 16px;
    background: #2c3e50;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s ease;
}

.wttv-back-button:hover {
    background: #1a252f;
    color: #fff;
}

/* Detail Header */
.wttv-detail-header {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.wttv-detail-header h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 28px;
}

.wttv-detail-info {
    display: grid;
    gap: 12px;
}

.wttv-info-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.wttv-info-row:last-child {
    border-bottom: none;
}

.wttv-label {
    font-weight: 600;
    color: #555;
}

.wttv-value {
    color: #333;
}

/* Participants Section */
.wttv-participants-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
}

.wttv-participants-section h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 22px;
}

.wttv-participants-table {
    width: 100%;
    border-collapse: collapse;
}

.wttv-participants-table thead {
    background: #34495e;
    color: #fff;
}

.wttv-participants-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.wttv-participants-table tbody tr {
    border-bottom: 1px solid #eee;
}

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

.wttv-participants-table tbody td {
    padding: 12px 15px;
}

.wttv-participants-table .wttv-position {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: #666;
}

.wttv-participants-table .wttv-participant-ttr {
    width: 80px;
    text-align: center;
    font-weight: 500;
    color: #2980b9;
}

/* No participants */
.wttv-no-participants {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #999;
}

/* External Links */
.wttv-external-links {
    margin-top: 20px;
    text-align: center;
}

.wttv-external-link {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.wttv-external-link:hover {
    background: #2980b9;
    color: #fff;
}

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

@media screen and (max-width: 768px) {
    .wttv-tournament-overview,
    .wttv-tournament-detail {
        padding: 10px;
    }

    .wttv-filters {
        padding: 15px;
    }

    .wttv-radio-group {
        gap: 10px;
    }

    .wttv-table {
        font-size: 13px;
    }

    .wttv-table thead th,
    .wttv-table tbody td {
        padding: 8px 10px;
    }

    .wttv-info-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .wttv-label {
        font-size: 13px;
    }

    .wttv-detail-header {
        padding: 20px;
    }

    .wttv-detail-header h2 {
        font-size: 22px;
    }

    .wttv-participants-section {
        padding: 20px;
    }

    .wttv-participants-section h3 {
        font-size: 18px;
    }

    /* Make table scrollable on mobile */
    .wttv-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wttv-table {
        min-width: 600px;
    }
}

@media screen and (max-width: 480px) {
    .wttv-radio-group {
        flex-direction: column;
        gap: 8px;
    }

    .wttv-table {
        font-size: 12px;
    }

    .wttv-table thead th,
    .wttv-table tbody td {
        padding: 6px 8px;
    }

    .wttv-status {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* =============================================================================
   Animations
   ========================================================================== */

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

.wttv-row {
    animation: fadeIn 0.3s ease;
}

/* =============================================================================
   Print Styles
   ========================================================================== */

@media print {
    .wttv-filters,
    .wttv-navigation,
    .wttv-external-links {
        display: none;
    }

    .wttv-table,
    .wttv-participants-table {
        font-size: 10px;
    }

    .wttv-table tbody tr,
    .wttv-participants-table tbody tr {
        page-break-inside: avoid;
    }
}
