/* Styly pro přehledovou stránku výsledků */

/* Základní layout stránky */
.dashboard-container {
    max-width: 1200px;
    width: 95%;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Úprava pro povolení scrollování */
    max-height: 95vh;
    overflow-y: auto;
}

body {
    /* Nastavení těla stránky tak, aby umožňovalo scrollování */
    overflow-y: auto;
    margin: 0;
    padding: 1rem;
    height: auto;
    min-height: 100vh;
    box-sizing: border-box;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
    /* Zajištění, že záhlaví zůstane na svém místě */
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 10;
}

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

/* Ovládací prvky */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem 0;
    /* Zajištění, že ovládací prvky zůstanou pod záhlavím */
    position: sticky;
    top: 60px;
    background-color: white;
    z-index: 9;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-controls label {
    font-weight: bold;
    color: #555;
}

.filter-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Kontejner pro výsledky podle kategorií */
.results-container {
    margin-bottom: 2rem;
    /* Umožnění scrollování pro obsah výsledků */
    flex: 1;
    min-height: 0;
}

.category-section {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-header {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.loading-container {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

/* Tabulka výsledků */
.results-table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.results-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: bold;
    text-align: left;
    padding: 0.8rem;
    border-bottom: 2px solid #ddd;
    /* Zajištění, že záhlaví tabulky zůstane viditelné při scrollování */
    position: sticky;
    top: 0;
    z-index: 5;
}

.results-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.results-table tbody tr:hover {
    background-color: #f9f9f9;
}

.results-table .position-1 td {
    background-color: rgba(241, 196, 15, 0.1);
    font-weight: bold;
}

.results-table .position-2 td {
    background-color: rgba(189, 195, 199, 0.1);
}

.results-table .position-3 td {
    background-color: rgba(205, 127, 50, 0.1);
}

.team-name-cell {
    white-space: nowrap;
    font-weight: 500;
}

.team-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.loading-cell {
    text-align: center;
    padding: 2rem !important;
    color: #7f8c8d;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Statistiky týmů */
.team-stats {
    margin-top: 1rem;
}

.team-stats h2 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    flex: 1;
    min-width: 200px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    border-left: 3px solid;
    padding-left: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Nejnovější výsledky */
.latest-results {
    margin-top: 1rem;
}

.latest-results h2 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.latest-results-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.latest-result-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    min-width: 250px;
    transition: transform 0.2s;
    border-left: 4px solid;
}

.latest-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.latest-result-card h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
}

.latest-result-time {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 0.8rem;
}

.latest-result-metrics {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.latest-result-metric {
    text-align: center;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.metric-label {
    font-size: 0.7rem;
    color: #7f8c8d;
}

.latest-result-commissioner {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #555;
    border-top: 1px dotted #eee;
    padding-top: 0.5rem;
}

.commissioner-label {
    font-weight: bold;
    margin-right: 0.5rem;
}

.commissioner-name {
    color: #3498db;
}

/* Styly pro tlačítko tisku diplomů */
.diploma-btn {
    background-color: #9b59b6;
    color: white;
}

.diploma-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
}

/* Styly pro tabulku výsledků s možností kliknutí na řádky */
.results-table tbody tr {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.results-table tbody tr:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Animace a loader */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responzivní design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .dashboard-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-card {
        min-width: 100%;
    }
}