.container {
  width: 90%;
  max-width: 960px;
}

/* Header container specific styling */
header.container {
  padding-bottom: 0;
}

/* Main container specific styling */
main.container {
  padding-top: 0;
}

/* Header layout with photo */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.header-right {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
  width: 500px; /* Largeur totale du bloc (photo + headline) - Modifiable */
  max-width: 50%; /* Maximum 40% de l'espace disponible */
  column-gap: 1rem; /* Gap horizontal uniquement (entre photo et headline) */
}

.header-photo {
  flex-shrink: 0;
  padding-top: 10px;
}

.profile-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--pico-primary);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-placeholder {
  flex: 1; /* Prend l'espace restant après la photo */
  display: flex;
  align-items: center; /* Centre verticalement le contenu */
  justify-content: center; /* Centre horizontalement le contenu */
  min-height: 100px; /* Hauteur minimale pour s'aligner avec la photo */
  min-width: 150px; /* Minimum pour lisibilité */
}

.placeholder-text {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  font-style: italic;
  line-height: 1.4;
  margin: 0;
  padding-top: 10px;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-right {
    flex-direction: column;
    align-items: center;
  }

  .profile-photo {
    width: 100px;
    height: 100px;
  }

  .header-placeholder {
    text-align: center;
  }
}

/* Custom list style with chevrons */
ul li,
ol li {
  list-style: none;
  position: relative;
  padding-left: 1.25rem;
}

ul li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--pico-primary);
  font-weight: bold;
}

ol li::before {
  content: "> ";
  position: absolute;
  left: 0;
  color: var(--pico-primary);
  font-weight: bold;
}

/* App footer */
.app-footer {
  margin-top: 2rem;
  padding: 1rem 0 2rem;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(127, 127, 127, 0.25);
  opacity: 0.9;
}
.app-footer a {
  color: inherit;
  text-decoration: underline;
}

/* FAQ */

.tech-list {
  margin-top: 0.5em; /* ou la valeur qui convient */
}

.faq-section {
  margin-top: 2rem;
}

#faq-title {
  text-align: center;
}

.faq-section details.faq-item {
  margin: 0.5rem 0;
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 8px;
  padding: 0.25rem 0.75rem;
}
.faq-section summary {
  cursor: pointer;
  font-weight: 600;
}
.faq-section details > div {
  padding: 0.25rem 0 0.5rem;
}

/* Upload row: align controls to the right */
.upload-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
  flex-wrap: nowrap;
}

.upload-row > fieldset,
.upload-row .file-upload-control {
  flex: 1 1 0;
  min-width: 0;
}

.upload-row > fieldset {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-upload-control {
  display: flex;
  justify-content: center;
}

#jobFileButton {
  font-size: 16px;
}

#mainForm button[type="submit"] {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .upload-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .upload-row > fieldset,
  .upload-row .file-upload-control {
    width: 100%;
    flex: 1 1 auto;
  }
}

/* Fix prompt display in dialog: wrap long text */
#answerDialog pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Auto-scroll behavior for streaming content in dialog */
#answerDialog article {
  scroll-behavior: smooth;
  overflow-y: auto;
  max-height: 85vh;
  max-width: 75%;
}

/* Reduce font size for AI response content in dialog */
#answerDialog #answerText {
  font-size: 0.85rem;
  line-height: 1.6;
}

#answerDialog #answerText p,
#answerDialog #answerText ul,
#answerDialog #answerText ol,
#answerDialog #answerText li {
  font-size: inherit;
}

#answerDialog #answerText h1 {
  font-size: 1.65rem;
}

#answerDialog #answerText h2 {
  font-size: 1.4rem;
}

#answerDialog #answerText h3 {
  font-size: 1.15rem;
}

/* Hide close button during streaming */
#answerDialog footer button.hidden {
  display: none;
}

#answerDialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

#answerDialog footer .cost-container {
  flex: 1 1 auto;
  min-width: 220px;
  font-size: 0.875rem;
  color: var(--pico-muted-color);
  display: block;
  text-align: right;
}

#answerDialog footer .cost-container .cost-line {
  display: block;
}

#answerDialog footer .cost-container .cost-line strong {
  color: inherit;
}

#answerDialog footer .cost-container .cost-meta {
  margin-top: 0.35rem;
  display: block;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  width: 100%;
  text-align: right;
}

#answerDialog footer .cost-container .cost-meta span {
  color: inherit;
}

#answerDialog footer .cost-container .cost-meta .cost-sep {
  opacity: 0.6;
  margin: 0 0.25rem;
}

#answerDialog footer .cost-container .cost-unavailable {
  font-style: italic;
}

#answerDialog footer button {
  flex: 0 0 auto;
}

/* Admin Panel */
.admin-panel {
  margin-top: 3rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(127, 127, 127, 0.1);
  border-radius: 8px;
  border: 2px solid var(--pico-primary);
}

.admin-panel summary {
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--pico-primary);
  padding: 0.5rem;
}

.admin-content {
  margin-top: 1rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-card {
  background: var(--pico-card-background-color);
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 8px;
  padding: 1rem;
}

.admin-card header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(127, 127, 127, 0.25);
  font-size: 1rem;
}

.admin-info dl {
  font-size: 0.875rem;
  margin: 0.5rem 0;
}

.admin-info dt {
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--pico-primary);
}

.admin-info dd {
  margin-left: 1rem;
  margin-bottom: 0.25rem;
}

.admin-logs {
  max-height: 300px;
  overflow-y: auto;
}

.admin-card button {
  width: 100%;
  margin-top: 0.75rem;
}

.admin-card form {
  margin: 0;
}

.admin-card form input {
  margin-bottom: 0.5rem;
}

.admin-card form button {
  margin-top: 0.25rem;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid rgba(127, 127, 127, 0.25);
}

.admin-actions button,
.admin-actions a[role="button"] {
  min-width: 200px;
}

.admin-card .error {
  color: var(--pico-del-color);
  font-weight: 500;
}

@media (max-width: 768px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    flex-direction: column;
  }

  .admin-actions button,
  .admin-actions a[role="button"] {
    width: 100%;
  }
}
