* {
    margin: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    margin: 0;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-image: url('background-image.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.main-container {
    display: flex;
    flex-direction: column;
    justify-content: center;  /* centrage vertical */
    align-items: center;      /* centrage horizontal */
    min-height: 100vh;        /* prend toute la hauteur de la fenêtre */
    padding: 20px;
}


.glass-container {
    width: 300px;
    height: 350px;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    border: 1px solid #fff;
}

.glass-container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: -1;
}

.login-box {
    max-width: 250px;
    margin: 0 auto;
    text-align: center;
}

h2 {
    color: #fff;
    margin-top: 30px;
    margin-bottom: -20px;
}

h2.image-tools {
    margin-top: 0px;
    margin-bottom: 20px;
}

form {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}

input {
    padding: 10px;
    margin-top: 25px;
    border: none;
    border-radius: 10px;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    font-size: 13px;
}

input::placeholder {
    color: #fff;
}

input:focus {
    outline: none;
}

.options {
    display: flex;
    align-items: center;
    margin-top: 15px;
    font-size: 12px;
    color: white;
}

.options input {
    margin-right: 5px;
    margin-top: 0px;
}

.options a {
    text-decoration: none;
    color: white;
    margin-left: auto;
}

button {
    background: #fff;
    color: black;
    padding: 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 15px;
}

button:hover {
    background: transparent;
    color: white;
    outline: 1px solid #fff;
}

p {
    font-size: 12px;
    color: #fff;
    margin-top: 15px;
}

#register {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
}

.flash-messages {
    list-style: none;
    padding: 10px;
    margin: 10px 0;
    background: rgba(255, 0, 0, 0.3);
    color: white;
    border-radius: 5px;
    font-size: 12px;
}

/* NAVIGATION GLASS */
.glass-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
    padding: 15px 30px;
}

.glass-navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.glass-navbar ul li a {
    color: white;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}

.glass-navbar ul li a:hover {
    color: #ffdaff;
}

/* DASHBOARD GRID */
.dashboard-grid {
    margin-top: 100px;
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    justify-items: center;
}

/* DASHBOARD CARDS */
.dashboard-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
    max-width: 300px;
}

.dashboard-card:hover {
    transform: scale(1.05);
}

.dashboard-card img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.dashboard-card h3 {
    margin-bottom: 10px;
}

.btn-card {
    margin-top: 15px;
    display: inline-block;
    background: white;
    color: black;
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-card:hover {
    background: transparent;
    color: white;
    outline: 1px solid white;
}

.dashboard-flex {
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.btn-card {
    transition: all 0.3s ease;
}

.dashboard-card {
    cursor: pointer;
}

.form-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 100px;
}

.form-content {
    width: 80%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    color: white;
}

.form-content label {
    display: block;
    margin-top: 20px;
    font-weight: bold;
}

.form-content input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid white;
    background: transparent;
    color: white;
}

#editor {
    margin-top: 10px;
    background: white;
    color: black;
    height: 300px;
    border-radius: 10px;
    padding: 10px;
}

.ql-editor,
.ql-editor * {
    color: black !important;
}

.models-title {
    font-size: 2em;
    margin-top: 60px;
    color: white;
    text-align: center;
}

.models-tools {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.models-tools div {
    margin: 0 10px;
}

.models-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.model-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.model-actions form{
    margin: 0;
}

.searchInput{
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 250px;
    margin-top: 0px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.models-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-top: 30px;
}


.model-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 25px;
    width: 320px;
    color: white;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.model-card h3 {
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
}

.model-content {
    color: black;
    height: 150px;
    overflow: hidden;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    cursor: pointer;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
}

.model-content:hover {
    background: #d362ff85;
}

/* Bouton de base */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin: 0;
    transition: background-color 0.2s ease;
}

/* Modifier */
.btn-edit {
    background-color: #f1c40f;
    color: #2c3e50;
}
.btn-edit:hover {
    background-color: #f39c12;
}

/* PDF */
.btn-pdf {
    background-color: #3498db;
    color: white;
}
.btn-pdf:hover {
    background-color: #2980b9;
}

/* Supprimer */
.btn-delete {
    background-color: #e74c3c;
    color: white;
}
.btn-delete:hover {
    background-color: #c0392b;
}

#flash-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.flash-message {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: bold;
    opacity: 0;
    animation: fadein 0.5s forwards, fadeout 0.5s 2s forwards;
}

.flash-message.success { background-color: #28a745; }
.flash-message.error { background-color: #dc3545; }
.flash-message.info { background-color: #17a2b8; }

@keyframes fadein {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeout {
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

.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: 10000;
  }
  .modal.hidden { display: none; }
  
  .modal-content {
    padding: 20px; border-radius: 8px;
    text-align: center;
  }
  .modal-content button { margin: 10px; }



.modal-content-variables h3 {
    margin-bottom: 1em;
    text-align: center;
    font-size: 1.3em;
}

.modal-content-variables .close {
    position: absolute;
    top: 10px; right: 15px;
    cursor: pointer;
    font-size: 1.5em;
    color: #888;
}

.modal-content-variables {
    background: #fff;
    padding: 2em;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;  /* 80% de la hauteur de la fenêtre */
    overflow-y: auto;  /* scroll vertical si trop de champs */
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    font-family: "Segoe UI", sans-serif;
    color: #333;
    position: relative;
}

#formFields {
    display: flex;
    flex-direction: column;
    gap: 1em;
    flex-grow: 1;
}

#formFields div {
    display: flex;
    flex-direction: column;
}

#formFields label {
    font-weight: bold;
    margin-bottom: 0.3em;
}

#formFields input {
    padding: 0.5em 1em;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0px;
    color : #333;
}

.copy{
    background-color: #d283ff;
}
.copy:hover {
    background-color: #9643c0;
    color: white;
}

.dashboard-card-link {
    text-decoration: none;
    display: block;
    color: inherit;
}


.video-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
}

#video {
    display: block;
    max-width: 100%;
    height: auto;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none;
    /* Assurer que l'overlay suit exactement la vidéo */
    transform-origin: top left;
}

table.scan-table {
    width: 80%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    color: white;
    font-size: 16px;
  }
  
  .scan-table th {
    text-align: left;
    text-transform: uppercase;
    color: white;
    font-weight: bold;
    padding: 12px 15px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
  }
  
  .scan-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
  }
  
  .scan-table a {
    color: white;
    text-decoration: none;
    word-break: break-all;
  }
  
  .scan-table .btn {
    margin-right: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: white;
  }
  
  .scan-table .btn-jpg {
    background-color: #2e86c1;
  }
  
  .scan-table .btn-pdf {
    background-color: #27ae60;
  }
  
  .scan-table .btn-delete {
    background-color: #c0392b;
  }

  .modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
  }
  
  .modal.hidden {
    display: none;
  }
  
  .modal-content {
    background: #1a1a1a;
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    width: 300px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
  }
  
  #loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-size: 1.2em;
  }
  
  #loading-overlay .spinner {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1em;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
.hidden{
    display: none !important;
}
  