@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
}

.no-scroll {
  overflow: hidden;
}

body {
  background: #F6F7F8;
}

a{
    text-decoration: none;
}

input, textarea{
    color: #4C5A6E;
    font-size: 16px;
}

textarea{
  resize: none;
}

input:focus, textarea:focus{
    outline: none;
}

/* Header Styles */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #FFFFFF;
  border-bottom: 1px solid #E3ECF3;
  height: 80px;
}

.header-left .logo {
  height: 40px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.assistant-title {
  font-size: 18px;
  color: #4C5A6F;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.notification-icon img {
  width: 24px;
  height: 24px;
}

.profile-avatar {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F6F7F8;
  border-radius: 25px;
  padding: 7px 16px 7px 7px;
}

.profile-avatar .profile-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
}

.profile-arrow {
  width: 10px;
  height: 10px;
  transition: transform 0.3s ease;
}

.profile-avatar.active .profile-arrow {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: #FFFFFF;
  border: 1px solid #DFE5EC;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  display: none;
  z-index: 1000;
}

.profile-dropdown.active {
  display: block;
}

.profile-dropdown-header {
  padding: 15px;
  border-bottom: 1px solid #DFE5EC;
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-dropdown-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #DAE5EF;
  background: #F4F7F9;
  padding: 2px;
  object-fit: cover;
  object-position: top;
}

.profile-info {
  flex: 1;
}

.profile-info h4 {
  color: #22364D;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-info p {
  color: #586D85;
  font-size: 12px;
}

.profile-dropdown-menu {
  padding: 8px 0;
}

.profile-dropdown-item {
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4C5A6F;
  font-size: 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.profile-dropdown-item:hover {
  background: #F4F7F9;
  color: #0A58A5;
}

.profile-dropdown-item img {
  width: 16px;
  object-fit: cover;
  object-position: top;
}

.logout-btn {
  font-family: inherit;
}

.logout-btn:hover {
  background: #F4F7F9;
  color: #0A58A5;
}

.profile-dropdown-divider {
  height: 1px;
  background: #DFE5EC;
  margin: 8px 0;
}

.language-selector select {
  border: none;
  border-radius: 10px;
  padding: 11px 12px;
  color: #22364D;
  font-size: 16px;
  font-weight: 700;
  background-color: #F4F7F9;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}

.language-selector select:focus {
  outline: none;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #F4F7F9;
}

/* Main Content Layout */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar Styles */
.chat-sidebar {
  width: 300px;
  background-color: transparent;
  border-right: 1px solid #DFE5EC;
  padding: 1.5rem;
  position: relative;
  transition: width 0.3s ease;
}

.chat-sidebar.collapsed {
  width: 80px;
  padding: 1.5rem 0.5rem;
}

.sidebar-toggle {
  position: absolute;
  right: -1px;
  top: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-toggle:hover {
  background: #F4F7F9;
}

.chat-sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
  right: -13px;
}

.nav-text {
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.chat-sidebar.collapsed .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.chat-sidebar.collapsed .nav-item {
  padding: 12px;
  justify-content: center;
}

.chat-sidebar.collapsed .nav-item img {
  margin: 0;
}

.chat-sidebar.collapsed .sidebar-footer {
  padding: 15px 5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 17px;
  color: #4C5A6F;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid #DFE5EC;
  transition: all 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
  border: 1px solid #0A58A5;
  background: rgba(10, 88, 165, 0.08);
}

.nav-item.active span{
  color: #0A58A5;
  font-weight: 700;
}

.nav-item span{
  color: #586D85;
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
}

.toast {
    visibility: hidden;
    min-width: 300px;
    background-color: #59B224;
    color: #fff;
    text-align: center;
    border-radius: 15px;
    padding: 15px 35px;
    position: fixed;
    z-index: 99999;
    left: 30%;
    right: 30%;
    bottom: 30px;
    font-size: 17px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.10);
}
  
.toast.show {
    visibility: visible;
    opacity: 1;
}

.loader {
    width: 35px;
    height: 35px;
    border: 5px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    }

    @keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
    } 

    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Fond semi-transparent */
        z-index: 10000;
        align-items: center;
        justify-content: center;  /* Assure que l'overlay est au-dessus de tout le reste */
      }

      .chat-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Fond semi-transparent */
        z-index: 9998;
        display: flex;
        align-items: center;
        justify-content: center; /* Assure que l'overlay est au-dessus de tout le reste */
      }
      
      .modal-dialog {
        position: relative;
        margin: 10% auto;
        width: 700px;
        max-height: 600px;
        overflow-y: scroll;
        background-color: #fff; /* Couleur de fond du modal */
        border-radius: 25px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); /* Ombre légère autour du modal */
        z-index: 9999; /* Assure que le modal est au-dessus de l'overlay */
      }

      .modal-dialog::-webkit-scrollbar {
        width: 0;
      }
      .modal-dialog::-webkit-scrollbar-track {
        background: #F4F7F9;
      }
      .modal-dialog::-webkit-scrollbar-thumb {
        background: #DAE5EF;
      }
      
      .modal-content {
        padding: 20px;
      }
      
      .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-bottom: 1px solid #f4F4F4;
        height: 54px;
        position: fixed;
        left: 0;
        right: 0;
        width: 700px;
        background-color: #fff;
        margin: 0 auto;
        border-radius: 25px  25px 0  0;
        z-index: 1;
      }

      .modal-header h5{
        font-size: 16px;
        color: #4C5A6F;
        font-weight: 400;
      }
      
      .modal-title {
        margin: 0;
      }
      
      .modal-body {
        padding: 20px;
      }
      
      .modal-footer {
        padding: 10px 20px;
        border-top: 1px solid #ddd; /* Bordure haute du footer */
        text-align: right;
      }
      
    
      /* Animation fadeIn */
      .fadeIn {
        animation: fadeInAnimation 0.5s ease forwards;
      }
      
      @keyframes fadeInAnimation {
        from {
          opacity: 0;
        }
        to {
          opacity: 1;
        }
      }
      
      /* Animation fadeOut */
      .fadeOut {
        animation: fadeOutAnimation 0.5s ease forwards;
      }
      
      @keyframes fadeOutAnimation {
        from {
          opacity: 1;
        }
        to {
          opacity: 0;
        }
      }
      
.open-modal{
    cursor: pointer;
}

.popup-container {
  display: none;
}

.hidden {
  display: none;
}

.popup-container.fadeIn {
  display: block;
}

.modal-content form{
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 4rem;
}

.modal-content form .form-group{
  margin: 0  2rem;
}

.modal-content form .form-group textarea{
  width: 100%;
  border: 1px solid #DAE5EF;
  border-radius: 20px;
  height: 150px;
  padding: 1rem;
  background-color: #F4F7F9;
  line-height: 24px;
}

.modal-content form .form-group label{
  font-size: 12px;
  margin-bottom: 5px;
  color: #4c5a6f8b;
}

.modal-content form .form-group input{
  width: 100%;
  border: 1px solid #DAE5EF;
  border-radius: 20px;
  height: 54px;
  padding: 1rem;
  background-color: #F4F7F9;
}

.modal-content form .button{
  display: flex;
  align-items: center;
  justify-content: center;
}

.wait {
  background: #fff;
  height: 500px;
  border-radius: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.wait .loader {
  width: 60px !important;
  height: 60px !important;
  border: 5px solid #0A58A5;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  }

  @keyframes rotation {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
  } 

.wait .text{
  color: #4C5A6F;
}

.promotion h1{
  color: #4C5A6F;
  font-size: 16px;
  text-align: center;
}

.promotion .form{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 22px;
  margin-top: 3rem;
}

.promotion .form input{
  width: 100%;
  border-radius: 20px;
  border: 1px solid #DAE5EF;
  background: #F4F7F9;
  height: 54px;
  padding: 1rem;
  font-size: 16px;
  color: #4C5A6F;
}

.promotion .form button{
  border-radius: 25px;
  background: #0A58A5;
  border: none;
  color: #fff;
  height: 54px;
  width: 126px;
  font-size: 16px;
}

.emails{
  margin-top: 47px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
  grid-column-gap: 15px;
  grid-row-gap: 10px;
}

.email{
  border-radius: 30px;
  background: #F4F7F9;
  padding: 15px;
  color: #4C5A6F;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.email form{
  margin-top: 0;
}

.email button{
    border: none;
    background: transparent;
}

.email form button {
  background-color: #0A58A5;
  color: #fff;
  width: 30px;
  height: 20px;
  border-radius: 20px;
  border: none;
  margin: 0 auto;
}

.promotion button.submit{
  margin: 2rem auto;
  border-radius: 20px;
  background: #0A58A5;
  width: 254px;
  height: 54px;
  border: none;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}

.prom-button{
  border: none !important;
  background: none !important;
}

.user.user-header{
  margin: 0 !important;
  padding: 10px 1rem;
  position: relative;
}

.user {
  background: #FFFFFF;
  border-radius: 20px;
  border:1px solid #E3ECF3;
  padding: 1.2rem;
  height: fit-content;
  width: 250px;
  font-size: 16px;
  color: var(--main-blue);
  margin: 1rem auto;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 2s ease-in-out;
}

.user-dropdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 2s ease-in-out;
}

.history-content {
  display: flex;
  align-items: center;
}

.user-dropdown img:first-child {
  width: 25px;
  height: 26px;
  border-radius: 100%;
}

.hist img {
  border-radius: 0 !important;
}

.hist span {
  margin-left: 10px;
  color: #0A58A5;
}

.user-dropdown img:last-child {
  transform: rotate(180deg);
    width: 15px;
}

.logout {
  transition: all 2s ease-in-out;
  display: none;
  margin-top: 1rem;
}

.logout.users {
  transition: all 2s ease-in-out;
  display: none;
  margin-top: 1rem;
  position: absolute;
  top: 100%;
  background: #fff;
  border: 1px solid #E3ECF3;
  width: 250px;
  padding: 20px;
  border-radius: 20px;
  z-index: 9;
  left: 0;
}

.user-dropdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 2s ease-in-out;
}


.history-content {
  display: flex;
  align-items: center;
}

.module-border-wrap {
  width: 36px;
  height: 36px;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px  solid #0A58A5;
}

.module-border-wrap .name {
  color: #0A58A5;
  font-size: 12px;
  font-style: normal;
  cursor: pointer;
}

.username {
  text-align: left;
  display: flex;
  flex-direction: column;
  margin-left: 10px;
  justify-content: center;
}

.username span.balance{
  color: var(--Bleu, #0A58A5);
  font-size: 16px;
  font-weight: 400;
}

.user-dropdown img:last-child {
  transform: rotate(180deg);
}

.logout {
  transition: all 2s ease-in-out;
  display: none;
  margin-top: 1rem;
}

.credit a {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.credit {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.credit .montants {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-montant {
  display: flex;
  flex-direction: column;
  align-items: start;
}

.user-montant span:first-child{
  font-size: 12px;
  color: #0A58A5;
}

a.plus img{
  width: 20px;
  height: 20px;
}

.credit .montants span:last-child {
  color: #59B224;
}

a.plus {
  height: 34px;
  width: 34px;
}

a.myprofile, button#deconnexion_button {
  display: flex;
  align-items: center;
  gap: 30px;
  color: #0A58A5;
  margin: 1.5rem 0;
  background-color: transparent;
  border: none;
  font-size: 16px;
}

button#deconnexion_button{
  margin-bottom: 0;
}


.solde-user {
  color: #0A58A5;
  font-size: 12px;
}

.solde-user span {
  color: #59B224;
}

.historique-content {
  transition: all .3s ease-in-out;
  display: none;
}

.logout-button{
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #0A58A5;
}

.logout-button .loader{
  border: 5px solid #0A58A5;
  animation: rotation 1s linear infinite;
}

/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
* {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Mobile Navigation */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  margin-left: 10px;
}

.mobile-nav-toggle img {
  width: 20px;
  height: 20px;
}

@media screen and (max-width: 768px) {
  .mobile-nav-toggle {
    display: block;
  }

  .sidebar-toggle {
    display: none;
  }

  .chat-sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    bottom: 0;
    width: 280px;
    background: #FFFFFF;
    z-index: 999;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  .chat-sidebar.active {
    left: 0;
  }

  .chat-header {
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 990;
    background: #FFFFFF;
  }

  .header-left .logo {
    height: 30px;
  }

  .header-actions {
    gap: 1rem;
  }

  .notification-icon img,
  .profile-avatar img {
    width: 20px;
    height: 20px;
  }

  .language-selector select {
    font-size: 14px;
  }

  .main-content {
    margin-top: 80px;
  }

  .finances-main,
  .chat-main {
    margin: 0 20px;
    padding: 1rem 0;
  }

  .stats-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .content-tabs {
    overflow-x: auto;
    padding: 1rem;
    gap: 15px;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    white-space: nowrap;
    padding: 7px 20px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  /* Overlay pour le sidebar mobile */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 997;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  /* Ajustements pour le contenu principal */
  .main-content {
    width: 100%;
  }

  /* Ajustements pour les cartes et graphiques */
  .stat-card {
    padding: 15px;
  }

  .chart-item {
    margin-bottom: 20px;
  }

  /* Ajustements pour la barre de recherche et le bouton d'import */
  .search-box {
    width: 200px;
  }

  .import-btn {
    padding: 8px 15px;
  }

  .profile-dropdown {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* Animation pour le sidebar mobile */
@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* Mobile Hidden */
.mobile-hidden {
  display: flex;
}

.mobile-only {
  display: none;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid #DFE5EC;
  display: none;
}

@media screen and (max-width: 768px) {
  .mobile-hidden {
    display: none;
  }

  .mobile-only {
    display: flex;
  }

  .chat-sidebar {
    display: flex;
    flex-direction: column;
  }

  .sidebar-nav {
    flex: 1;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
  }

  .sidebar-footer .notification-icon img,
  .sidebar-footer .profile-avatar-img {
    width: 24px;
    height: 24px;
  }

  .sidebar-footer .profile-arrow {
    width: 8px;
    height: 8px;
  }

  .sidebar-footer .language-selector select {
    padding: 8px 10px;
    font-size: 14px;
  }

  .sidebar-footer .profile-dropdown {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
}
