* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body, html { height: 100%; overflow: hidden; background-color: #f4f4f4; }

#app-container { display: flex; flex-direction: column; height: 100vh; }

/* Horní panely */
#top-menu { background: #2c3e50; color: white; padding: 5px 10px; font-size: 14px; }
.menu-item { margin-right: 15px; cursor: pointer; }
.menu-item:hover { color: #3498db; }

#icon-toolbar { background: #ecf0f1; padding: 5px 10px; border-bottom: 1px solid #ccc; display: flex; gap: 5px; }
#icon-toolbar button { padding: 4px 8px; border: 1px solid #bdc3c7; background: white; cursor: pointer; border-radius: 3px; }
#icon-toolbar button:hover { background: #e0e0e0; }

/* Hlavní plocha */
#main-workspace { display: flex; flex: 1; overflow: hidden; }

/* Levý panel */
#sidebar { display: flex; flex-direction: column; background: #fff; flex-shrink: 0; }

#search-container { padding: 10px; border-bottom: 1px solid #ccc; background: #fafafa; }
#search-box { width: 100%; padding: 6px; border: 1px solid #ccc; border-radius: 4px; outline: none; }
#search-box:focus { border-color: #3498db; }

#track-detail { display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
#track-list-container { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.panel-title { background: #e8e8e8; padding: 4px 10px; font-size: 12px; font-weight: bold; border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; color: #555; }
#detail-content { padding: 10px; overflow-y: auto; flex: 1; }
#track-list { flex: 1; overflow-y: auto; position: relative; }

/* Mapa */
#map-container { flex: 1; background: #e5e3df; position: relative; }

/* Posuvníky (Resizery) */
.resizer { background: #dcdcdc; display: flex; justify-content: center; align-items: center; z-index: 10; transition: background 0.2s; }
.resizer:hover, .resizer.active { background: #3498db; }

.resizer.vertical { width: 6px; cursor: col-resize; border-left: 1px solid #ccc; border-right: 1px solid #ccc; }
.resizer.horizontal { height: 6px; cursor: row-resize; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; }

/* Stavový řádek */
#status-bar { background: #ecf0f1; padding: 3px 10px; font-size: 12px; border-top: 1px solid #ccc; color: #333; }


/* --- Styly pro řádky seznamu tras --- */
.track-row {
    position: absolute;
    left: 0;
    right: 0;
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    background: #fff;
    cursor: pointer;
    user-select: none; /* Zabrání modrému označování textu při rychlém klikání */
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* Hover efekt */
.track-row:hover,
.track-row.hovered {
    background-color: #fff9c4; /* Světle žlutá (odpovídá zlatému obrysu v mapě) */
    border-left: 4px solid #fbc02d; /* Tmavší žlutý proužek na boku */
    padding-left: 6px; /* Kompenzace za rámeček, aby text neuskočil */
}

/* Pokud na trasu najedeme myší, ale zároveň je už vybraná (Selected) */
.track-row.selected:hover,
.track-row.selected.hovered {
    background-color: #e3f2fd;
    border-left: 4px solid #fbc02d; /* Zachováme modré pozadí, ale ukážeme žlutý indikátor */
}

/* Vybraná trasa (kliknutí / CTRL+klik) */
.track-row.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding-left: 6px; /* Kompenzace za border, aby text neuskočil */
}

.track-row .track-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-row .track-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #777;
    margin-top: 2px;
}

.track-row .track-meta .track-date {
    font-weight: 600;
    color: #555;
}

/* --- Nové styly pro Detail Trasy --- */
#detail-content {
    font-size: 13px;
}

.track-preview {
    display: none;
    color: #f39c12; 
    font-size: 11px; 
    font-weight: bold; 
    margin-bottom: 5px;
}

.detail-title {
    font-size: 16px;
    color: #2c3e50;
    margin: 0;
}

.detail-date {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 0;
}

.detail-link {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 0;
}

.detail-link a {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.detail-tags-container {
    margin-top: 10px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag-badge {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    /*border: 1px solid rgba(0,0,0,0.1); /* Jemný rámeček pro lepší kontrast */
    /*transition: transform 0.1s ease;*/
}

.tag-badge:hover {
    /*transform: translateY(-1px);*/
}

.detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
}

.stat-item {
    text-align: left;
}

.stat-value {
    font-weight: bold;
    font-size: 14px;
    color: #2c3e50;
}

.stat-label {
    font-size: 10px;
    color: #95a5a6;
    text-transform: uppercase;
}

.detail-section {
    margin-top: 15px;
}

.detail-section h3 {
    font-size: 12px;
    color: #34495e;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 3px;
    margin-bottom: 8px;
}

.detail-description {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

#profile-graph {
    width: 100%;
    height: 120px;
    background: #fff;
    border: 1px solid #ddd;
    cursor: crosshair;
    border-radius: 3px;
}

#graph-tooltip {
    font-size: 11px;
    color: #555;
    height: 16px;
    text-align: center;
    margin-top: 4px;
}

/* --- Styly pro Import Modal --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.modal-content {
    background: white; padding: 25px; border-radius: 8px;
    width: 500px; max-width: 90%; box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex; flex-direction: column;
}
.modal-content h2 { margin-bottom: 15px; font-size: 18px; color: #2c3e50; }
.drop-zone {
    border: 2px dashed #bdc3c7; padding: 30px 10px; text-align: center;
    border-radius: 6px; background: #fafafa; transition: all 0.2s ease;
    color: #7f8c8d;
}
.drop-zone.dragover { background: #e3f2fd; border-color: #3498db; color: #2980b9; }
.link-btn { color: #3498db; cursor: pointer; text-decoration: underline; font-weight: bold; }
#selected-files-list {
    max-height: 100px; overflow-y: auto; margin: 10px 0; font-size: 12px;
    color: #555; list-style: none; padding-left: 0;
}
#selected-files-list li { padding: 4px 0; border-bottom: 1px solid #eee; }
#import-urls {
    width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid #ccc;
    border-radius: 4px; resize: vertical; font-family: monospace; font-size: 12px;
}
#import-urls:focus { border-color: #3498db; outline: none; }
#import-status { margin-top: 10px; font-weight: bold; color: #27ae60; font-size: 13px; height: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-actions button { padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
.modal-actions button.primary { background: #3498db; color: white; }
.modal-actions button.primary:hover { background: #2980b9; }
.modal-actions button:not(.primary) { background: #ecf0f1; color: #333; }
.modal-actions button:not(.primary):hover { background: #bdc3c7; }



/* Styly pro formuláře (Editace) */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 13px; color: #333; }
.form-group input, .form-group textarea { 
    width: 100%; padding: 8px; border: 1px solid #ccc; 
    border-radius: 4px; box-sizing: border-box; font-size: 13px;
}
.form-group input:focus, .form-group textarea:focus { 
    border-color: #3498db; outline: none; box-shadow: 0 0 3px rgba(52, 152, 219, 0.5);
}
#edit-status { font-weight: bold; font-size: 13px; height: 18px; text-align: right; }



.auth-status { font-weight: bold; font-size: 13px; height: 18px; text-align: left; margin-top: -10px; margin-bottom: 10px; }



/* --- Styly pro Autocomplete Našeptávač --- */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #3498db;
    color: white;
}




/* --- Styly pro Dropdown Menu --- */
.menu-item { position: relative; }
.dropdown-content {
    display: none;
    position: absolute;
    left: 0px;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    list-style: none;
    padding: 0;
    border-radius: 4px;
}
.menu-item:hover .dropdown-content {
    display: block;
}
.dropdown-content .dropdown-item, .dropdown-content .dropdown-divider {
    color: black;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    cursor: pointer;
}
.dropdown-content .dropdown-item:hover { background-color: #f1f1f1; }
.dropdown-content .dropdown-item.active { font-weight: bold; background-color: #e0e0e0; }
.dropdown-content .dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background-color: #ddd;
    padding: 0;
}

/* --- Styly pro Editor Stylů --- */
.style-list-panel { flex: 0 0 200px; }
.style-list-panel h3 { font-size: 14px; margin-bottom: 10px; }
#style-editor-list { list-style: none; padding: 0; margin: 0; border: 1px solid #ccc; border-radius: 4px; max-height: 350px; overflow-y: auto; }
#style-editor-list li { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #eee; }
#style-editor-list li:last-child { border-bottom: none; }
#style-editor-list li:hover { background: #f0f0f0; }
#style-editor-list li.active { background: #3498db; color: white; font-weight: bold; }

.small-btn { width: 100%; margin-top: 10px; padding: 6px; background: #ecf0f1; border: 1px solid #bdc3c7; border-radius: 3px; cursor: pointer; }
.small-btn:hover { background: #dcdcdc; }

.style-editor-panel { flex: 1; display: flex; flex-direction: column; }
#style-editor-content { font-family: 'Courier New', Courier, monospace; font-size: 13px; flex-grow: 1; }
#style-editor-status { font-weight: bold; font-size: 13px; height: 18px; text-align: left; }
.modal-actions button.danger { background-color: #e74c3c; color: white; }
.modal-actions button.danger:hover { background-color: #c0392b; }


/* --- Styly pro indikátor řazení --- */
.sort-indicator {
    float: right;
    margin-left: 10px;
    color: #555;
}



#search-container { position: relative; }
#btn-save-view-button {
    position: absolute;
    right: 18px;
    top: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #888;
}
#btn-save-view-button:hover { color: #3498db; }


/* Doplňující styly pro editor pohledů */
.monospace { font-family: 'Courier New', Courier, monospace; }
#view-editor-details fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 15px;
    margin-top: 15px;
}
#view-editor-details legend {
    font-size: 13px;
    font-weight: bold;
    padding: 0 5px;
}
.input-group { display: flex; gap: 5px; }
.input-group input { flex-grow: 1; }
.input-group button { white-space: nowrap; padding: 0 10px; }

#view-shared-users-list {
    list-style: none; padding: 0; margin: 5px 0 10px 0;
    max-height: 80px; overflow-y: auto;
}
#view-shared-users-list li {
    display: flex; justify-content: space-between; align-items: center;
    background: #f9f9f9; padding: 4px 8px; border-radius: 3px;
    font-size: 13px; margin-bottom: 4px;
}
#view-shared-users-list button { background: #eee; border: 1px solid #ccc; cursor: pointer; }
#view-editor-list .view-owner-indicator { font-size: 10px; color: #888; }

/* Oprava a vylepšení seznamu pohledů */
#view-editor-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-height: 350px;
    overflow-y: auto;
    background: #fff;
}

#view-editor-list li {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column; /* Název a pod tím indicator */
    gap: 2px;
    transition: background 0.2s;
}

#view-editor-list li:last-child {
    border-bottom: none;
}

#view-editor-list li:hover {
    background: #f5f5f5;
}

#view-editor-list li.active {
    background: #3498db;
    color: white;
}

#view-editor-list li.active .view-owner-indicator {
    color: #e0e0e0; /* Světlejší pro čitelnost na modrém pozadí */
}

#view-editor-list .view-name {
    font-weight: 600;
    font-size: 13px;
}

#view-editor-list .view-owner-indicator {
    font-size: 10px;
    color: #888;
}

/* Zajištění, aby levý panel držel výšku s pravým */
.style-list-panel {
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

button:disabled {
    background-color: #e0e0e0 !important; /* Šedé pozadí */
    color: #a0a0a0 !important;            /* Šedý text */
    border-color: #d1d1d1 !important;     /* Světlejší rámeček */
    cursor: not-allowed;                  /* Změna kurzoru na "zakázáno" */
    opacity: 0.7;                         /* Snížení průhlednosti */
    box-shadow: none;                     /* Odstranění případných stínů */
    pointer-events: none;                 /* Zabrání hover efektům a klikání */
}

/* Pokud používáte specifické třídy jako .danger, ujistěte se, že :disabled má vyšší prioritu */
.modal-actions button.danger:disabled {
    background-color: #f5b7b1; /* Velmi světle červená/šedá pro zachování nádechu nebezpečí */
    color: #ffffff;
}

