/* Rozšířené styly pro stopwatch.css včetně offline režimu */

/* Základní styly pro stopwatch.css */

/* Upravena šířka a rozložení detailů kol */
.round-header, .round-item {
    display: grid;
    grid-template-columns: 0.8fr 1fr 1fr 1.2fr;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.round-header {
    font-size: 0.8rem;
    font-weight: bold;
    color: #666;
    border-bottom: 1px dotted #ddd;
    padding-bottom: 0.2rem;
    margin-bottom: 0.3rem;
}

.round-item {
    padding: 0.2rem 0;
    border-bottom: 1px dotted #eee;
}

/* Styly pro zobrazení komisaře ve výsledku */
.commissioner-result {
    font-style: italic;
    color: #555;
}

/* Styly pro komisaře na stránce stopek */

.active-commissioner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background-color: #f8f9fa;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

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

.commissioner-name {
    flex-grow: 1;
    font-weight: bold;
    color: #3498db;
}

.commissioner-btn {
    padding: 0.4rem 0.8rem;
    background-color: #f39c12;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    font-size: 0.9rem;
}

.commissioner-btn:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

/* Styly pro seznam komisařů v modálním okně */
.commissioners-list {
    max-height: 300px;
    overflow-y: auto;
}

.commissioner-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.commissioner-item:hover {
    background-color: #f5f5f5;
}

.commissioner-item:last-child {
    border-bottom: none;
}

.commissioner-color {
    width: 5px;
    height: 40px;
    border-radius: 2px;
    margin-right: 15px;
}

.commissioner-info {
    flex-grow: 1;
}

.commissioner-item-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.commissioner-item-id {
    color: #666;
    font-size: 0.8rem;
}

/* Vybraný komisař */
.commissioner-item.selected {
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 4px solid #3498db;
}

/* ===== NOVÉ STYLY PRO ZÁMKY KOMISAŘŮ ===== */

/* Styly pro zamčené týmy */
.team-locked {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    position: relative;
    box-shadow: 0 0 0 1px rgba(255, 0, 0, 0.2) !important;
}

.team-locked-by-me {
    position: relative;
    box-shadow: 0 0 0 1px rgba(0, 128, 0, 0.3) !important;
}

/* Informace o zámku (tooltip) */
.team-lock-info {
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-bottom-left-radius: 4px;
    z-index: 10;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-lock-info.my-lock {
    background-color: rgba(0, 128, 0, 0.8);
}

/* Ikona zámku */
.team-lock-info i {
    margin-right: 4px;
}

/* Animace pro zamčený tým */
@keyframes lockPulse {
    0% { box-shadow: 0 0 0 1px rgba(255, 0, 0, 0.2); }
    50% { box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.4); }
    100% { box-shadow: 0 0 0 1px rgba(255, 0, 0, 0.2); }
}

.team-locked {
    animation: lockPulse 2s infinite;
}

/* Badge pro stav identifikace */
.commissioner-status {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.commissioner-status.identified {
    background-color: #2ecc71; /* zelená pro identifikovaného komisaře */
}

.commissioner-status.not-identified {
    background-color: #e74c3c; /* červená pro neidentifikovaného komisaře */
}

.commissioner-status.pending {
    background-color: #f39c12; /* oranžová pro probíhající identifikaci */
    animation: pendingPulse 1.5s infinite;
}

@keyframes pendingPulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* ===== NOVÉ STYLY PRO OFFLINE MÓD ===== */

/* Rozšířený indikátor připojení */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: #f8f9fa;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer; /* Aby bylo jasné, že lze kliknout pro přepnutí režimu */
}

.connection-status:hover::after {
    content: 'Klikněte pro přepnutí režimu';
    position: absolute;
    bottom: -25px;
    left: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 100;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #e74c3c; /* Červená ve výchozím stavu */
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
    position: relative;
}

.connection-status.online .status-indicator {
    background-color: #2ecc71; /* Zelená pro online stav */
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.3);
}

.connection-status.offline .status-indicator {
    background-color: #f39c12; /* Oranžová pro offline režim */
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.3);
}

.status-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
}

.connection-status.online {
    border-left: 3px solid #2ecc71;
}

.connection-status.offline {
    border-left: 3px solid #f39c12;
}

/* Blikání indikátoru při synchronizaci */
@keyframes syncPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.status-indicator.syncing {
    animation: syncPulse 1s infinite;
}

/* Badge pro offline data */
.offline-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.7rem;
    height: 18px;
    min-width: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px white;
}

/* Styl pro týmy v offline režimu */
.team-card.offline {
    border: 1px dashed #f39c12 !important;
}

.team-card.offline::after {
    content: 'offline';
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #f39c12;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 10;
}

/* Výrazné upozornění pro offline režim */
.offline-mode-banner {
    background-color: #f39c12;
    color: white;
    padding: 0.5rem;
    text-align: center;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-weight: bold;
    animation: fadeInOut 2s infinite;
    display: none; /* Ve výchozím stavu skryto */
}

.offline-mode-banner.show {
    display: block;
}

@keyframes fadeInOut {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Tlačítko pro manuální synchronizaci */
.sync-button {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
    display: none; /* Ve výchozím stavu skryto */
}

.connection-status.offline .sync-button {
    display: inline-block;
}

.sync-button:hover {
    background-color: #2980b9;
}

/* Informace o poslední synchronizaci */
.last-sync-info {
    font-size: 0.7rem;
    color: #777;
    margin-top: 0.3rem;
    display: none; /* Ve výchozím stavu skryto */
}

.connection-status.offline .last-sync-info {
    display: block;
}

/* Offline indikátor v detailech týmu */
.offline-indicator {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(243, 156, 18, 0.1);
    border-left: 3px solid #f39c12;
    color: #774800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.offline-indicator i {
    color: #f39c12;
}

/* Tlačítko pro přepínání offline režimu */
.action-btn-secondary {
    background-color: #7f8c8d !important;
}

.action-btn-secondary:hover {
    background-color: #6c7a7a !important;
}
