/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
    overflow: hidden;
}

/* Layout principal */
#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout Mobile - Carte en haut, interface en bas */
@media (max-width: 767px) {
    #app {
        flex-direction: column;
    }
    
    #map-container {
        height: 50vh;
        width: 100%;
        position: relative;
    }
    
    .mobile-interface {
        height: 50vh;
        background: white;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .mobile-header {
        background: #2c3e50;
        color: white;
        padding: 0.75rem 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }
    
    .mobile-header h1 {
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .mobile-actions {
        display: flex;
        gap: 0.5rem;
    }
    
    .mobile-actions button {
        background: rgba(255,255,255,0.2);
        border: none;
        color: white;
        padding: 0.4rem 0.8rem;
        border-radius: 4px;
        font-size: 0.8rem;
        cursor: pointer;
    }
    
    .mobile-actions button:hover {
        background: rgba(255,255,255,0.3);
    }
    
    /* Liste d'exposants mobile */
    .mobile-exposants-list {
        flex: 1;
        overflow-y: auto;
        padding: 0.5rem;
    }
    
    .mobile-exposant-item {
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-exposant-item:hover {
        background: #e9ecef;
        transform: translateY(-1px);
    }
    
    .mobile-exposant-item.selected {
        background: #e3f2fd;
        border-color: #2196f3;
    }
    
    .mobile-exposant-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.25rem;
    }
    
    .mobile-exposant-nom {
        font-weight: 600;
        font-size: 0.95rem;
        color: #2c3e50;
    }
    
    .mobile-exposant-stand {
        background: #6c757d;
        color: white;
        padding: 0.2rem 0.5rem;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 500;
    }
    
    .mobile-exposant-details {
        font-size: 0.85rem;
        color: #6c757d;
        line-height: 1.3;
    }
    
    .mobile-exposant-category {
        display: inline-block;
        padding: 0.2rem 0.5rem;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 500;
        margin-top: 0.25rem;
    }
    
    /* Interface d'édition mobile */
    .mobile-edit-panel {
        background: #fff;
        border-top: 2px solid #2c3e50;
        padding: 1rem;
        display: none;
        max-height: 45vh;
        overflow-y: auto;
    }
    
    .mobile-edit-panel.show {
        display: block;
    }
    
    .mobile-edit-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #eee;
    }
    
    .mobile-edit-title {
        font-size: 1rem;
        font-weight: 600;
        color: #2c3e50;
    }
    
    .mobile-edit-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #6c757d;
        cursor: pointer;
        padding: 0.25rem;
    }
    
    .mobile-form-group {
        margin-bottom: 0.75rem;
    }
    
    .mobile-form-group label {
        display: block;
        font-size: 0.85rem;
        font-weight: 500;
        color: #495057;
        margin-bottom: 0.25rem;
    }
    
    .mobile-form-group input,
    .mobile-form-group select {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid #ced4da;
        border-radius: 4px;
        font-size: 0.9rem;
    }
    
    .mobile-form-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }
    
    .mobile-form-actions button {
        flex: 1;
        padding: 0.75rem;
        border: none;
        border-radius: 4px;
        font-weight: 500;
        cursor: pointer;
    }
    
    .mobile-btn-primary {
        background: #2c3e50;
        color: white;
    }
    
    .mobile-btn-secondary {
        background: #6c757d;
        color: white;
    }
    
    .mobile-btn-danger {
        background: #dc3545;
        color: white;
    }
    
    /* Styles pour les checkboxes mobiles */
    .mobile-checkbox-container {
        display: flex;
        align-items: center;
        cursor: pointer;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .mobile-checkbox-container input[type="checkbox"] {
        margin-right: 0.5rem;
        transform: scale(1.2);
    }
    
    .mobile-form-select {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid #ced4da;
        border-radius: 4px;
        font-size: 0.9rem;
        background: white;
    }
}

/* Panneau de contrôle - caché sur mobile, visible sur desktop */
.control-panel {
    display: none;
}

.panel-header {
    padding: 1rem 1rem 0.5rem 1rem;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.panel-actions {
    padding: 0.5rem 1rem 1rem 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Contrôles de carte */
.map-controls {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    flex-shrink: 0;
}

.map-controls label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #555;
}

.map-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.map-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.save-indicator {
    margin-top: 0.5rem;
    text-align: center;
}

.save-status {
    font-size: 0.8rem;
    color: #28a745;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-status.show {
    opacity: 1;
}

.save-status.saving {
    color: #ffc107;
}

.save-status.error {
    color: #dc3545;
}

/* Contrôles de tri */
.sort-controls {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    flex-shrink: 0;
}

.sort-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.sort-field {
    flex: 1;
}

.sort-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #555;
}

.sort-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.sort-direction {
    flex-shrink: 0;
}

.btn-sort-direction {
    background: #007bff;
    border: 1px solid #0056b3;
    border-radius: 4px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

.btn-sort-direction:hover {
    background: #0056b3;
    border-color: #004085;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-sort-direction:active {
    transform: translateY(0);
    background: #004085;
}

.sort-icon {
    transition: transform 0.2s ease;
    user-select: none;
}

.btn-sort-direction.desc .sort-icon {
    transform: rotate(180deg);
}

/* Sélecteurs de catégorie */
.category-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.category-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.category-select-inline {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.category-select-inline:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Options colorées dans les sélecteurs */
.category-option {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Indicateur de catégorie dans la liste des exposants */
.exposant-category-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Liste des exposants */
.exposants-list {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
}

.empty-state p:first-child {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.empty-state small {
    color: #888;
}

.exposant-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exposant-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.exposant-item.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.exposant-name {
    font-weight: 600;
    margin-bottom: 0;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Étiquette dépliable pour les contacts */
.exposant-contact-info {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
    line-height: 1.3;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.25s ease, margin-top 0.25s ease;
    opacity: 0;
}

.exposant-item:hover .exposant-contact-info {
    max-height: 60px;
    opacity: 1;
}

.exposant-name:hover {
    color: #007bff;
}

/* Les styles pour stand-actions, stand-info, etc. sont utilisés ailleurs dans l'app */
.stand-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Carte */
#map-container {
    flex: 1;
    position: relative;
}

.map-container {
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
}

/* Mode positionnement */
.positioning-mode #map {
    border: 3px solid #007bff;
    border-radius: 4px;
}

.positioning-mode::after {
    content: "🎯 Cliquez pour positionner";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Boutons */
.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Styles pour le marqueur GPS */
.gps-marker-container {
    background: transparent !important;
    border: none !important;
}

.gps-marker {
    font-size: 24px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 
                 0 0 20px rgba(255, 255, 255, 0.6),
                 0 0 30px rgba(255, 255, 255, 0.4);
    animation: gps-pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

@keyframes gps-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Styles pour la synchronisation Google Sheets */
.sync-section {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.sync-section h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.sync-section p {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.9rem;
}

.sync-status-info {
    padding: 1rem;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.sync-config {
    padding: 1rem;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 4px;
    margin-top: 1rem;
}

.sync-config ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.sync-config li {
    margin: 0.25rem 0;
    color: #666;
}

.sync-result-success {
    padding: 1rem;
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 4px;
    color: #2e7d32;
    margin-top: 1rem;
}

.sync-result-error {
    padding: 1rem;
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 4px;
    color: #c62828;
    margin-top: 1rem;
}

.sync-result-info {
    padding: 1rem;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 4px;
    color: #1976d2;
    margin-top: 1rem;
}

/* Configuration Google Sheets dans le panneau */
.google-sheets-config {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.google-sheets-config label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.google-sheet-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.google-sheet-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.google-sheet-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 0;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 0.5rem;
}

.config-status {
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    min-height: 20px;
}

.config-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.config-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.config-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Configuration automatique des stands */
.stand-auto-config {
    margin: 1rem 0;
    padding: 1rem;
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
}

.stand-auto-config .checkbox-container {
    font-size: 0.9rem;
    color: #2c5282;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Panneau de positionnement */
.position-panel {
    background: #e3f2fd;
    border: 2px solid #007bff;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

.position-panel.hidden {
    display: none;
}

/* Atténuer la liste des exposants en mode positionnement - Désactivé car le panneau est maintenant à droite */
/* .control-panel:has(.position-panel:not(.hidden)) .exposants-list {
    opacity: 0.6;
    transition: opacity 0.3s ease;
} */

.position-content {
    padding: 1rem;
}

.position-content h3 {
    color: #007bff;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-align: center;
}

.positioning-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.position-instruction {
    color: #0056b3;
    font-weight: 500;
    text-align: center;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px dashed #007bff;
}

.overlay-controls {
    margin-top: 1rem;
    text-align: center;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Colonne de droite - Configuration */
.config-panel {
    position: absolute;
    top: 70px;
    right: -350px;
    width: 350px;
    height: calc(100vh - 70px);
    background: white;
    border-left: 1px solid #ddd;
    transition: right 0.3s ease;
    z-index: 998;
    overflow-y: auto;
}

.config-panel.open {
    right: 0;
}

.config-placeholder {
    padding: 2rem;
    text-align: center;
    color: #666;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.placeholder-content h3 {
    margin-bottom: 1rem;
    color: #333;
}

.placeholder-content p {
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.3;
}

/* Styles pour modal de configuration PC */
.config-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (min-width: 768px) {
    .control-panel {
        position: static;
        width: 300px;
        height: 100vh;
        left: 0;
        display: flex;
        flex-direction: column;
    }
    
    .config-panel {
        position: static;
        width: 300px;
        height: 100vh;
        right: 0;
        display: block;
    }
    
    #app {
        flex-direction: row;
    }
    
    .mobile-header {
        display: none;
    }
    
    .mobile-interface {
        display: none;
    }
    
    #map-container {
        flex: 1;
        height: 100vh;
        margin: 0;
    }
}

@media (min-width: 1200px) {
    .control-panel {
        width: 350px;
    }
    
    .config-panel {
        width: 350px;
    }
}

/* Styles pour les marqueurs de stands */
.stand-marker {
    /* Pas de background ici - géré par le style inline */
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.stand-marker:hover {
    transform: scale(1.05);
    z-index: 1000;
}

.stand-marker.selected {
    box-shadow: 0 0 0 3px #ff6b35;
    transform: scale(1.1);
    z-index: 1001;
}

.stand-marker.highlighted {
    box-shadow: 0 0 0 4px #ff6b35, 0 0 20px rgba(255, 107, 53, 0.4);
    transform: scale(1.1);
    z-index: 1002;
    animation: pulse-highlight 2s ease-in-out;
}

@keyframes pulse-highlight {
    0%, 100% {
        box-shadow: 0 0 0 4px #ff6b35, 0 0 20px rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px #ff6b35, 0 0 30px rgba(255, 107, 53, 0.6);
    }
}

/* Animation pour les nouveaux éléments */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-info {
    background: #007bff;
}

/* Marqueur temporaire */
.temp-marker {
    background: #ffc107;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Étiquettes de zones (rectangles de texte) */
.zone-label-marker {
    background: transparent;
    border: none;
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
}

.zone-label-rect {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
    cursor: grab;
}

.zone-label-rect:active {
    cursor: grabbing;
}

body.label-placement-mode {
    cursor: crosshair;
}

body.label-placement-mode .zone-label-rect {
    outline: 2px dashed #007bff;
    outline-offset: 2px;
}

/* Interface du stand */
.exposant-info {
    background: #e3f2fd;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
    color: #0d47a1;
}

.orientation-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.orientation-compass {
    width: 40px;
    height: 40px;
    border: 2px solid #007bff;
    border-radius: 50%;
    position: relative;
    background: white;
}

.needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 15px;
    background: #dc3545;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    transition: transform 0.2s ease;
}

.needle::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -2px;
    width: 6px;
    height: 6px;
    background: #dc3545;
    border-radius: 50%;
}

#orientation-value {
    font-weight: bold;
    color: #007bff;
    min-width: 40px;
}

/* Amélioration des inputs */
input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

/* Bouton supprimer */
.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-warning:hover {
    background: #e0a800;
}

/* Panneau de configuration fixe */
.stand-config-panel {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

.stand-config-panel.hidden {
    display: none;
}

.config-header {
    background: #007bff;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-header h3 {
    margin: 0;
    font-size: 1rem;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.btn-close svg {
    pointer-events: none;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.config-content {
    padding: 1rem;
}

.config-content .form-group {
    margin-bottom: 1rem;
}

.config-content .form-group.form-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.config-content .form-group.form-inline label {
    margin-bottom: 0;
    min-width: 80px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.config-content .form-group.form-inline input[type="number"],
.config-content .form-group.form-inline input[type="color"] {
    flex: 1;
    max-width: 80px;
}

.config-content .form-group.form-inline input[type="text"],
.config-content .form-group.form-inline input[type="email"],
.config-content .form-group.form-inline input[type="tel"] {
    flex: 1;
    min-width: 120px;
}

.orientation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.orientation-controls input[type="number"] {
    width: 60px;
    margin: 0;
    text-align: center;
}

.orientation-controls #config-orientation-value {
    font-weight: bold;
    color: #007bff;
    min-width: 35px;
    font-size: 0.85rem;
}

.orientation-controls .orientation-compass {
    width: 30px;
    height: 30px;
}

.orientation-controls .orientation-compass .needle {
    width: 1.5px;
    height: 11px;
}

.btn-rotate {
    background: #6c757d;
    border: 1px solid #5a6268;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: white;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-rotate:hover {
    background: #5a6268;
    border-color: #545b62;
    transform: scale(1.05);
}

.btn-rotate:active {
    transform: scale(0.95);
    background: #495057;
}

.config-content h4 {
    color: #333;
    font-size: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.config-content .form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.config-content .form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.config-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.config-actions button {
    flex: 1;
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0.6rem 0.5rem;
}

/* Contrôles de direction */
.direction-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    flex: 1;
}

.horizontal-moves {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-move {
    background: #007bff;
    border: 1px solid #0056b3;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-move:hover {
    background: #0056b3;
    border-color: #004085;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-move:active {
    transform: translateY(0);
    background: #004085;
}

/* États de sélection des stands */
.stand-selected {
    background: #ffe0b3 !important;
    border-color: #ff6b35 !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.4) !important;
}

.exposant-item.has-selected-stand {
    border-color: #2196f3;
    box-shadow: 0 0 0 1px rgba(33, 150, 243, 0.3);
}

/* Modal de gestion des catégories */
.categories-modal-content {
    max-width: 600px;
    width: 95%;
    max-height: 80vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.modal-header .btn-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-header .btn-close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-header .close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-header .close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-header .close svg {
    pointer-events: none;
}

.categories-section {
    margin-bottom: 2rem;
}

.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.categories-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #555;
}

.categories-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

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

.category-item:hover {
    background: #e9ecef;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.category-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.category-details h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.category-details p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.category-key {
    font-family: monospace;
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
    color: #495057;
    margin-left: 0.5rem;
}

.category-actions {
    display: flex;
    gap: 0.5rem;
}

.category-form-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.category-form-section h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.color-input-group input[type="text"] {
    width: 100px;
    text-align: center;
    font-family: monospace;
    text-transform: uppercase;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.btn-edit {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-delete:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.category-default-badge {
    background: #28a745;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

/* === STYLES POUR LA RENUMÉROTATION === */
.renumber-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.renumber-info p {
    margin: 0.5rem 0;
}

.renumber-options {
    margin-bottom: 1.5rem;
}

.renumber-options h4 {
    margin-bottom: 1rem;
    color: #333;
}

.renumber-options .form-group {
    margin-bottom: 1rem;
}

.renumber-options label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.renumber-options input {
    width: 100%;
    max-width: 150px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.renumber-options small {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    display: block;
}

.renumber-preview {
    margin-bottom: 1.5rem;
}

.renumber-preview h4 {
    margin-bottom: 1rem;
    color: #333;
}

.preview-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    background: #f8f9fa;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

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

.preview-section-header {
    padding: 0.4rem 0.5rem;
    margin: 0.5rem 0 0.3rem 0;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.85rem;
}

.preview-section-header:first-child {
    margin-top: 0;
}

.preview-old-number {
    color: #dc3545;
    text-decoration: line-through;
}

.preview-new-number {
    color: #28a745;
    font-weight: 500;
}

.preview-arrow {
    color: #6c757d;
}

.renumber-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.renumber-warning p {
    margin: 0;
    color: #856404;
}

/* === STYLES POUR LA SAUVEGARDE / RESTAURATION === */
.backup-info {
    margin-bottom: 0.5rem;
}

.backup-restore {
    margin-bottom: 0.5rem;
}

.backup-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.3rem;
    background: #f8f9fa;
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

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

.backup-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.backup-item-info small {
    color: #666;
    font-size: 0.8rem;
}

.backup-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 0.8rem;
    margin-top: 1rem;
}

.backup-warning p {
    margin: 0;
    color: #856404;
    font-size: 0.85rem;
}

/* === BOUTONS D'ORIENTATION RAPIDE === */
.quick-orientation-buttons {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    clear: both;
    flex-basis: 100%;
}

.btn-quick-orient {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.btn-quick-orient:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.btn-quick-orient:active {
    background: #dee2e6;
    border-color: #6c757d;
    transform: translateY(1px);
}

.btn-quick-orient.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-quick-orient.selected {
    background: #28a745;
    border-color: #28a745;
    color: white;
    font-weight: 600;
}

/* === PANNEAU IMPRESSION === */
.print-config-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.print-config-panel .config-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-config-panel .config-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.print-config-panel .config-content {
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.print-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.print-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.print-status {
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    margin-bottom: 1rem;
}

.print-status.waiting {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.print-status.selecting {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #80bdff;
}

.print-status.ready {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.print-preview {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.print-preview h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
}

.preview-info p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.preview-info span {
    color: #495057;
    font-weight: 500;
}

/* Rectangle de sélection sur la carte */
.print-selection-rectangle {
    border: 3px dashed #007bff !important;
    background: rgba(0, 123, 255, 0.1) !important;
    border-radius: 4px;
}

.print-selection-corners {
    width: 8px;
    height: 8px;
    background: #007bff;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* === SLIDER TAILLE DES NUMÉROS === */
#print-label-font-size {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#print-label-font-size::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

#print-label-font-size::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Modes d'accès */
.edit-only {
    display: none;
}

body.mode-edit .edit-only {
    display: revert;
}

.hidden {
    display: none !important;
}

/* En mode public, ne garder que la carte (masquer panneaux gauche et droit) */
body.mode-public .control-panel,
body.mode-public #control-panel,
body.mode-public .config-panel {
    display: none;
}

/* En mode visualisation, masquer la fenêtre de droite */
body.mode-view .config-panel {
    display: none;
}

/* Bouton flottant Mode sur la carte */
.mode-float-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #2c3e50;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.mode-float-btn:hover {
    transform: scale(1.1);
    background: #34495e;
}

@media (max-width: 767px) {
    .mode-float-btn {
        display: none;
    }
}

.mode-status {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
}

.mode-option:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.mode-icon {
    font-size: 1.5rem;
}

.mode-name {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
}

.mode-desc {
    margin-left: auto;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: right;
    max-width: 55%;
}

#mode-password-section .form-group,
#mode-password-change-section .form-group {
    margin-bottom: 0.75rem;
}

#mode-password-section button,
#mode-password-change-section button {
    width: 100%;
    margin-top: 0.5rem;
}

#mode-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}