/* Wettkampfkalender App Specific Styling */

.app-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 95%; /* 95% to allow wide tables */
    width: 1400px;
    padding: 2rem 3rem;
    overflow: hidden; /* Contains the scrollable table inside */
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-transform: uppercase;
}

/* Controls */
.controls-section {
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}

.action-buttons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    border: none;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.loading {
    color: #cbd5e1;
    font-style: italic;
    animation: pulse 1.5s infinite;
}

/* Filters */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.primary-filters {
    display: flex;
    width: 100%;
    align-items: flex-end;
    gap: 1rem;
}

.main-search {
    flex: 1;
}

.filter-group label {
    font-size: 0.9rem;
    color: #e2e8f0;
    font-weight: 600;
    text-transform: uppercase;
}

.filter-group input, 
.filter-group select {
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
}

.filter-group input::placeholder {
    color: #94a3b8;
}

.filter-group input:focus, 
.filter-group select:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

/* Table Area */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    color: #f8fafc;
    font-size: 0.95rem;
    white-space: nowrap;
}

.data-table thead {
    background: rgba(0, 136, 204, 0.2);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: sticky;
    top: 0;
    background: rgba(26, 32, 44, 0.95);
    border-bottom: 2px solid var(--primary-color);
    user-select: none;
    z-index: 10;
}

.data-table th:hover {
    background: rgba(45, 55, 72, 0.95);
}

.data-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05); /* Highlight whole row */
}

/* Utils */
.hidden {
    display: none !important;
}

.error-notification {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1e2532;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--glass-border);
    color: white;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #cbd5e1;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
}

.modal-body {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 0.5rem;
}

.detail-row {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.detail-row strong {
    flex: 1;
    color: var(--primary-color);
}

.detail-row span {
    flex: 2;
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem 0.8rem;
        max-width: 100%;
        width: 100%;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .primary-filters {
        flex-direction: row;
        gap: 0.5rem;
    }

    .filter-group {
        min-width: 100%;
    }

    .main-search {
        min-width: 0;
    }
}
