/* ========================================
   APPRENTISSAGE/TIMER SECTION
======================================== */

/* === Layout principal TalibTimer === */
#talibtimer {
  margin-left: 260px;
}

/* ========================================
   SECTION APPRENTISSAGE - DESIGN MODERNE
======================================== */

#timer {
  background: transparent;
  min-height: 100vh;
  padding: 20px;
  font-family: var(--main-font);
  color: var(--primary-color);
  display: flex;
  flex-direction: column;
  margin-left: 0;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header sobre sans background */
.apprentissage-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 1rem 0;
}

.apprentissage-header-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-color, #274c77) 0%, var(--secondary-color, #6096ba) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(39, 76, 119, 0.25);
}

.apprentissage-header-icon img {
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
}

.apprentissage-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color, #274c77);
  margin: 0;
  letter-spacing: -0.02em;
  font-family: var(--main-font);
}

.apprentissage-subtitle {
  margin: 0.75rem 0 0;
  font-size: 1.1rem;
  color: rgba(39, 76, 119, 0.7);
  font-weight: 400;
}

/* Apprentissage Tabs */
.apprentissage-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.apprentissage-tab-btn {
  padding: 0.6rem 1.5rem;
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--main-font);
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.apprentissage-tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--hover-bg, rgba(0, 0, 0, 0.03));
}

.apprentissage-tab-btn.active {
  color: var(--primary-color);
  font-weight: 600;
  background-color: var(--card-bg, var(--bg-primary, #fff));
  border-color: var(--border-color);
  border-bottom: 2px solid var(--card-bg, var(--bg-primary, #fff));
}

.apprentissage-tab-content {
  display: none;
}

.apprentissage-tab-content.active {
  display: block;
}

/* Conteneur principal avec flexbox */
.apprentissage-main-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  padding: 1rem;
  flex: 1;
}

/* Section Task Selection (en haut, pleine largeur) */
.apprentissage-top-section {
  width: 100%;
}

/* Section 2x2 pour les autres containers */
.apprentissage-grid-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

/* Timer Cards sobres */
.timer {
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(39, 76, 119, 0.12);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(39, 76, 119, 0.08);
  transition: box-shadow 0.3s ease;
  position: relative;
}

.timer:hover {
  box-shadow: 0 4px 12px rgba(39, 76, 119, 0.12);
}

/* Timer dans la section top (Task Selection) */
.apprentissage-top-section .timer {
  width: 100%;
  max-width: none;
  position: relative;
}

/* Timer dans la section grid 2x2 - Harmonisation complète */
.apprentissage-grid-section .timer {
  width: 100%;
  min-width: 0; /* Évite les débordements */
  max-width: 100%;
  position: relative;
  flex: none; /* Retire le flexbox pour utiliser grid */
}

.timer h2 {
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  text-align: center;
  position: relative;
  font-family: var(--main-font);
  letter-spacing: -0.01em;
}

.timer h2::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -5%;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

/* Timer Content */
.timer-content {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 180px;
  justify-content: space-between;
}

/* Alignement spécifique pour timer et stopwatch */
.time_displayed,
.time-control-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  margin: 0.8rem 0;
}

/* Task Selection moderne */
#task-select {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border: 1px solid rgba(96, 150, 186, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  font-size: 0.95rem;
  font-weight: 500;
  height: 40px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#task-select:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(96, 150, 186, 0.1);
  outline: none;
}

#session-info {
  margin: 0.8rem 0;
  text-align: center;
  width: 100%;
}

#session-info p {
  margin: 0.4rem 0;
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Temps affichés avec style moderne */
.time_displayed {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
  margin: 0.8rem 0;
  text-align: center;
  text-shadow: 0 2px 4px rgba(39, 76, 119, 0.1);
}

/* Groupement des boutons modernes */
.button-group {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

/* Style moderne pour tous les boutons */
.button-group button {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(96, 150, 186, 0.3);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  padding: 0.5rem;
  position: relative;
  overflow: hidden;
}

.button-group button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  transition: left 0.3s ease;
  z-index: 1;
}

.button-group button:hover::before {
  left: 0;
}

.button-group button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(39, 76, 119, 0.2);
  border-color: var(--secondary-color);
}

.button-group button:hover img {
  filter: brightness(0) invert(1);
  transform: scale(1.1);
  z-index: 2;
  position: relative;
}

.button-group button img {
  height: 28px;
  width: auto;
  transition: filter 0.3s ease, transform 0.3s ease;
  z-index: 2;
  position: relative;
}

/* Boutons du compteur */
.button-group .counter-button {
  min-width: 70px;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.9rem;
}

/* Supprimer les effets de focus et active uniquement sur les boutons counter */
.button-group .counter-button:focus {
  outline: none;
  border-color: rgba(96, 150, 186, 0.3);
  box-shadow: none;
}

.button-group .counter-button:active {
  outline: none;
  border-color: rgba(96, 150, 186, 0.3);
  box-shadow: none;
  transform: none;
}

/* Boutons de sauvegarde */
#save-button-session {
  background: var(--gradient-secondary);
  border-color: var(--secondary-color);
}

#save-button-session img {
  filter: brightness(0) invert(1);
}

/* Manual Time moderne */
#manual-time-container {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0 0.2rem 0;
  width: 100%;
  flex-wrap: wrap;
}

#manual-time-container div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#manual-time-container label {
  margin-bottom: 0.6rem;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.95rem;
}

#manual-time-container input {
  width: 90px;
  padding: 0.75rem;
  border: 2px solid rgba(96, 150, 186, 0.3);
  border-radius: 0.75rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#manual-time-container input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(96, 150, 186, 0.1);
  outline: none;
}

.total-time {
  margin: 0;
  color: var(--primary-color);
  font-weight: 700;
  text-align: center;
  font-size: 1.1rem;
}

/* Counter moderne */
#counter-value {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin: 0;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 4px rgba(39, 76, 119, 0.1);
}

/* Timer Settings moderne */
.timer-settings {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
  padding: 1rem;
  background: var(--gradient-secondary);
  border-radius: 1rem;
  color: white;
}

.timer-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timer-input-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timer-input {
  width: 80px;
  padding: 0.75rem;
  border: 2px solid rgba(96, 150, 186, 0.3);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timer-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(96, 150, 186, 0.1);
}

.timer-input-suffix {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 500;
}

/* Animation pour le header */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
  }
}

/* ========================================
   APPRENTISSAGE RESPONSIVE DESIGN
======================================== */

/* ========================================
   APPRENTISSAGE RESPONSIVE DESIGN MODERNE
======================================== */

/* Desktop avec sidebar */
@media (min-width: 1245px) {
  .apprentissage-header h1 {
    font-size: 28px;
  }

  .apprentissage-main-container {
    padding: 30px;
    gap: 24px;
  }

  .apprentissage-grid-section {
    gap: 24px;
  }
}


/* Consolidated responsive - Timer */
@media (min-width: 1024px) and (max-width: 1244px) {
  /* === APPRENTISSAGE === */
  .apprentissage-header h1 {
    font-size: 28px;
  }

  .apprentissage-main-container {
    padding: 24px;
  }

  .apprentissage-grid-section {
    gap: 20px;
  }
}

/* Tablette et petits écrans sans sidebar */
@media (max-width: 1024px) {
  .apprentissage-header h1 {
    font-size: 24px;
  }

  .apprentissage-main-container {
    padding: 20px;
    gap: 20px;
  }

  .apprentissage-grid-section {
    gap: 16px;
  }

  .timer h2 {
    font-size: 1.1rem;
    padding: 1rem;
  }

  .timer-content {
    padding: 1.5rem;
    min-height: 220px;
  }
}

/* Tablette */
@media (max-width: 768px) {
  .apprentissage-header {
    padding: 1rem;
  }

  .apprentissage-header h1 {
    font-size: 22px;
  }

  .apprentissage-main-container {
    padding: 1rem;
    gap: 1rem;
  }

  .apprentissage-grid-section {
    gap: 0.8rem;
  }

  .timer h2 {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  .timer-content {
    padding: 0.8rem;
    min-height: 160px;
  }

  .time_displayed {
    font-size: 1.6rem;
    margin: 0.6rem 0;
  }

  #counter-value {
    font-size: 1.6rem;
  }

  .time-control-wrapper {
    min-height: 2.5rem;
    margin: 0.6rem 0;
  }

  .button-group {
    gap: 0.5rem;
    margin: 0.8rem 0;
  }

  .button-group button {
    width: 38px;
    height: 38px;
  }

  .button-group button img {
    height: 20px;
  }

  .button-group .counter-button {
    min-width: 55px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }

  #task-select {
    padding: 0.6rem;
    font-size: 0.9rem;
    height: 44px;
  }

  #session-info p {
    font-size: 0.85rem;
  }

  #manual-time-container {
    gap: 0.8rem;
  }

  #manual-time-container input {
    width: 60px;
    padding: 0.4rem;
    font-size: 0.8rem;
  }

  #manual-time-container label {
    font-size: 0.75rem;
  }

  .timer-input {
    width: 60px;
    padding: 0.4rem;
    font-size: 0.8rem;
  }

  /* Timer digits responsive */
  .time-digit {
    font-size: 1.4rem !important;
    height: 1.6rem !important;
    line-height: 1.6rem !important;
  }

  .time-separator {
    font-size: 1.4rem !important;
    line-height: 1.6rem !important;
  }

  .time-separator-second {
    font-size: 1.2rem !important;
    line-height: 1.4rem !important;
  }

  .time-digit-second {
    font-size: 1.2rem !important;
    height: 1.4rem !important;
    line-height: 1.4rem !important;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .apprentissage-header {
    padding: 0.8rem;
  }

  .apprentissage-header h1 {
    font-size: 22px;
  }

  .apprentissage-main-container {
    padding: 0.8rem;
    gap: 0.8rem;
  }

  .apprentissage-grid-section {
    gap: 0.6rem;
  }

  .timer h2 {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .timer-content {
    padding: 0.7rem;
    min-height: 150px;
  }

  .time_displayed {
    font-size: 1.4rem;
    margin: 0.5rem 0;
  }

  #counter-value {
    font-size: 1.4rem;
  }

  .time-control-wrapper {
    min-height: 2.2rem;
    margin: 0.5rem 0;
  }

  .button-group {
    gap: 0.4rem;
    margin: 0.6rem 0;
  }

  .button-group button {
    width: 36px;
    height: 36px;
  }

  .button-group button img {
    height: 18px;
  }

  .button-group .counter-button {
    min-width: 50px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  #task-select {
    padding: 0.5rem;
    font-size: 0.85rem;
    height: 42px;
  }

  #session-info p {
    font-size: 0.8rem;
  }

  #manual-time-container {
    gap: 0.6rem;
  }

  #manual-time-container input {
    width: 55px;
    padding: 0.3rem;
    font-size: 0.75rem;
  }

  #manual-time-container label {
    font-size: 0.7rem;
  }

  .timer-input {
    width: 55px;
    padding: 0.3rem;
    font-size: 0.75rem;
    border-radius: 0.4rem;
  }

  /* Timer digits responsive */
  .time-digit {
    font-size: 1.2rem !important;
    height: 1.4rem !important;
    line-height: 1.4rem !important;
  }

  .time-separator {
    font-size: 1.2rem !important;
    line-height: 1.4rem !important;
  }

  .time-separator-second {
    font-size: 1rem !important;
    line-height: 1.2rem !important;
  }

  .time-digit-second {
    font-size: 1rem !important;
    height: 1.2rem !important;
    line-height: 1.2rem !important;
  }
}

/* === Breakpoint XS (480px) - Maintien de la grille 2x2 === */
@media (max-width: 480px) {
  #timer {
    padding: 0.4rem;
  }

  .apprentissage-header {
    padding: 0.6rem;
    margin-bottom: 0.2rem;
  }

  .apprentissage-header h1 {
    font-size: 20px;
  }

  .apprentissage-main-container {
    padding: 0.4rem;
    gap: 0.4rem;
  }

  .apprentissage-grid-section {
    gap: 0.4rem;
    /* Maintient la grille 2x2 même sur très petits écrans */
    grid-template-columns: 1fr 1fr;
  }

  .timer {
    margin-bottom: 0;
  }

  .timer h2 {
    padding: 0.25rem;
    font-size: 0.75rem;
  }

  .timer-content {
    padding: 0.4rem !important;
    min-height: 0px !important;
  }

  .time_displayed {
    font-size: 1.5rem !important;
    margin-top: 1.5rem !important;
    min-height: 1.2rem !important;
  }

  #counter-value {
    font-size: 1.5rem !important;
  }

  .time-control-wrapper {
    min-height: 1.8rem !important;
    margin: 0 !important;
  }

  .button-group {
    gap: 0.2rem !important;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0.4rem 0;
  }

  .button-group button {
    width: 24px;
    height: 24px;
  }

  .button-group button img {
    height: 12px;
  }

  .button-group .counter-button {
    min-width: 36px !important;
    padding: 0.2rem 0.3rem;
    font-size: 0.65rem;
  }

  #task-select {
    padding: 0.4rem;
    font-size: 0.75rem;
    border-radius: 0.4rem;
    height: 38px;
  }

  #session-info p {
    font-size: 0.7rem;
    margin: 0.15rem 0;
  }

  #manual-time-container {
    gap: 0.3rem !important;
    justify-content: center;
    flex-wrap: nowrap;
    display: flex;
    flex-direction: row;
    margin: 0px !important;
  }

  #manual-time-container div {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 55px;
    max-width: 70px;
    flex: 0 0 auto;
  }

  #manual-time-container input {
    width: 100%;
    max-width: 55px;
    padding: 0.25rem;
    font-size: 0.7rem;
    border-radius: 0.3rem;
  }

  #manual-time-container label {
    font-size: 0.65rem;
    margin-bottom: 0.1rem;
  }

  .total-time {
    font-size: 0.7rem;
  }

  /* === Styles responsives pour le timer défilant === */
  .time-digit {
    font-size: 1.5rem !important;
    height: 1.2rem !important;
    line-height: 1.2rem !important;
  }

  .time-separator {
    font-size: 1rem !important;
    line-height: 1.2rem !important;
  }

  .time-separator-second {
    font-size: 0.9rem !important;
    line-height: 1.1rem !important;
  }

  .time-digit-second {
    font-size: 0.9rem !important;
    height: 1.1rem !important;
    line-height: 1.1rem !important;
  }

  .time-arrow {
    font-size: 0.9rem;
  }

  .digit-control {
    gap: 0.15rem;
    flex-direction: column;
    align-items: center;
    min-width: 0px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .apprentissage-header {
    padding: 1rem;
  }

  .apprentissage-header h1 {
    font-size: 1.8rem;
  }

  .apprentissage-main-container {
    padding: 1rem;
    gap: 1rem;
  }

  .apprentissage-grid-section {
    gap: 1rem;
  }

  .timer h2 {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .timer-content {
    padding: 0.8rem;
    min-height: 160px;
  }

  .time_displayed {
    font-size: 1.6rem;
    margin: 0.6rem 0;
  }

  #counter-value {
    font-size: 1.6rem;
  }

  .time-control-wrapper {
    min-height: 2.5rem;
    margin: 0.6rem 0;
  }

  .button-group {
    gap: 0.5rem;
    margin: 0.8rem 0;
  }

  .button-group button {
    width: 38px;
    height: 38px;
  }

  .button-group button img {
    height: 20px;
  }

  .button-group .counter-button {
    min-width: 55px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  #task-select {
    padding: 0.6rem;
    font-size: 0.85rem;
    height: 44px;
  }

  #session-info p {
    font-size: 0.8rem;
  }

  #manual-time-container {
    gap: 1rem;
  }

  #manual-time-container input {
    width: 65px;
    padding: 0.4rem;
    font-size: 0.85rem;
  }

  #manual-time-container label {
    font-size: 0.8rem;
  }

  .timer-input {
    width: 70px;
    padding: 0.5rem;
    font-size: 0.9rem;
    border-radius: 0.5rem;
  }

  /* Timer digits responsive */
  .time-digit {
    font-size: 1.7rem;
    height: 2rem;
    line-height: 2rem;
  }

  .time-separator {
    font-size: 1.7rem;
    line-height: 2rem;
  }

  .time-separator-second {
    font-size: 1.4rem;
    line-height: 1.7rem;
  }

  .time-digit-second {
    font-size: 1.4rem;
    height: 1.7rem;
    line-height: 1.7rem;
  }
}

/* Contenu des graphiques modernisé */
.chart-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.5rem;
  overflow: hidden;
}

.chart-wrapper {
  height: 300px;
  transition: height 0.3s ease;
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(39, 76, 119, 0.1);
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.chart-section.details-visible .chart-wrapper {
  height: 200px;
}

/* Section de détails modernisée */
.task-details-section {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 0.75rem;
  margin-top: 0.5rem;
}

.chart-section.details-visible .task-details-section {
  height: 200px;
  opacity: 1;
  padding: 0.75rem;
}

.task-details-section.expanded {
  max-height: 200px;
  border: 1px solid rgba(39, 76, 119, 0.1);
}

/* Tableau modernisé */
.task-details-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(39, 76, 119, 0.1);
}

.task-details-table th,
.task-details-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(39, 76, 119, 0.1);
}

.task-details-table th {
  font-weight: 600;
  color: #000000;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-size: 1.1rem;
}

.task-details-table td {
  color: #212529;
  font-size: 1.05rem;
  font-weight: 500;
}

/* Bouton de basculement modernisé */
.toggle-details-btn {
  width: 100%;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid rgba(39, 76, 119, 0.2);
  border-radius: 0.75rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  font-weight: 500;
  color: var(--primary-color);
}

.toggle-details-btn:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(39, 76, 119, 0.15);
}

.toggle-details-btn svg {
  transition: transform 0.3s ease;
  width: 20px;
  height: 20px;
}

.chart-section.details-visible .toggle-details-btn svg {
  transform: rotate(180deg);
}

/* Tooltip Chart.js modernisé */
.chartjs-tooltip {
  background: rgba(39, 76, 119, 0.95) !important;
  border-radius: 0.75rem !important;
  color: white !important;
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
  /* backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important; */
}

/* États de chargement modernisés */
.chart-wrapper.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background: rgba(255, 255, 255, 0.9);
}

.chart-wrapper.loading::after {
  content: "⏳ Chargement des données...";
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 500;
}

/* Bouton de suppression de l'historique modernisé */
.delete-history-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px auto;
  padding: 0;
  text-align: center;
  width: 100%;
  max-width: 1400px;
}

.delete-history-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.delete-history-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.delete-history-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 13px rgba(220, 53, 69, 0.4);
}

.delete-history-btn:hover::before {
  left: 100%;
}

.delete-history-btn:active {
  transform: translateY(0) scale(1);
}

.delete-history-btn svg {
  width: 24px;
  height: 24px;
  z-index: 2;
  position: relative;
}


/* ========================================
   QUICK TASK FORM (Inline in Talib Timer)
======================================== */

.toggle-quick-task-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
  height: 40px;
}

.toggle-quick-task-btn:hover {
  background: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toggle-quick-task-btn i {
  width: 18px;
  height: 18px;
}

.quick-task-inline {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  animation: slideDown 0.2s ease;
}

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

.quick-task-input {
  flex: 1;
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 0.95rem;
  height: 40px;
  transition: border-color 0.2s ease;
}

.quick-task-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.quick-task-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.quick-task-submit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  height: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-task-submit-btn:hover {
  background: var(--primary-color);
}

.quick-task-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.quick-task-submit-btn.loading {
  opacity: 0.7;
  cursor: wait;
}

.quick-task-submit-btn i {
  width: 16px;
  height: 16px;
}

.quick-task-cancel-btn {
  padding: 0;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 8px;
  height: 40px;
  width: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-task-cancel-btn:hover {
  background: #5a6268;
}

.quick-task-cancel-btn i {
  width: 16px;
  height: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .toggle-quick-task-btn span,
  .quick-task-submit-btn span {
    display: none; /* Hide text on mobile, keep icons */
  }

  .toggle-quick-task-btn,
  .quick-task-submit-btn {
    padding: 10px; /* Icon-only padding */
  }
}

@media (max-width: 480px) {
  .quick-task-inline {
    padding: 8px;
    gap: 6px;
  }

  .quick-task-input {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}

/* ========================================
   TASK SELECT WRAPPER (Dropdown + Button)
======================================== */

.task-select-wrapper {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 0;
}

.task-select-wrapper #task-select {
  flex: 2;
  min-width: 200px;
  max-width: 400px;
  height: 40px;
}

.task-select-wrapper .toggle-quick-task-btn {
  margin-top: 0;
  width: auto;
  flex-shrink: 0;
  flex-grow: 0;
  height: 40px;
  max-width: 180px;
}

@media (max-width: 768px) {
  .task-select-wrapper .toggle-quick-task-btn span {
    display: none;
  }
  
  .task-select-wrapper .toggle-quick-task-btn {
    padding: 10px;
    min-width: 44px;
  }
}

/* Update responsive rules for new classes */
@media (max-width: 768px) {
  .toggle-quick-task-text,
  .quick-task-submit-text {
    display: none !important;
  }
}

