/* Dynamic Font Faces */

@font-face {
  font-family: "CustomFont";
  src: url("/fonts/Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "CustomFont";
  src: url("/fonts/MediumItalic.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
}

@font-face {
  font-family: "CustomFont";
  src: url("/fonts/Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "CustomFont";
  src: url("/fonts/SemiBoldItalic.ttf") format("truetype");
  font-weight: 600;
  font-style: italic;
}

/* CSS Variables */
:root {
  --background: #ffffff;
  --foreground: #171717;
  --primary-color: #0070f3;
  --secondary-color: #7928ca;
  --brand-orange: #ff8a00;
}

/* Base Styles */
body {
  background: var(--background);
  color: var(--foreground);
  font-family: "CustomFont", Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
}

/* KPROF */

#header {
  display: flex;
  align-items: center;
  padding-left: 1rem;
  padding-right: 1rem;
  justify-content: space-between;
  height: 48px;
  background-color: var(--brand-orange);
}

#header a {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.1em;
  transition: opacity 150ms ease;
  text-decoration: none;
}

#header a:hover {
  opacity: 0.8;
}

#header svg {
  margin-right: 0.5rem;
}

#logo {
  width: auto;
  height: auto;
  margin: 2em auto;
  display: block;
}

#question-container {
  border: 2px solid transparent;
  background-image:
    linear-gradient(white, white), linear-gradient(90deg, #ffe600, #ff00e5);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-radius: 28px;
  box-shadow: 0 25px 50px -12px rgba(199, 210, 254, 0.5);
  transition: all 300ms ease;
  background-color: #ffffff;
  align-items: center;
  display: flex;
  width: calc(100% - 4em);
  max-width: calc(48rem - 4em);
  margin: 2em auto 0 auto;
  padding: 1.5em 2em;
}

#question-container textarea {
  flex: 1 1 0%;
  font-size: 1.25rem;
  line-height: 1.75rem;
  outline: none;
  border: none;
  resize: none;
  height: 4rem;
  background-color: transparent;
  font-weight: 500;
  font-family: "CustomFont", Arial, Helvetica, sans-serif;
}

#question-container textarea::placeholder {
  color: rgb(203 213 225);
}

@media (min-width: 768px) {
  #question-container textarea {
    font-size: 1.5rem;
    line-height: 2rem;
  }
}

#question-container button {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: 1rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  background-color: #f1f3f9;
  color: #1e3a8a;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  padding: 0;
  border: none;
  cursor: pointer;
}

#question-container button:hover {
  background-color: rgb(79 70 229);
  color: #ffffff;
  transform: scale(1.05);
}

#introduction-text-container {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 42rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  #introduction-text-container {
    flex-direction: row;
    gap: 2.5rem;
  }
}

#introduction-text-container img {
  position: relative;
  flex-shrink: 0;
  width: 7rem;
  height: 7rem;
  background-image: linear-gradient(to top right, rgb(255 247 237), #ffffff);
  border-radius: 9999px;
  border-width: 4px;
  border-style: solid;
  border-color: #ffffff;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
  #introduction-text-container img {
    width: 10rem;
    height: 10rem;
  }
}

#introduction-text-container p {
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.2;
  color: #1e3a8a;
  font-weight: 700;
}

@media (min-width: 768px) {
  #introduction-text-container p {
    text-align: left;
    font-size: 1.875rem;
  }
}

#btn-resume-chats {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.15);
  transition: all 150ms ease;
}

#btn-resume-chats:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.8);
}

#most-asked-questions-container {
  margin-top: 5rem;
  text-align: center;
  width: 100%;
}

#most-asked-questions-container h3 {
  color: #ff8a00;
  font-weight: 700;
  font-style: italic;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
}

#most-asked-questions-container div {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

#most-asked-questions-container button.featured-question {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background-color: #fff0d9;
  padding: 1.25rem;
  border-radius: 1rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: rgb(51 65 85);
  border: 1px solid rgba(254, 215, 170, 0.5);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 150ms ease;
  cursor: pointer;
  margin: 0.5em auto;
}

#most-asked-questions-container button.featured-question:hover {
  background-color: #ffe8cc;
}

#most-asked-questions-container button.featured-question > div {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#most-asked-questions-container button.featured-question > p {
  margin: 0;
  width: 100%;
}

#most-asked-questions-container button.featured-question svg {
  color: rgb(79 70 229);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

#most-asked-questions-container div > a {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 900;
  color: rgb(30 41 59);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-top: 2.5rem;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  transition: color 150ms ease;
  cursor: pointer;
}

#most-asked-questions-container div > a:hover {
  color: rgb(79 70 229);
}

#most-asked-questions-container h4 {
  color: #1e3a8a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

#most-asked-questions-container div.all-questions {
  animation: fadeInSlideIn 500ms ease-out both;
  text-align: left;
  padding-bottom: 2.5rem;
}

#most-asked-questions-container div.all-questions > * + * {
  margin-top: 2rem;
}

@keyframes fadeInSlideIn {
  from {
    opacity: 0;
    transform: translateY(-1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#most-asked-questions-container div.all-questions div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

#most-asked-questions-container div.all-questions div:first-child button {
  color: rgb(148 163 184);
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
}

#most-asked-questions-container div.all-questions div:first-child button:hover {
  color: rgb(79 70 229);
}

#most-asked-questions-container h5 {
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#most-asked-questions-container div.all-questions section div {
  display: grid;
  gap: 0.5rem;
}

#most-asked-questions-container div.all-questions section button {
  text-align: left;
  background-color: #ffffff;
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: rgb(71 85 105);
  border: 1px solid rgb(241 245 249);
  transition: all 150ms ease;
}

#most-asked-questions-container div.all-questions section button:hover {
  background-color: color-mix(in srgb, var(--category-color) 10%, white);
  color: var(--category-color);
  border-color: color-mix(in srgb, var(--category-color) 30%, white);
}

#most-asked-questions-container div.all-questions a {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 900;
  color: rgb(148 163 184);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  transition: color 150ms ease;
  display: block;
  text-align: center;
}

#most-asked-questions-container div.all-questions a:hover {
  color: rgb(30 41 59);
}

#answer {
  width: 100%;
}

#answer > * + * {
  margin-top: 2rem;
}

div#answer-header {
  background-color: #ffffff;
  border-width: 2px;
  border-style: solid;
  border-color: rgb(254 215 170);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

#answer-title {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  color: rgb(148 163 184);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

#answer-header button {
  background-color: rgb(255 247 237);
  color: rgb(249 115 22);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

#answer-header button:hover {
  background-color: rgb(255 237 213);
}

#answer-header h2 {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 800;
  color: rgb(249 115 22);
}

#answer #loading {
  display: flex;
  justify-content: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

#answer #introduction {
  background-color: rgb(238 242 255);
  border: 1px solid rgb(224 231 255);
  border-radius: 1rem;
  padding: 1.5rem;
  color: rgb(49 46 129);
  font-style: italic;
}

#answer #introduction svg {
  color: rgb(199 210 254);
  margin-right: 0.5rem;
}

#answer #grade {
  background-color: #ffffff;
  border-width: 2px;
  border-style: solid;
  border-color: rgb(254 215 170);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  position: relative;
}

#answer #grade div {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#answer #grade div svg {
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: rgb(249 115 22);
  margin-top: 0.25rem;
}

#answer #grade div p {
  color: rgb(30 41 59);
  font-weight: 700;
}

.underline {
  text-decoration: underline;
}

.font-bold {
  font-weight: bold;
}

#sections-container > * + * {
  margin-top: 1rem;
}

#sections-container h3 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 1.5rem;
}

#sections-container #sections > * + * {
  margin-top: 1rem;
}

#sections-container #sections button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border-width: 1px;
  border-style: solid;
  transition: all 150ms ease;
}

#sections-container #sections button.active-answer {
  background-color: #fff0d9;
  border-color: rgb(254 215 170);
}

#sections-container #sections button.inactive-answer {
  background-color: #ffffff;
  border-color: rgb(241 245 249);
}

/* ANSWER - New UI */

/* Add cursor to section buttons (already have layout/border styles) */
#sections-container #sections button {
  cursor: pointer;
}

.section-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  background-color: #1e3a8a;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.section-label {
  font-weight: 800;
  color: rgb(30 41 59);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-content {
  padding: 1.5rem;
  background-color: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid rgb(241 245 249);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  animation: sectionSlideIn 300ms ease both;
}

@keyframes sectionSlideIn {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-article {
  max-width: none;
  color: rgb(51 65 85);
  line-height: 1.75;
}

.section-article h1,
.section-article h2,
.section-article h3,
.section-article h4,
.section-article h5,
.section-article h6 {
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.section-article p {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}

.section-article a {
  color: #4f46e5;
  text-decoration: underline;
}

.section-article strong {
  font-weight: 700;
  color: rgb(15 23 42);
}

.section-article ul,
.section-article ol {
  padding-left: 1.5em;
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}

.section-article li {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}

.answer-article li::marker {
  color: rgb(249 115 22);
}
.situations-article li::marker {
  color: rgb(16 185 129);
}
.exercises-article li::marker {
  color: rgb(99 102 241);
}

#answer-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-top: 2rem;
}

@media (min-width: 640px) {
  #answer-actions {
    flex-direction: row;
  }
}

#btn-download,
#btn-new-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 1rem;
  font-family: "CustomFont", Arial, Helvetica, sans-serif;
  cursor: pointer;
  transition: all 150ms ease;
}

@media (min-width: 640px) {
  #btn-download,
  #btn-new-question {
    width: auto;
  }
}

#btn-download {
  background-color: #1e3a8a;
  color: #ffffff;
  border: none;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#btn-download:hover {
  background-color: #162d6e;
}

#btn-new-question {
  background-color: #ffffff;
  color: #1e3a8a;
  border: 2px solid #1e3a8a;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#btn-new-question:hover {
  background-color: #eff6ff;
}

/* ===================== */
/* CHAT PAGE LAYOUT      */
/* ===================== */

#chat-layout {
  display: flex;
  height: calc(100vh - 48px);
}

#chat-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* ===================== */
/* SIDEBAR               */
/* ===================== */

#sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background-color: #f3f4f6;
  border-right: 1px solid rgb(226 232 240);
  height: 100%;
}

@media (max-width: 767px) {
  #sidebar {
    display: none;
  }
}

#sidebar-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
}

#sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(100 116 139);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#sidebar-questions {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 1rem;
}

#sidebar-empty {
  font-size: 0.75rem;
  color: rgb(148 163 184);
  font-style: italic;
  padding: 0.5rem;
}

.sidebar-question-item {
  position: relative;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background-color 150ms ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.sidebar-question-item:hover {
  background-color: rgba(255, 255, 255, 0.6);
}

.sidebar-question-item.active {
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sidebar-question-text {
  font-size: 0.875rem;
  color: rgb(51 65 85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-weight: 500;
}

.sidebar-question-item.active .sidebar-question-text {
  font-weight: 600;
}

.sidebar-question-delete {
  opacity: 0;
  background: none;
  border: none;
  color: rgb(148 163 184);
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
  transition: all 150ms ease;
  font-size: 0.875rem;
  line-height: 1;
}

.sidebar-question-item:hover .sidebar-question-delete {
  opacity: 1;
}

.sidebar-question-delete:hover {
  color: rgb(239 68 68);
}

#sidebar-footer {
  padding: 1.5rem;
  margin-top: auto;
  border-top: 1px solid rgb(226 232 240);
}

#sidebar-new-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background-color: #ffffff;
  border: 1px solid rgb(226 232 240);
  padding: 0.75rem;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-weight: 700;
  font-size: 0.875rem;
  color: rgb(30 41 59);
  cursor: pointer;
  transition: box-shadow 150ms ease;
  font-family: "CustomFont", Arial, Helvetica, sans-serif;
}

#sidebar-new-question:hover {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#sidebar-new-question i {
  color: #4f46e5;
}

/* ===================== */
/* RESULT SELECTION      */
/* ===================== */

#result-selection {
  width: 100%;
}

#result-selection > * + * {
  margin-top: 2rem;
}

#result-selection-header h2 {
  font-size: 1.875rem;
  font-weight: 800;
  color: rgb(249 115 22);
  margin-bottom: 0.5rem;
}

#result-selection-header p {
  font-size: 1rem;
  color: rgb(100 116 139);
  margin: 0;
}

#result-selection-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-card {
  width: 100%;
  text-align: left;
  background-color: #ffffff;
  border: 2px solid rgb(254 215 170);
  border-radius: 1.5rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 150ms ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: "CustomFont", Arial, Helvetica, sans-serif;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.result-card:hover {
  border-color: rgb(249 115 22);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.result-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-card-domaine {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(148 163 184);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.result-card-classe {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background-color: #1e3a8a;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.result-card-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: rgb(30 41 59);
}

.result-card-question {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(71 85 105);
  font-style: italic;
}

.result-card-intro {
  font-size: 0.875rem;
  color: rgb(100 116 139);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgb(241 245 249);
}
