/* ---------- GLOBAL ---------- */
body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f6f8;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
   }
   a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.3s ease;
   }
   a:hover {
    text-decoration: underline;
    color: #0056b3;
   }
   /* ---------- CONTAINERS ---------- */
   .container,
   .dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
   }
   /* ---------- HEADER ---------- */
   .main-header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
   }
   .logo a {
    font-size: 26px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
   }
   .logo img {
    height: 50px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
   }
   .logo-text {
    margin-left: 12px;
    font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
    font-size: 18px;
    color: #003366;
    font-weight: normal;
    font-style: italic;
   }
   .nav-menu > ul {
    display: flex;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
   }
   .nav-menu ul li a {
    padding: 8px 14px;
    color: #333;
    border-radius: 4px;
   }
   .nav-menu ul li a:hover {
    background: #eee;
   }

   /* ---------- DROPDOWN MENU ---------- */
   .nav-menu ul li.dropdown {
    position: relative;
   }
   .nav-menu ul li.dropdown .dropdown-toggle {
    padding: 8px 14px;
    color: #333;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
   }
   .nav-menu ul li.dropdown .dropdown-toggle:hover {
    background: #eee;
    text-decoration: none;
   }
   .nav-menu ul li.dropdown .dropdown-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    margin: 5px 0 0 0;
    padding: 8px 0;
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
   }
   .nav-menu ul li.dropdown.active .dropdown-menu {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
   }
   .nav-menu ul li.dropdown .dropdown-menu li {
    margin: 0;
   }
   .nav-menu ul li.dropdown .dropdown-menu li a {
    display: block;
    padding: 10px 18px;
    color: #333;
    border-radius: 0;
   }
   .nav-menu ul li.dropdown .dropdown-menu li a:hover {
    background: #f8f9fa;
    text-decoration: none;
   }
   .nav-menu ul li.dropdown .dropdown-menu li a i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
   }
   /* Indicateur visuel du chevron */
   .nav-menu ul li.dropdown.active .dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
   }
   .nav-menu ul li.dropdown .dropdown-toggle i.fa-chevron-down {
    transition: transform 0.3s ease;
   }

   /* ---------- BURGER MENU ---------- */
   .burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
   }
   .burger span {
    width: 26px;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
   }
   /* Animation burger en X quand menu ouvert */
   .burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
   }
   .burger.active span:nth-child(2) {
    opacity: 0;
   }
   .burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
   }
   /* ---------- FORMULAIRES ---------- */
   form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 550px;
    margin: 0 auto;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
   }
   input,
   select,
   textarea,
   button {
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
   }
   input[type="submit"],
   button {
    background-color: #007bff;
    color: #fff;
    border: none;
   }
   input[type="submit"]:hover,
   button:hover {
    background-color: #0056b3;
   }
   /* ---------- TABLE DOCUMENTS ---------- */
   .documents-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
   }
   .documents-table th,
   .documents-table td {
    border: 1px solid #ddd;
    padding: 12px;
   }
   .documents-table th {
    background-color: #f2f2f2;
    text-align: left;
   }
   .documents-table td {
    vertical-align: middle;
   }
   /* ---------- PAGINATION ---------- */
   .pagination {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    gap: 10px;
   }
   /* ---------- MESSAGES ---------- */
   .message.success {
    color: green;
    font-weight: bold;
   }
   .message.error {
    color: red;
    font-weight: bold;
   }
   /* ---------- BOUTONS SPÉCIFIQUES ---------- */
   .btn-upload {
    background-color: #28a745;
    color: #fff;
    padding: 10px 18px;
    border-radius: 5px;
    font-weight: bold;
    margin-left: 10px;
   }
   .btn-upload:hover {
    background-color: #218838;
   }
   /* ---------- BARRE DE STOCKAGE ---------- */
   .stockage-bar {
    margin: 20px 0;
    font-size: 15px;
   }
   .barre {
    width: 100%;
    height: 16px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 6px;
   }
   .barre .progression {
    height: 100%;
    background-color: #28a745;
    transition: width 0.5s ease-in-out;
   }
   /* ---------- REMINDER STOCKAGE ---------- */
   .storage-reminder {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-left: 5px solid #007BFF;
    border-radius: 6px;
   }
   .storage-reminder h3 {
    margin-bottom: 10px;
   }
   .storage-reminder p a {
    color: #007BFF;
    font-weight: bold;
   }
   /* ---------- RESPONSIVE ---------- */
   @media (max-width: 768px) {
    /* Header mobile */
    .main-header {
    padding: 12px 15px;
    position: relative;
    }
    .logo-text {
    font-size: 14px !important;
    }
    /* Cacher le badge crédits sur très petits écrans */
    #creditsBadge {
    margin-right: 8px !important;
    }
    #creditsBadge span:first-child {
    display: none;
    }

    .nav-menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    background-color: #fff;
    position: absolute;
    top: 75px;
    left: 0;
    right: 0;
    width: 100%;
    padding: 15px 0;
    border-top: 2px solid #007bff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 999;
    max-height: calc(100vh - 75px);
    overflow-y: auto;
    }
    .nav-menu.active {
    display: flex;
    }
    .burger {
    display: flex;
    }
    /* Menu items verticaux sur mobile */
    .nav-menu > ul {
    flex-direction: column !important;
    gap: 0 !important;
    width: 100%;
    }
    .nav-menu ul li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    }
    .nav-menu ul li:last-child {
    border-bottom: none;
    }
    .nav-menu ul li a {
    display: block !important;
    padding: 15px 20px !important;
    width: 100%;
    }
    /* Dropdown en mode mobile */
    .nav-menu ul li.dropdown .dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    }
    .nav-menu ul li.dropdown .dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    background-color: #f8f9fa !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    }
    .nav-menu ul li.dropdown .dropdown-menu li {
    border-bottom: 1px solid #e9ecef;
    }
    .nav-menu ul li.dropdown .dropdown-menu li:last-child {
    border-bottom: none;
    }
    .nav-menu ul li.dropdown .dropdown-menu li a {
    padding: 12px 20px 12px 40px !important;
    background-color: transparent;
    }
    .nav-menu ul li.dropdown .dropdown-menu li a:hover {
    background-color: #e9ecef !important;
    }
    .documents-table,
    .documents-table thead,
    .documents-table tbody,
    .documents-table th,
    .documents-table td,
    .documents-table tr {
    display: block;
    width: 100%;
    }
    .documents-table tr {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    }
    .documents-table td {
    text-align: right;
    padding-left: 50%;
    position: relative;
    }
    .documents-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 45%;
    white-space: nowrap;
    text-align: left;
    font-weight: bold;
    }
   }
   /* === Manny IA Styles === */
   .ia-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
   }
   /*.ia-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #007bff;
    background-color: #fff;
   }*/
   img.ia-avatar,
   .ia-header img.ia-avatar {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    object-fit: cover !important;
   }
   .ia-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
   }
   .ia-form input {
    flex: 1;
    min-width: 200px;
   }
   .ia-form button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
   }
   .ia-form button:hover {
    background-color: #0056b3;
   }
   .offres-block {
    background-color: #f8f9fa;
    padding: 20px;
    border-left: 5px solid #007bff;
    border-radius: 8px;
    margin-top: 20px;
   }
   .offres-block h2 {
    margin-top: 0;
   }
   .offres-block ul {
    list-style: none;
    padding-left: 0;
   }
   .offres-block li {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
   }
  
/* Espace entre les groupes de boutons */ 
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    margin: 20px 0;
}

.button-group .btn {
    flex: 1 1 auto;
    max-width: 240px;
    border: 2px solid #198754;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: bold;
    color: white;
    background-color: #198754;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.button-group .btn:hover {
    background-color: #157347;
    border-color: #145c38;
    box-shadow: 0 0 10px rgba(21, 115, 71, 0.3);
    transform: translateY(-2px);
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        align-items: stretch;
    }

    .button-group .btn {
        width: 100%;
        max-width: 100%;
    }
}

.regeneration-btns {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.regeneration-btns button {
    padding: 6px 12px;
    background-color: #007BFF;
    border: none;
    color: white;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

.regeneration-btns button:hover {
    background-color: #0056b3;
}

.regeneration-btns span {
    font-size: 0.85rem;
    color: #555;
}

/* Style pour l'affichage de l'historique */
.conversation-item {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.conversation-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.conversation-item div {
    margin-bottom: 8px;
}

#historique h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #333;
    text-align: center;
}

#historique {
    padding: 20px;
}

.offre-bloc {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.offre-entete {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.offre-icone {
    margin-right: 12px;
}

.offre-icone img {
    border-radius: 4px;
}

.offre-resume h3 {
    margin: 0 0 6px 0;
    font-size: 1.2em;
}

.offre-resume p {
    margin: 0;
    font-size: 0.95em;
}

.offre-lien {
    display: inline-block;
    margin-top: 10px;
    color: #007BFF;
    text-decoration: none;
}

.offre-lien:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .offre-entete {
        flex-direction: column;
        align-items: flex-start;
    }

    .offre-icone {
        margin-bottom: 10px;
    }
}

/* ---------- FOOTER ---------- */
.site-footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #ddd;
}

.site-footer .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-footer p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}
