/* Contest Log Viewer Styles - Isolated namespace */
.contest-log-viewer {
    /* Reset specifický pro contest log viewer */
    * {
        box-sizing: border-box;
    }
    
    /* Základní nastavení */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    color: #40E0D0; /* Sjednocená základní barva textu */
}

/* Header sekce */
.contest-log-viewer .log-header {
    text-align: center;
    margin-bottom: 5px;
    padding-bottom: 10px;    
}

.contest-log-viewer .log-title {
    color: #da70d6; /* Zachováváme specifickou barvu pro title */
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* File selector */
.contest-log-viewer .file-selector {
    background: transparent;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); /* Sjednocený box-shadow */
}

.contest-log-viewer .file-form {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.contest-log-viewer .log-selector {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #333;
    min-width: 300px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contest-log-viewer .load-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #28a745; /* Sjednocená zelená barva s hlavními styly */
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
}

.contest-log-viewer .load-btn:hover {
    transform: translateY(-2px);
    background: #218838;
}

/* Contest info cards */
.contest-log-viewer .contest-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.contest-log-viewer .info-card {
    background: transparent;
    color: #da70d6;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); /* Sjednocený box-shadow */
}

.contest-log-viewer .info-card h3 {
    color: #32cd32; /* Sjednocená barva h3 s hlavními styly */
    font-size: 1em;
    margin-bottom: 5px;
    margin-top: 0;
	text-align: center;
}

.contest-log-viewer .info-card p {
    font-size: 1.2em;
    font-weight: bold;
	text-align: center;
    margin: 0;
}

/* Statistics cards */
.contest-log-viewer .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.contest-log-viewer .stat-card {
    background: transparent;
    color: #40E0D0;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); /* Sjednocený box-shadow */
}

.contest-log-viewer .stat-card h4 {
    font-size: 0.9em;
    color: #f39c12;
    margin-bottom: 5px;
    margin-top: 0;
	text-align: center;
}

.contest-log-viewer .stat-card p {
    font-size: 1.2em;
    font-weight: bold;
	text-align: center;
    margin: 0;
    white-space: nowrap;
}

/* OPRAVENÉ FILTRY - HLAVNÍ SEKCE */
.contest-log-viewer .filters {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contest-log-viewer .filter-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Hlavní filtr formulář */
.contest-log-viewer .main-filter {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contest-log-viewer .filter-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

/* VŠECHNA TLAČÍTKA V JEDNÉ ŘADĚ NA DESKTOPU */
.contest-log-viewer .all-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

.contest-log-viewer .filter-buttons {
    display: contents; /* Zruší flex kontejner, tlačítka se stanou součástí parent řady */
}

.contest-log-viewer .secondary-buttons {
    display: contents; /* Zruší flex kontejner, tlačítka se stanou součástí parent řady */
}

.contest-log-viewer .inline-form {
    display: inline-block;
    margin: 0;
}

/* Vstupní pole filtrů */
.contest-log-viewer .filter-input {
    padding: 10px;
    border: 2px solid #ddd;
    text-transform: uppercase;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    min-width: 120px;
    flex: 1;
}

.contest-log-viewer .filter-input:focus {
    border-color: #667eea;
    outline: none;
}

/* Styly tlačítek */
.contest-log-viewer .filter-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.contest-log-viewer .filter-btn.primary {
    background: #6c5ce7;
    color: white;
}

.contest-log-viewer .filter-btn.primary:hover {
    background: #5a4fcf;
    transform: translateY(-1px);
}

.contest-log-viewer .filter-btn.secondary {
    background: #00b894;
    color: white;
}

.contest-log-viewer .filter-btn.secondary:hover {
    background: #00a085;
    transform: translateY(-1px);
}

.contest-log-viewer .filter-btn.clear {
    background: #e17055;
    color: white;
}

.contest-log-viewer .filter-btn.clear:hover {
    background: #d63447;
    transform: translateY(-1px);
}

/* Filter info */
.contest-log-viewer .filter-info h3 {
    text-align: center;
    color: #da70d6;
    font-weight: bold;
    margin: 10px 0;
    padding: 8px;
    background-color: transparent;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

/* Table container */
.contest-log-viewer .table-container {
    color: #40E0D0;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

/* QSO Table */
.contest-log-viewer .qso-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: transparent;
    position: relative;
    border-spacing: 0;
}

.contest-log-viewer .qso-table thead tr {
    position: sticky;
    top: 0;
    z-index: 100;
}

.contest-log-viewer .qso-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
    padding: 12px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid #5a6fd8;
}

.contest-log-viewer .qso-table td {
    padding: 10px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
}

.contest-log-viewer .qso-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.5); /* šedá s 50% průhledností */
}

.contest-log-viewer .qso-table tr {
    margin: 0;
    padding: 0;
}

/* Table cell styling */
.contest-log-viewer .callsign {
    font-weight: bold;
    color: #667eea;
}

.contest-log-viewer .distance {
    color: #f5576c;
    font-weight: 600;
}

.contest-log-viewer .locator {
    color: #f39c12;
    font-weight: bold;
}

/* Utility classes */
.contest-log-viewer .no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2em;
}

.contest-log-viewer .info-message {
    background: rgba(204, 231, 255, 0.1);
    color: #87ceeb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(204, 231, 255, 0.3);
}

.contest-log-viewer .debug-info {
    background: rgba(255, 243, 205, 0.1);
    color: #f39c12;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 12px;
    border: 1px solid rgba(255, 234, 167, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .contest-log-viewer .log-title {
        font-size: 1.5em;
    }
    
    .contest-log-viewer .file-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .contest-log-viewer .log-selector {
        min-width: auto;
        width: 100%;
    }
    
    .contest-log-viewer .contest-info,
    .contest-log-viewer .stats {
        grid-template-columns: 1fr;
    }
    
    /* MOBILNÍ VERZE - KAŽDÉ TLAČÍTKO POD SEBOU */
    .contest-log-viewer .filter-inputs {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .contest-log-viewer .all-buttons-row {
        flex-direction: column; /* Tlačítka pod sebou na mobilu */
        align-items: stretch;
        width: 100%;
    }
    
    .contest-log-viewer .filter-buttons {
        display: flex; /* Obnoví flex kontejner na mobilu */
        width: 100%;
    }
    
    .contest-log-viewer .secondary-buttons {
        display: flex; /* Obnoví flex kontejner na mobilu */
        flex-direction: column; /* Každé tlačítko pod sebou */
        width: 100%;
        gap: 10px;
    }
    
    .contest-log-viewer .filter-input,
    .contest-log-viewer .filter-btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* Mobilní optimalizace tabulky */
    .contest-log-viewer .table-container {
        margin: 0 -10px;
        border-radius: 0;
    }
    
    .contest-log-viewer .qso-table {
        font-size: 11px;
        min-width: 100%;
    }
    
    .contest-log-viewer .qso-table th,
    .contest-log-viewer .qso-table td {
        padding: 4px 2px;
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0;
    }
    
    .contest-log-viewer .qso-table th:first-child,
    .contest-log-viewer .qso-table td:first-child {
        min-width: 40px;
    }
    
    .contest-log-viewer .qso-table th:nth-child(2),
    .contest-log-viewer .qso-table td:nth-child(2) {
        min-width: 70px;
        max-width: 70px;
    }
    
    .contest-log-viewer .qso-table th:nth-child(3),
    .contest-log-viewer .qso-table td:nth-child(3) {
        min-width: 50px;
        max-width: 50px;
    }
    
    .contest-log-viewer .qso-table th:nth-child(4),
    .contest-log-viewer .qso-table td:nth-child(4) {
        min-width: 50px;
        max-width: 50px;
    }
    
    .contest-log-viewer .stat-card {
        padding: 8px;
    }
    
    .contest-log-viewer .stat-card h4 {
        font-size: 0.8em;
    }
    
    .contest-log-viewer .stat-card p {
        font-size: 1em;
    }
}