/* === Reset et base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* === Layout === */
body { display: flex; flex-direction: column; }

#app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #003366;
    color: white;
    font-size: 14px;
    z-index: 10;
}
#app-header .header-title strong { font-size: 16px; }
#btn-aide {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}

#app-main { display: flex; flex: 1; overflow: hidden; }

/* === Sidebar === */
#sidebar {
    width: 320px;
    min-width: 320px;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#sidebar h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
#sidebar section { padding-bottom: 12px; border-bottom: 1px solid #ddd; }
#sidebar section:last-child { border-bottom: none; }

#search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
#search-results {
    list-style: none;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
}
#search-results li {
    padding: 6px 8px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 3px;
}
#search-results li:hover { background: #e0e0e0; }

/* === Carte === */
#map-container { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

/* === Footer === */
#app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px;
    background: #f0f0f0;
    border-top: 1px solid #ddd;
    font-size: 11px;
    color: #666;
}

/* === Contrôle des couches === */
.layer-group { margin-bottom: 8px; }
.layer-group-title {
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.layer-group-title .arrow { transition: transform 0.2s; }
.layer-group-title .arrow.collapsed { transform: rotate(-90deg); }
.layer-group-content { padding-left: 4px; }
.layer-group-content.collapsed { display: none; }
.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 4px 20px;
    font-size: 13px;
}
.layer-item input[type="checkbox"] { cursor: pointer; }
.layer-color {
    display: inline-block;
    width: 20px;
    height: 3px;
    border-radius: 2px;
}
.layer-color.point {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* === Fiche quai === */
.hidden { display: none; }
#quai-detail { font-size: 13px; }
#quai-detail .detail-header {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #003366;
}
#quai-detail .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}
#quai-detail .detail-label { color: #666; }
#quai-detail .detail-value { font-weight: 500; text-align: right; max-width: 60%; }
#quai-detail .detail-separator { height: 1px; background: #ddd; margin: 8px 0; }
#quai-detail .detail-actions { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
#quai-detail .detail-actions button {
    padding: 8px;
    border: 1px solid #003366;
    background: white;
    color: #003366;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
#quai-detail .detail-actions button:hover { background: #003366; color: white; }

/* === Routing === */
#routing-controls { font-size: 13px; }
.routing-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.routing-input label {
    font-weight: 600;
    min-width: 16px;
}
.routing-input input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}
.routing-marker-a { color: #2ecc71; }
.routing-marker-b { color: #e74c3c; }
#routing-result { margin-top: 12px; }
.routing-summary {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
}
.routing-quais-list { list-style: none; }
.routing-quais-list li {
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* === Responsive (tablette) === */
@media (max-width: 768px) {
    #app-main { flex-direction: column-reverse; }
    #sidebar {
        width: 100%;
        min-width: unset;
        max-height: 40vh;
        border-right: none;
        border-top: 1px solid #ddd;
    }
}
