/* Styles de base */
html { height:100%; }
body { height:100%; overflow:hidden; margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#000000; }

/* Hotspots techniques personnalisés */
.tech-hotspot {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid white;
    transition: all 0.3s ease;
    z-index: 100;
    color: white;
    font-weight: bold;
}

.tech-hotspot:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 25px rgba(0,0,0,0.5);
}

.tech-hotspot.has-responses::after {
    content: attr(data-responses);
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
}

/* Menu déroulant pour les notes générales */
.notes-dropdown {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.dropdown-toggle {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s;
}

.dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.95);
}

.dropdown-toggle .arrow {
    margin-left: 10px;
    transition: transform 0.3s;
}

.dropdown-toggle.open .arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    color: white;
    transition: background 0.3s;
    position: relative;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

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

.dropdown-item .note-title {
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item .note-title .category-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.dropdown-item .note-meta {
    font-size: 12px;
    color: #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-item .note-description {
    font-size: 13px;
    color: #ddd;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dropdown-item .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    z-index: 10;
}

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

/* Container de login centré en haut */
.login-container {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1200; /* au-dessus de l'interface, mais sous les fenêtres de notes (1500+) */
    min-width: 300px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form input, .login-form select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
}

.login-form button {
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.user-info-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: white;
}

.user-info-login .username {
    font-weight: bold;
    color: white;
}

.logout-btn {
    padding: 5px 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.control-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 15px;
    color: white;
    z-index: 1000;
    min-width: 200px;
}

.control-panel button {
    display: block;
    width: 100%;
    padding: 10px 20px;
    margin: 5px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.control-panel button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #5a67d8 0%, #6b4199 100%);
}

.control-panel button.technical {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
}

.control-panel button.technical:hover {
    background: linear-gradient(135deg, #357abd 0%, #2e6ba0 100%);
}

.control-panel button.admin {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.control-panel button.admin:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.control-panel button.intervenants {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.control-panel button.intervenants:hover {
    background: linear-gradient(135deg, #117a8b 0%, #0c5460 100%);
}

.control-panel button.logout {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    font-size: 12px;
    padding: 8px 15px;
}

.user-info {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 10px;
    font-size: 14px;
}

.admin-status {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 15px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 20px;
}

.close:hover {
    color: #333;
}

.modal h2 {
    color: #333;
    margin-bottom: 25px;
    clear: both;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    background: white;
    cursor: pointer;
}

/* Styles améliorés pour l'upload de fichiers */
.file-upload {
    position: relative;
    display: block;
    cursor: pointer;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 12px;
    background: white;
    border: 2px dashed #667eea;
    border-radius: 8px;
    text-align: center;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-label:hover {
    background: #f8f9ff;
    border-color: #5a67d8;
}

.file-upload-label.has-files {
    background: #e8f4f8;
    border-style: solid;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #e8f4f8;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background: white;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 14px;
}

.file-list-item .file-name {
    flex: 1;
    color: #333;
}

.file-list-item .file-size {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

.file-list-item .remove-file {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.submit-btn.info {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.creation-mode {
    cursor: crosshair !important;
}

/* Indicateur de création - IDENTIQUE À TOUR16 */
.creation-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    z-index: 1500;
    display: none;
    font-size: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.creation-mode .creation-indicator {
    display: block;
}

.technical-mode .creation-indicator {
    background: rgba(74, 144, 226, 0.95);
}

/* Popup de note amélioré avec journal intégré */
.note-popup {
    position: fixed;
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 800px;
    height: 85vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1500;
    display: none;
    overflow: hidden;
}

.note-popup.visible {
    display: flex;
    flex-direction: column;
}

.note-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: relative;
}

.note-popup-header .close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 30px;
}

.note-popup-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
}

.note-popup-header .note-meta {
    margin-top: 10px;
    font-size: 13px;
    opacity: 0.9;
}

.note-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.note-original {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.note-original .description {
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.note-original .attachments-section {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 15px;
}

.note-original .attachments-section h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.attachment-link {
    display: inline-block;
    margin: 5px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
}

.attachment-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Journal de réponses */
.responses-journal {
    margin-top: 20px;
}

.responses-journal-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.response-entry {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.response-entry.admin {
    border-left-color: #dc3545;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.response-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: #333;
}

.response-author .role-badge {
    padding: 3px 8px;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: normal;
}

.response-author .role-badge.admin {
    background: #dc3545;
}

.response-date {
    font-size: 12px;
    color: #999;
}

.response-content {
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.response-attachments {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

/* Formulaire de réponse intégré dans le popup */
.reply-form-integrated {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid #28a745;
    display: none;
}

.reply-form-integrated.active {
    display: block;
}

.reply-form-integrated h4 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.reply-form-integrated textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
    box-sizing: border-box;
}

.reply-form-integrated textarea:focus {
    outline: none;
    border-color: #28a745;
}

.reply-form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.reply-submit-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s;
}

.reply-submit-btn:hover {
    transform: translateY(-2px);
}

.reply-cancel-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.add-response-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.2s;
    margin-top: 20px;
}

.add-response-btn:hover {
    transform: translateY(-2px);
}

/* CORRECTION : Notifications petites en bas */
.notification {
    position: fixed !important;
    bottom: 20px !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 12px 24px;
    background: #4CAF50;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 3000;
    font-size: 14px;
    animation: slideUp 0.3s ease;
    max-width: 400px;
    max-height: 60px;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #2196F3;
}

/* Admin panel styles */
.admin-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    color: #333;
}

.admin-panel h3 {
    color: #dc3545;
    margin-bottom: 20px;
    border-bottom: 2px solid #dc3545;
    padding-bottom: 10px;
}

.notes-list {
    max-height: 400px;
    overflow-y: auto;
}

.note-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.note-item h4 {
    margin: 0 0 8px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-item .note-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.note-item .note-desc {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.note-item .note-attachments {
    margin: 8px 0;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.note-item .note-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.note-item .delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

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

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    font-size: 14px;
}

.tab.active {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

.tab:hover {
    background: #f8f9fa;
}

/* Upload progress */
.upload-progress {
    margin-top: 10px;
    padding: 10px;
    background: #e9ecef;
    border-radius: 6px;
    display: none;
}

.upload-progress.active {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #dee2e6;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

/* Panel des intervenants */
.intervenants-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    color: #333;
}

.intervenants-panel h3 {
    color: #17a2b8;
    margin-bottom: 20px;
    border-bottom: 2px solid #17a2b8;
    padding-bottom: 10px;
}

.intervenants-list {
    list-style: none;
    padding: 0;
}

.intervenant-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.intervenant-info {
    flex: 1;
}

.intervenant-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.intervenant-role {
    font-size: 14px;
    color: #666;
}

.intervenant-contact {
    text-align: right;
}

.intervenant-email, .intervenant-phone {
    display: block;
    font-size: 13px;
    color: #17a2b8;
    margin: 2px 0;
}

@media (max-width: 768px) {
    .control-panel, .notes-dropdown {
        top: 10px;
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .note-popup {
        width: 95%;
        height: 90vh;
    }
    
    .login-container {
        width: 90%;
        min-width: auto;
    }
}
