/* ============================================================================
   FILE: /css/tiimbo-ui.css
   Composants d'interface transverses de Tiimbo (docs/26-conventions-interface.md)
   - toasts (toastr)
   - select personnalise (regle 3 : jamais de <select> natif visible)
   Couleurs adaptees a la charte Tiimbo (bleu #0d5afd), structure reprise de
   schoolmanager/mobile/notes.php.
   ============================================================================ */

@import url('toastr.css');

/* ── Select personnalise ─────────────────────────────────────────────────── */

.custom-select-wrapper {
  position: relative;
  margin-bottom: 10px;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(13, 90, 253, .35);
  background: rgba(13, 90, 253, .05);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  transition: border-color .2s, background .2s;
  user-select: none;
}

.custom-select-trigger:hover,
.custom-select-trigger.open {
  border-color: var(--bs-primary, #0d5afd);
  background: rgba(13, 90, 253, .09);
}

.custom-select-trigger.disabled {
  opacity: .55;
  cursor: not-allowed;
  background: rgba(0, 0, 0, .03);
  border-color: rgba(0, 0, 0, .15);
}

.custom-select-trigger .trigger-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.custom-select-trigger .trigger-icon {
  font-size: 17px;
  color: var(--bs-primary, #0d5afd);
}

.custom-select-trigger .trigger-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger .trigger-arrow {
  font-size: 15px;
  color: var(--bs-primary, #0d5afd);
  transition: transform .25s;
}

.custom-select-trigger.open .trigger-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1056; /* au-dessus des modales Bootstrap (1055) */
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid rgba(13, 90, 253, .2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .13);
  max-height: 352px;
  overflow-y: auto;
  animation: dropDown .2s ease;
}

@keyframes dropDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-select-dropdown.open {
  display: block;
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background: rgba(13, 90, 253, .07);
}

.custom-select-option.selected {
  background: rgba(13, 90, 253, .12);
  font-weight: 600;
  color: var(--bs-primary, #0d5afd);
}

.custom-select-option .opt-icon {
  font-size: 16px;
  color: var(--bs-primary, #0d5afd);
  flex-shrink: 0;
}

.custom-select-option .opt-check {
  margin-left: auto;
  font-size: 15px;
  color: var(--bs-primary, #0d5afd);
  display: none;
}

.custom-select-option.selected .opt-check {
  display: block;
}

/* Le select natif enrichi reste dans le DOM (formulaires, JS existant)
   mais n'est jamais visible (regle 4). */
select.tiimbo-select-hidden {
  display: none !important;
}

/* Custom sidebar style */
.tiimbo-sidenav-header {
  background: #0134d4;
  padding: 40px 20px 30px 20px;
  color: white;
  position: relative;
}

.tiimbo-sidenav-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.tiimbo-sidenav-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
  object-fit: cover;
}

.tiimbo-academic-year-card {
  background-color: #eef2ff;
  border-radius: 12px;
  padding: 10px 15px;
  margin: 15px 15px 5px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tiimbo-academic-year-card i.calendar-icon {
  font-size: 18px;
  color: #0134d4;
}

.tiimbo-academic-year-info {
  flex-grow: 1;
  margin-left: 12px;
}

.tiimbo-academic-year-info small {
  display: block;
  font-size: 9px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tiimbo-academic-year-info strong {
  font-size: 13px;
  color: #333;
}

.tiimbo-academic-year-card i.settings-icon {
  font-size: 14px;
  color: #888;
  cursor: pointer;
}

/* Sidenav footer details */
.tiimbo-sidenav-footer {
  padding: 20px;
  margin-top: auto;
  text-align: center;
}

.tiimbo-codeheidi-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6c757d;
  font-size: 13px;
  text-decoration: none;
  margin-top: 8px;
}

.tiimbo-hexagon-logo {
  width: 20px;
  height: 20px;
  background: #0134d4;
  color: white;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  font-size: 10px;
}
