/* Typo générale */
body {
  background: #F8FAFC;
  color: #1e293b;
  font-family: 'Inter', Arial, sans-serif;
  margin: 0;
}

/* Header/nav */
nav.gradient-bg {
  background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
  min-height: 56px;
}

nav a,
nav button {
  color: #fff;
  font-weight: 500;
}

nav a:hover {
  color: #fde68a;
  border-bottom: 2px solid #fde68a;
}

/* Titres */
h1, h2, h3, h4 {
  color: #ea580c;
  font-weight: 800;
}

h1 { font-size: 2.3rem;}
h2 { font-size: 1.7rem;}
h3 { font-size: 1.15rem;}

/* Cartes + sections */
.bg-white, .rounded-xl {
  background: #fff;
  border-radius: 1rem;
}

.shadow-md {
  box-shadow: 0 2px 20px 0 rgb(251, 146, 60, 0.08);
}

/* Boutons génériques */
button, .btn {
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  padding: 0.65em 1.4em;
  cursor: pointer;
  transition: background .18s, color .18s;
}

.gradient-bg,
.btn.orange {
  background:linear-gradient(90deg,#f97316 0%, #ea580c 100%);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px #ea580c18;
}
.gradient-bg:hover, .btn.orange:hover {
  filter: brightness(1.05) contrast(1.1);
}

.btn.white {
  background: #fff;
  color: #ea580c;
  border: 1px solid #f97316;
}
.btn.white:hover {
  background: #fde68a;
  color: #ea580c;
}

button[disabled] {
  background: #e5e7eb !important;
  color: #a1a1aa !important;
  cursor: not-allowed;
}

.btn.danger, .bg-danger {
  background: #fff5f5;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* Inputs et formulaires */
input, select, textarea {
  border-radius: 0.5rem;
  border: 1.5px solid #f97316;
  padding: 0.5em 1em;
  background: #fff;
  color: #1e293b;
  margin-bottom: .6em;
  transition: border .17s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #ea580c;
  background: #fffbea;
}
label {
  color: #ea580c;
  font-weight: bold;
  margin-bottom: 0.3em;
  display:block;
}

/* Tableaux */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}
thead th {
  background: #fb923c;
  color: #fff;
  font-weight: bold;
  padding: .7em .5em;
  text-align:left;
}
tbody tr:nth-child(even) {
  background: #fff5eb;
}
tbody td {
  padding: 0.7em .5em;
  border-bottom: 1px solid #fde68a;
}
tbody tr:hover {
  background: #fde68a40;
}

/* Modales */
.modal-bg {
  background: rgba(24, 24, 24, 0.82);
}
#eventModal .bg-white {
  border: 3px solid #f97316;
}

/* Checkbox custom (symptômes) */
input[type="checkbox"].symptom-filter:checked + label,
input[type="checkbox"].symptom-checkbox:checked + label {
  background: #f97316 !important;
  color: #fff !important;
  border-color: #ea580c;
  font-weight:700;
}

/* popups / alertes */
.bg-red-100 { background: #fff5f5; color: #dc2626; }
.bg-green-100 { background: #f0fdf4; color: #22c55e; }

a {
  color: #f97316;
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: #ea580c; text-decoration: underline; }

/* Footer */
footer.gradient-bg {
  background: linear-gradient(90deg, #ea580c 0%, #f97316 100%);
  color: #fff;
}
footer a { color: #fde68a; }
footer a:hover { color: #fff; }

footer h3{
    color:#F8FAFC!important;
}

/* Responsive bonus */
@media (max-width: 800px) {
  .container { padding: 0 0.8em;}
  h1,h2 { font-size: 1.6rem;}
  .rounded-xl { border-radius: 1em; }
}


/*Calendrier modal */
#modalDetail {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    padding: 20px;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10001;
  }
  #modalOverlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right:0; bottom:0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
  }
  #modalDetail button.closeBtn {
    margin-top: 15px;
    padding: 8px 15px;
    background: #f44336;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
  }


  /* Événements en rouge */

/* Coloration des jours avec migraines */
.fc-day.migraine-day {
    background-color: rgba(220, 38, 38, 0.1) !important;
}

.fc-daygrid-day.migraine-day {
    background-color: rgba(220, 38, 38, 0.1) !important;
}

/* Événements de fond pour les jours avec migraines */
.fc-bg-event.migraine-day {
    background-color: rgba(220, 38, 38, 0.2) !important;
    opacity: 1 !important;
}

/* Style pour les événements de migraine */
.fc-event.migraine-event {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: white !important;
}

/* Amélioration de la visibilité */
.fc-daygrid-day-frame {
    position: relative;
}

.fc-bg-event {
    opacity: 0.3;
}





/* tableau des crises */
.episodes-container {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.episodes-table {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.episodes-table.sliding-out {
    transform: translateX(-100%);
    opacity: 0;
}

.episodes-table.sliding-in {
    transform: translateX(100%);
    opacity: 0;
}

.episodes-table.active {
    transform: translateX(0);
    opacity: 1;
}

.pagination-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pagination-button {
    transition: all 0.2s ease;
}

.pagination-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Container du calendrier avec hauteur automatique */
#calendar-container {
    margin-top: 2rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

/* Calendrier avec hauteur automatique */
#calendar {
    /* Supprimer toute hauteur fixe */
    min-height: 400px; /* Hauteur minimum pour éviter un calendrier trop petit */
}

/* S'assurer que FullCalendar s'adapte */
.fc {
    height: auto !important;
}

.fc-view-harness {
    height: auto !important;
}

.fc-daygrid {
    height: auto !important;
}

/* Ajustements pour les différentes vues */
.fc-dayGridMonth-view,
.fc-timeGridWeek-view,
.fc-timeGridDay-view {
    height: auto !important;
}

/* Assurer que les cellules du calendrier s'ajustent bien */
.fc-daygrid-day {
    min-height: 80px; /* Hauteur minimum pour les cellules de jour */
}

.fc-timegrid-slot {
    height: auto;
}



/* Animation pour la bannière d'installation */
#installBanner {
    animation: slideDown 0.5s ease-out;
}

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

/* Style pour les instructions PWA */
.pwa-instructions {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Indicateur visuel pour l'app installée */
.app-installed-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #10b981;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    z-index: 1000;
}

/* Masquer la bannière sur les très petits écrans */
@media (max-width: 480px) {
    #installBanner .hidden\:md\:flex {
        display: none !important;
    }
}

/* Style pour le mode standalone (app installée) */
@media (display-mode: standalone) {
    #installBanner,
    #pwaInfoCard {
        display: none !important;
    }
}


/* Animation pour le bouton de suppression */
#dismissBannerPermanent:hover,
#dismissBannerMobilePermanent:hover {
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Style pour le bouton croix */
#dismissBannerPermanent,
#dismissBannerMobilePermanent {
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animation de confirmation */
.dismiss-confirmation {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Hover effect pour la bannière entière */
#installBanner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}





/* Statistiques / graphiques */

#stats {
  /* display: grid; */
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

#stats canvas {
  background: #FFF;
  border-radius: 0.5em;
  box-shadow: 0 1px 15px #f9731622;
  max-width: 100%;
  max-height: 300px;
  width: 100%;
  display: block;
  margin-bottom: 0;
}

#stats canvas:nth-child(3) {
  grid-column: span 2;
}


/* Modales */
.modal-bg {
  background: rgba(24, 24, 24, 0.82);
}
#eventModal .bg-white {
  border: 3px solid #f97316;
}

/* Checkbox custom (symptômes) */
input[type="checkbox"].symptom-filter:checked + label,
input[type="checkbox"].symptom-checkbox:checked + label {
  background: #f97316 !important;
  color: #fff !important;
  border-color: #ea580c;
  font-weight:700;
}

/* popups / alertes */
.bg-red-100 { background: #fff5f5; color: #dc2626; }
.bg-green-100 { background: #f0fdf4; color: #22c55e; }

a {
  color: #f97316;
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: #ea580c; text-decoration: underline; }

/* Footer */
footer.gradient-bg {
  background: linear-gradient(90deg, #ea580c 0%, #f97316 100%);
  color: #fff;
}
footer a { color: #fde68a; }
footer a:hover { color: #fff; }

footer h3{
    color:#F8FAFC!important;
}

/* Responsive bonus */
@media (max-width: 800px) {
  .container { padding: 0 0.8em;}
  h1,h2 { font-size: 1.6rem;}
  .rounded-xl { border-radius: 1em; }
}


/*Calendrier modal */
#modalDetail {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    padding: 20px;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10001;
  }
  #modalOverlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right:0; bottom:0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
  }
  #modalDetail button.closeBtn {
    margin-top: 15px;
    padding: 8px 15px;
    background: #f44336;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
  }