/* Color Definitions */
:root {
    --primary-color: #4551bf; /* Very dark blue */
    --secondary-color: #ede0bf; /* Yellow */
    --background-color: #ede0bf; /* Main background */
    --text-color: #ffffff; /* White */
    --cta-color: #ebee81; /* CTA button color */
    --border-radius: 30px; /* Element border radius */
    --primary-bg-color: #02041b; /* Main background */
    --font: "nave", "Playfair Display", serif;
    --font-logo: "nave", "Jersey 15", serif;
}



/* General Style */
body {
    font-family: var(--font);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    text-align: center;
}

.top-homepage {
    min-height: 50vh;
    margin-top: 100px;
}

.maintitle-top-homepage {
    font-family: var(--font-logo);
    font-weight: 900;
    font-style: normal;
    font-size: 80pt !important;
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: var(--secondary-color);
}

.maintitle-top-homepage:hover {
    color: var(--primary-color);
    background-color: var(--secondary-color);
    content: "rogner";
}

.maintitle {
    font-family: var(--font-logo);
    font-weight: 900;
    font-style: normal;
    font-size: 50pt !important;
    color: var(--primary-color);
}

.maintitle:hover {
    color: var(--secondary-color);
    background-color: var(--background-color);
    content: "rogner";
}

.maintitle-footer {
    font-family: var(--font-logo);
    font-weight: 900;
    font-style: normal;
    font-size: 50pt !important;
    color: var(--text-color);
}

.maintitle-footer:hover {
    color: var(--primary-color);
    background-color: var(--secondary-color);
    content: "rogner";
}

.maintitle-intext {
    font-family: var(--font-logo);
    font-weight: 900;
    font-style: normal;
    font-size: 16pt !important;
    color: var(--text-color);
}

.maintitle-intext:hover {
    color: var(--primary-color);
    background-color: var(--secondary-color);
    content: "rogner";
}

h1, h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container-compte h2 {
    color: var(--primary-color); /* Text in white */
}

/* Main Container */
.container {
    display: flex;
    flex-wrap: wrap;
    height: 100vh; /* Full height of the window */
    background-color: var(--primary-color); /* Main background */
    color: var(--secondary-color); /* Text in white */
    flex-direction: row; /* Stack elements vertically */
}

@media screen and (max-width: 768px) {
    .container {
        display: block !important;
        flex-direction: column !important; /* Stack elements vertically */
    }
}

/* Sidebar (Header/Left Menu) */
.sidebar {
    width: 20%;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column; /* Activate Flexbox */
    height: 100vh;
    margin: 0;
    padding: 0;
    position: fixed;
}

/* Navigation in the sidebar */
.sidebar nav {
    display: flex;
    flex-direction: column;
    color: var(--primary-color);
}

.sidebar nav a {
    color: var(--primary-color);
    font-size: 12pt;
    margin-bottom: 10px;
}

/* Footer in the sidebar */
.sidebar-footer-links {
    margin-top: auto; /* Ensures footer is at the bottom */
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    margin-left: 10%;
    margin-bottom: 10%;
    color: var(--primary-color);
}

.sidebar-footer-links a {
    color: var(--primary-color);
}

.sidebar-footer-links .navitem {
    display: block;
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: none;
    text-align: left;
}

.sidebar-footer-links a:hover {
    color: var(--text-color);
}

.settings-side-items a{
    font-size: 12pt;
}

@media screen and (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row; /* Transform sidebar into a horizontal bar */
        align-items: center;
        padding: 10px 0;
        box-shadow: none;
       /*display: none !important; /* Hide sidebar by default */
        position: static;
    }

    .sidebar.active {
        display: flex; /* Show sidebar when active */
    }

    .sidebar nav {
        /*flex-direction: row; /* Horizontal navigation */
        justify-content: space-around; /* Equal spacing between items */
        width: 100%;
    }

    .sidebar nav a {
        margin: 0 10px; /* Horizontal spacing */
        font-size: 14pt;
        text-align: center;
    }

    /* Footer in the top bar */
    .sidebar-footer-links {
        display: none; /* Hide footer links in the top bar */
    }
    
    .user-email {
        display: none;
    }
}


.sidebar.active {
    left: 0; /* Affichée quand la classe active est ajoutée */
}


/* Main Content */
.content {
    margin-left: 20%;
    width: 80%;
    padding: 40px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    overflow-y: auto;
}

@media screen and (max-width: 768px) {
    .content {
        width: auto; /* Occupy full width */
        padding: 5%; /* Reduce padding on mobile */
        margin: 0;
    }
}

.content h1, .content p {
    color: var(--secondary-color);
}

.content p {
    font-size: 16px;
    line-height: 1.5;
}

.don_info {
    font-size: 8pt;
    font-style: italic;
}

/* Forms */
form {
    max-width: 1300px;
    margin: 20px auto;
    padding: 20px;
    background: var(--text-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

form input, form button {
    font-family: var(--font);
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 16px;
    padding: 5px;
}

form button {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: var(--primary-color);
    color: var(--text-color);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    margin-top: 20px;
}

table thead {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

table th, table td {
    padding: 12px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

table th:first-child, table td:first-child {
    width: 30%;
    text-align: left;
    padding-left: 15px;
}

table td:nth-child(3) {
    width: 30%;
    max-width: 150px;
    font-size: 10pt;
    line-break: anywhere;
}

table tr:nth-child(even) {
    /*background-color: #f9f9f9;*/
}

/* Buttons */
button, .edit-btn, .delete-btn, .copy-btn, .export-btn {
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.edit-btn {
    color: var(--primary-color);
    background-color: var(--secondary-color);
    padding: 1px 5px;
    margin: 20px 10px;
}

.edit-btn:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.delete-btn {
    color: var(--primary-color);
    background-color: #d9534f;
    padding: 1px 5px;
    margin: 20px 10px;
}

.delete-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-color);
}

.copy-btn {
    margin-left: 10px;
    padding: 5px 10px;
    background-color: #9b9b9b;
    color: var(--primary-color);
    border: none;
    font-size: 12px;
}

.copy-btn:hover {
    background-color: #0f1c4c;
}

.export-btn {
    display: inline-block;
    margin: 10px auto;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
}

.export-btn:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: solid 1px var(--secondary-color);
}

.infobtnmail {
    font-style: italic;
    font-size: 8pt;
}

/* Subtext */
.subdate {
    font-style: italic;
    font-size: 8pt;
    font-weight: 100;
    color: #9b9b9b;
}

input[type="color"] {
    width: 50px;
    height: 50px;
    border: none;
    cursor: pointer;
    border-radius: var(--border-radius);
    margin: 10px 0;
}

@media only screen and (max-width: 700px) {
    form, table {
        width: auto;
        margin: 2px;
        padding: 1px;
    }

    table th, table td {
        padding: 0;
    }

    .export-btn, .delete-btn {
        font-size: 12px;
        padding: 5px 10px;
    }

    .hide-mobile {
        display: none;
    }
    
    .edit-btn, .delete-btn, .copy-btn, .export-btn {
        margin-bottom: 15px;
    }
}

/* Toggle button for mobile */
.sidebar-toggle {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: none; /* Show toggle button on mobile */
    }
}
  form {
    margin: 0.5rem 0;
  }

  input[type="text"],
  textarea,
  select {
    font-family: var(--font);
    padding: 0.4rem;
    margin: 0.3rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    max-width: 400px;
    font-size: 0.9rem;
    box-sizing: border-box;
  }

    textarea {
  width: 100%;
  min-height: 80px; /* hauteur minimale */
  max-height: 300px; /* hauteur maximale pour éviter que ça devienne trop grand */
  padding: 8px;
  font-size: 1rem;
  line-height: 1.4;
  resize: vertical; /* ou "both" si tu veux permettre aussi l'agrandissement horizontal */
  }

  button {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    margin-top: 0.3rem;
  }

  button:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: var(--secondary-color) 1px solid;
      
  }

  .category {
    margin: 1rem 0;
    padding: 0.6rem;
    border-radius: 5px;
  }

  .category ul {
    list-style: none;
    padding-left: 0;
  }

  .category li {
    margin: 0.4rem 0;
    padding: 0.4rem;
    border-radius: 4px;
  }

  .category form {
    display: block;
    margin: 0.3rem 0;
  }

  label {
    margin-right: 0.3rem;
  }
  
  .history-item {
      background-color: #ffffff;
      padding: 1%;
      border-radius:  var(--border-radius);
      margin-bottom: 2px;
  }
      
.history-date {
    color: var(--secondary-color);
}

.history-content {
    color: var(--secondary-color) !important;
    text-align: left;
}
.chat-entry {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

/* Bulle alignée à droite */
.chat-question {
  align-self: flex-end;
  background-color: var(--secondary-color);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  max-width: 70%;
  text-align: left;
  position: relative;
}

/* Bulle alignée à gauche */
.chat-answer {
  align-self: flex-start;
  background-color: #f3f3f3;
  color: #222;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  max-width: 80%;
  text-align: left;
  position: relative;
}

.chat-question, .chat-answer {
  margin-bottom: 0.5rem;
}

.chat-date {
  text-align: center;
  font-size: 0.8em;
  color: #888;
  margin-top: 0.2rem;
}

.picname {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden; /* ← masque tout débordement de l'image */
  z-index: 2;
  transition: transform .2s;
}

.picname.questionner {
  background-color: var(--secondary-color);
  border: 2px solid #faf7f4;
}

.picname.answerer {
  background-color: #faf7f4;
  border: 2px solid var(--primary-color);
}


.picname:hover{
  transform: scale(1.5);
}

.picname img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* ← permet de remplir en rognant sans déformer */
  border-radius: 50%;
  display: block;
}

.color-picker-group,
.logo-upload-group {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.color-picker-group label,
.logo-upload-group label {
  width: 160px;
  font-weight: bold;
  color: var(--secondary-color, #1a1a1a);
}

.color-picker-group input[type="color"] {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.logo-upload-group img {
  max-height: 100px;
  max-width: 200px;
  border: 1px solid #ccc;
  border-radius: 6px;
  object-fit: contain;
}

input[type="file"] {
  padding: 5px;
  border-radius: 20px;
  border: 1px solid #ccc;
}
