/* General styles */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f6fa;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left img {
    max-height: 40px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
}

#notification-bell {
    background-color: #007bff;
    color: white;
    font-size: 18px;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#notification-bell:hover {
    background-color: #0056b3;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #007bff;
    color: white;
    height: calc(100vh - 60px);
    position: fixed;
    left: 0;
    top: 60px;
    z-index: 900;
    display: flex;
    flex-direction: column;
}

.sidebar ul {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar ul li {
    margin: 0;
}

.sidebar ul li a {
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    transition: background-color 0.3s;
}

.sidebar ul li a:hover {
    background-color: rgba(255,255,255,0.1);
}

.sidebar ul li a.active {
    background-color: rgba(255,255,255,0.2);
    font-weight: bold;
}

.sidebar .nav-icon {
    margin-right: 10px;
    font-size: 20px;
}

#user-name {
    margin: 10px;
    text-align: center;
    font-size: 14px;
    color: white;
    padding-bottom: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Container */
.container {
    margin-left: 290px;
    margin-right: 60px;
    margin-top: 80px;
    padding: 20px;
    width: calc(100% - 350px);
    max-width: 1200px;
    display: none;
    box-sizing: border-box;
}

.container.active {
    display: block;
}

/* Contenu interne avec marges */
.container h2,
.container .filters,
.container table,
.container .theme-buttons,
.container .login-form,
.container .forgot-password-form,
.container .statistics,
.container button,
.container .settings-section {
    margin-left: 20px;
    margin-right: 60px;
}

/* Login form */
.login-form, .forgot-password-form {
    max-width: 320px;
    margin: 40px auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.login-form:hover, .forgot-password-form:hover {
    transform: translateY(-2px);
}

.form-group {
    position: relative;
    margin-bottom: 28px;
}

.form-group label {
    position: absolute;
    top: -18px;
    left: 12px;
    font-size: 12px;
    color: #007bff;
    background: #ffffff;
    padding: 0 4px;
    z-index: 1;
    transition: all 0.2s ease;
}

.form-group .input-wrapper {
    position: relative;
}

.form-group .input-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 16px;
    color: #007bff;
    z-index: 1;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
}

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

.form-group input:not(:placeholder-shown) + label,
.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group select:focus + label {
    top: -18px;
    font-size: 12px;
}

.form-group select[multiple] {
    height: 100px;
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group.checkbox input {
    width: auto;
    margin: 0;
}

.login-form button, .forgot-password-form button {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.login-form button:hover, .forgot-password-form button:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.login-form a, .forgot-password-form a {
    display: block;
    text-align: center;
    margin-top: 12px;
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

.login-form a:hover, .forgot-password-form a:hover {
    color: #0056b3;
}

/* Thèmes */
.theme-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.theme-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    max-width: 600px;
}

.theme-button {
    padding: 15px 30px;
    font-size: 18px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
}

.theme-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.theme-button.active {
    transform: scale(1);
}

.theme-button:not(.active) {
    transform: scale(0.75);
    opacity: 0.8;
}

.theme-button[data-theme="La gouvernance"] {
    background-color: #fab56a;
    color: #333;
}

.theme-button[data-theme="Le positionnement et les valeurs de la Mission Locale"] {
    background-color: #a7dac9;
    color: #333;
}

.theme-button[data-theme="L'ancrage territorial et partenarial de la Mission Locale"] {
    background-color: #87cefa;
    color: #333;
}

.theme-button[data-theme="L'offre de service de la Mission Locale"] {
    background-color: #ff7f7e;
    color: #fff;
}

.theme-button[data-theme="Le management et le pilotage de l'activité"] {
    background-color: #e61920;
    color: #fff;
}

/* Critères container */
.criteres-container {
    display: none;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.criteres-container.active {
    display: flex;
}

.criteres-container[data-theme="La gouvernance"] {
    background-color: rgba(250, 181, 106, 0.3);
}

.criteres-container[data-theme="Le positionnement et les valeurs de la Mission Locale"] {
    background-color: rgba(167, 218, 201, 0.3);
}

.criteres-container[data-theme="L'ancrage territorial et partenarial de la Mission Locale"] {
    background-color: rgba(135, 206, 250, 0.3);
}

.criteres-container[data-theme="L'offre de service de la Mission Locale"] {
    background-color: rgba(255, 127, 126, 0.3);
}

.criteres-container[data-theme="Le management et le pilotage de l'activité"] {
    background-color: rgba(230, 25, 32, 0.3);
}

.critere-bubble {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.critere-bubble:hover {
    transform: translateY(-2px);
}

.critere-bubble a {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
}

.critere-bubble p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

/* Tables */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    font-size: 14px;
}

table th {
    background: #007bff;
    color: white;
    font-weight: bold;
}

table td a {
    color: #007bff;
    text-decoration: none;
}

table td a:hover {
    text-decoration: underline;
}

table td button.edit-critere {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

table td button.edit-critere:hover {
    background: #0056b3;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filters select, .filters button {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 150px;
}

.filters button {
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filters button:hover {
    background: #0056b3;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #333;
}

.modal-content button[type="submit"] {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-content button[type="submit"]:hover {
    background: #0056b3;
}

.modal-content button.cancel-btn {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-content button.cancel-btn:hover {
    background: #5a6268;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .container {
        margin-left: 220px;
        margin-right: 30px;
        width: calc(100% - 250px);
        max-width: 100%;
    }
    .container h2,
    .container .filters,
    .container table,
    .container .theme-buttons,
    .container .login-form,
    .container .forgot-password-form,
    .container .statistics,
    .container button,
    .container .settings-section {
        margin-left: 15px;
        margin-right: 30px;
    }
    .theme-button:not(.active) {
        transform: scale(0.8);
    }
    .login-form, .forgot-password-form {
        max-width: 280px;
    }
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filters select, .filters button {
        min-width: 100%;
    }
}

/* ====== EDP Styles ====== */

/* Zone d’upload */
.dropzone {
  margin: 20px 0;
  padding: 20px;
  border: 2px dashed #007bff;
  border-radius: 10px;
  background: #eef5ff;
  text-align: center;
  color: #333;
  cursor: pointer;
  transition: background 0.3s;
}
.dropzone:hover { background: #e0edff; }

/* Grille documents */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px,1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 12px;
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-3px); }

/* Chips statuts */
.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  color: white;
}
.chip.ok { background: #28a745; }
.chip.warn { background: #ffc107; color:#333; }
.chip.err { background: #dc3545; }

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 20px;
}
.toolbar .btn, .toolbar .btn-ghost {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #007bff;
  background: #007bff;
  color: white;
  cursor: pointer;
}
.toolbar .btn-ghost {
  background: transparent;
  color: #007bff;
}

/* Aperçu */
.preview-drawer {
  margin-top: 20px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
}
.preview-body {
  padding: 10px;
}
.preview-body iframe {
  width: 100%;
  height: 65vh;
  border: none;
  border-radius: 6px;
  background: #fafafa;
}
.pv-meta { margin-top: 10px; color: #666; font-size: 14px; }

/* ====== Mode sombre (dark mode) ====== */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1e1e1e;
    color: #f5f5f5;
  }

  .header {
    background-color: #2c2c2c;
    border-bottom: 1px solid #444;
  }

  .header-right #notification-bell {
    background-color: #0056b3;
  }

  .sidebar {
    background-color: #2c2c2c;
    color: #eee;
  }
  .sidebar ul li a {
    color: #eee;
  }
  .sidebar ul li a:hover {
    background-color: rgba(255,255,255,0.08);
  }
  .sidebar ul li a.active {
    background-color: rgba(255,255,255,0.15);
  }
  #user-name { color: #ccc; }

  .container {
    background-color: #1e1e1e;
  }

  .login-form, .forgot-password-form, .card, table, .critere-bubble, .modal-content {
    background-color: #2c2c2c;
    color: #f5f5f5;
    border-color: #444;
  }
  table th {
    background: #0056b3;
  }
  table td, table th {
    border-color: #444;
  }

  /* Thèmes et critères */
  .critere-bubble a { color: #4da3ff; }
  .theme-button { color: #fff; }

  /* EDP : dropzone, grid, preview */
  .dropzone {
    border-color: #4da3ff;
    background: #2a2a2a;
    color: #ddd;
  }
  .dropzone:hover { background: #333; }

  .card {
    background: #2c2c2c;
    border: 1px solid #444;
  }
  .card:hover { transform: translateY(-3px); }

  .chip.ok { background: #2e7d32; }
  .chip.warn { background: #f9a825; color: #111; }
  .chip.err { background: #c62828; }

  .toolbar .btn {
    background: #4da3ff;
    border-color: #4da3ff;
    color: #fff;
  }
  .toolbar .btn-ghost {
    border-color: #4da3ff;
    color: #4da3ff;
  }

  .preview-drawer {
    background: #2c2c2c;
    border: 1px solid #444;
  }
  .preview-body iframe {
    background: #111;
  }
  .pv-meta { color: #bbb; }
}

