/* css/trains.css - Tmavý motiv pro vlakové soupravy (vylepšená verze) */
.track-section { margin-bottom: 50px; }
.track-header { border-bottom: 2px solid #444; padding-bottom: 10px; margin-bottom: 20px; color: #e0e0e0; display: flex; align-items: center; gap: 10px; }
.train-card { background: var(--surface, #1e1e1e); border: 1px solid var(--border, #333); border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); position: relative; border-left: 5px solid #555; }
.border-1_tk { border-left-color: #3498db; }
.border-2_tk { border-left-color: #e67e22; }
.border-lokal { border-left-color: #2ecc71; }
.border-none { border-left-color: #95a5a6; opacity: 0.8; }

.train-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.train-title { margin: 0; font-size: 1.4em; color: var(--text, #fff); }
.train-meta { display: flex; gap: 10px; font-size: 0.9em; }
.meta-badge { background: #2b2b2b; border: 1px solid #444; padding: 5px 10px; border-radius: 4px; color: #ccc; display: flex; align-items: center; gap: 5px; }
.meta-badge.highlight { background: #34495e; color: #fff; border-color: #4a90e2; }

/* VIZUÁLNÍ ZOBRAZENÍ VLAKU */
.train-composition { display: flex; gap: 4px; overflow-x: auto; padding: 10px 5px; align-items: stretch; }
.train-unit { padding: 10px 12px; border-radius: 4px; font-size: 0.85em; white-space: nowrap; border: 1px solid #444; position: relative; box-shadow: 2px 2px 5px rgba(0,0,0,0.3); display: flex; flex-direction: column; justify-content: center; align-items: center; flex-shrink: 0; }
.train-unit > span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; display: block; }
.train-unit:not(:last-child)::after { content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); width: 6px; height: 4px; background: #666; z-index: 1; }

.train-loco { background: linear-gradient(135deg, #c0392b, #e74c3c); color: white; font-weight: bold; border-color: #c0392b; min-width: 120px; }
.loco-addr { background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 3px; font-family: monospace; font-size: 0.85em; margin-top: 5px; }
.train-wagon { background: #2c3e50; color: #ecf0f1; min-width: 100px; text-align: center; }
.train-wagon > span { max-width: 120px; }

/* Poznámky */
.train-notes { margin-top: 15px; padding: 12px; background: rgba(74, 144, 226, 0.1); border-left: 3px solid #4a90e2; border-radius: 4px; font-size: 0.9em; color: #b0d4ff; }

/* Tlačítka Akcí */
.train-actions { position: absolute; top: 15px; right: 15px; display: flex; gap: 10px; }
.train-actions button { background: none; border: none; color: #666; cursor: pointer; font-size: 1.2em; transition: color 0.2s; }
.train-actions button:hover { color: #fff; }

/* --- FORMULÁŘ --- */
.train-form { background: var(--surface, #1e1e1e); padding: 20px; border-radius: 10px; border: 1px solid var(--border, #333); margin-bottom: 40px; }
.train-form input, .train-form select, .train-form textarea { width: 100%; padding: 10px; background-color: #2d2d2d; border: 1px solid #444; color: white; border-radius: 5px; box-sizing: border-box; font-family: inherit; }
.train-form input:focus, .train-form select:focus, .train-form textarea:focus { outline: none; border-color: #4a90e2; }
.form-group label { display: block; margin-bottom: 5px; font-size: 0.9em; color: #aaa; font-weight: bold; }

/* SESTAVOVAČ SOUPRAVY */
.composition-builder { background: #111; border: 1px dashed #444; padding: 15px; border-radius: 5px; margin-bottom: 15px; }
.builder-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.builder-actions { display: flex; gap: 10px; }
.builder-actions button { background: #34495e; color: white; border: none; padding: 8px 12px; cursor: pointer; border-radius: 4px; font-weight: bold; transition: background 0.2s; }
.builder-actions button:hover { background: #4a90e2; }
#preview-train { min-height: 50px; display: flex; gap: 4px; overflow-x: auto; padding: 10px 5px; align-items: stretch; }

/* Vůz v náhledu sestavovače */
.preview-wagon { position: relative; }
.remove-wagon-btn {
    position: absolute; top: -8px; right: -8px;
    background: #e74c3c; color: white; border: none;
    width: 20px; height: 20px; border-radius: 50%;
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    font-weight: bold; z-index: 2;
    opacity: 0; transition: opacity 0.2s;
}
.preview-wagon:hover .remove-wagon-btn { opacity: 1; }

/* KNIHOVNA VOZŮ (MODAL) */
.vehicle-picker-modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); justify-content: center; align-items: center; }
.vehicle-picker-content { background: #2b2b2b; padding: 20px; border-radius: 8px; width: 90%; max-width: 800px; max-height: 80vh; overflow-y: auto; }
.vehicle-picker-content h3 { margin-top: 0; }
.vehicle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

.vehicle-item { background: #333; padding: 10px; border-radius: 4px; cursor: pointer; transition: background 0.2s; font-size: 0.9em; position: relative; }
.vehicle-item:hover { background: #4a90e2; }
.vehicle-item small { color: #888; }
/* Styl pro zašedlé (již použité) vozy */
.vehicle-item.used {
    background: #222; color: #555; cursor: not-allowed;
    text-decoration: line-through;
}
.used-info {
    position: absolute; top: 5px; right: 5px;
    background: #f1c40f; color: #111; font-size: 0.8em;
    padding: 1px 5px; border-radius: 3px; font-weight: bold;
}