/* === STYLE GLOBAL - Planification Réinventée === */
/* Couleurs 3 Temps du Soin */
:root {
  /* Chronos - Automatiser */
  --chronos: #0066FF;
  --chronos-light: #4D94FF;
  --chronos-dark: #0047B3;

  /* Kairos - Humaniser */
  --kairos: #FF6B35;
  --kairos-light: #FF8C66;
  --kairos-dark: #CC5527;

  /* Aion - Équilibrer */
  --aion: #4CAF50;
  --aion-light: #6FBF73;
  --aion-dark: #388E3C;

  /* Neutrals */
  --bg-light: #F5F7FA;
  --bg-white: #FFFFFF;
  --text-dark: #263238;
  --text-gray: #607D8B;
  --text-light: #90A4AE;
  --border: #CFD8DC;
  --shadow: rgba(0, 0, 0, 0.1);

  /* Status */
  --success: #4CAF50;
  --warning: #FFC107;
  --error: #F44336;
  --info: #2196F3;
}

/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* === LAYOUT MOBILE === */
.mobile-container {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-white);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 20px var(--shadow);
}

/* === LAYOUT DESKTOP === */
.desktop-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* === HEADER === */
.header {
  background: linear-gradient(135deg, var(--chronos) 0%, var(--kairos) 50%, var(--aion) 100%);
  color: white;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px var(--shadow);
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 5px;
}

.header .subtitle {
  font-size: 14px;
  opacity: 0.9;
}

.header-desktop {
  background: var(--bg-white);
  border-bottom: 3px solid var(--chronos);
  padding: 20px;
  margin-bottom: 20px;
}

.header-desktop h1 {
  color: var(--text-dark);
  font-size: 28px;
}

/* === PROFIL GAMIFIÉ === */
.profile-card {
  background: white;
  margin: 20px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kairos), var(--aion));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  color: white;
}

.profile-info h2 {
  font-size: 18px;
  color: var(--text-dark);
}

.profile-role {
  font-size: 14px;
  color: var(--text-gray);
}

.level-badge {
  display: inline-block;
  background: var(--chronos);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
}

/* === STATS GAMIFICATION === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  background: var(--bg-light);
}

.stat-card.chronos { background: linear-gradient(135deg, var(--chronos-light), var(--chronos)); color: white; }
.stat-card.kairos { background: linear-gradient(135deg, var(--kairos-light), var(--kairos)); color: white; }
.stat-card.aion { background: linear-gradient(135deg, var(--aion-light), var(--aion)); color: white; }

.stat-value {
  font-size: 28px;
  font-weight: bold;
  display: block;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 5px;
}

/* === BADGES === */
.badges-section {
  margin-top: 20px;
}

.badges-section h3 {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 10px;
}

.badges-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-light);
  min-width: 70px;
}

.badge.earned {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.badge-icon {
  font-size: 32px;
  margin-bottom: 5px;
}

.badge-name {
  font-size: 10px;
  text-align: center;
  color: var(--text-gray);
}

.badge.earned .badge-name {
  color: var(--text-dark);
  font-weight: 600;
}

/* === BADGES INLINE (médailles dentelées) === */
.badges-list-inline {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px 0;
}

.badge-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 65px;
  transition: transform 0.3s;
}

.badge-medal:hover {
  transform: scale(1.15);
}

/* Médaille dentelée avec clip-path */
.badge-icon-medal {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: #D3D3D3;
  position: relative;
  border-radius: 50%;
  clip-path: polygon(
    50% 0%, 61% 5%, 70% 0%, 79% 5%, 88% 0%, 95% 9%, 100% 12%, 95% 21%, 100% 30%, 95% 39%, 100% 50%,
    95% 61%, 100% 70%, 95% 79%, 100% 88%, 91% 95%, 88% 100%, 79% 95%, 70% 100%, 61% 95%, 50% 100%,
    39% 95%, 30% 100%, 21% 95%, 12% 100%, 9% 91%, 0% 88%, 5% 79%, 0% 70%, 5% 61%, 0% 50%,
    5% 39%, 0% 30%, 5% 21%, 0% 12%, 9% 5%, 12% 0%, 21% 5%, 30% 0%, 39% 5%
  );
  filter: grayscale(0.5) brightness(0.9);
}

/* Badge earned : médaille dorée brillante */
.badge-medal.earned .badge-icon-medal {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
  filter: drop-shadow(0 4px 8px rgba(255, 165, 0, 0.5)) brightness(1.1);
  animation: badgeShine 3s ease-in-out infinite;
}

@keyframes badgeShine {
  0%, 100% {
    filter: drop-shadow(0 4px 8px rgba(255, 165, 0, 0.5)) brightness(1.1);
  }
  50% {
    filter: drop-shadow(0 6px 12px rgba(255, 215, 0, 0.8)) brightness(1.3);
  }
}

.badge-name-medal {
  font-size: 9px;
  text-align: center;
  color: var(--text-gray);
  font-weight: 600;
  line-height: 1.2;
  max-width: 65px;
}

.badge-medal.earned .badge-name-medal {
  color: #FF8C00;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(255, 140, 0, 0.3);
}

/* === BOUTONS === */
.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  text-decoration: none;
  color: white;
}

.btn-chronos {
  background: linear-gradient(135deg, var(--chronos-light), var(--chronos));
}

.btn-kairos {
  background: linear-gradient(135deg, var(--kairos-light), var(--kairos));
}

.btn-aion {
  background: linear-gradient(135deg, var(--aion-light), var(--aion));
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-dark);
  border: 2px solid var(--border);
}

/* === CARDS === */
.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.card-icon {
  font-size: 24px;
}

/* === FORMULAIRES === */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--chronos);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* === CALENDRIER === */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  background: var(--bg-light);
}

.calendar-day.clickable {
  cursor: pointer;
}

.calendar-day.clickable:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px var(--shadow);
}

.calendar-day.clickable:active {
  transform: scale(0.95);
}

.calendar-day.selected {
  background: var(--chronos);
  color: white;
  font-weight: bold;
  box-shadow: 0 0 0 2px var(--chronos-dark);
}

.calendar-day.busy {
  background: var(--kairos-light);
  color: white;
  position: relative;
}

.calendar-day.busy.selected {
  background: var(--chronos);
}

.calendar-day.busy::before {
  content: '🔥';
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
}

/* === LISTE DEMANDES === */
.demande-list {
  margin-top: 20px;
}

.demande-item {
  background: white;
  border-left: 4px solid var(--chronos);
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--shadow);
}

.demande-item.kairos { border-left-color: var(--kairos); }
.demande-item.aion { border-left-color: var(--aion); }

.demande-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.demande-type {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-light);
  color: var(--text-gray);
  font-weight: 600;
}

.demande-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.demande-status.pending { background: #FFF3CD; color: #856404; }
.demande-status.approved { background: #D4EDDA; color: #155724; }
.demande-status.rejected { background: #F8D7DA; color: #721C24; }

/* === NOTIFICATIONS (AMÉLIORÉES - EN HAUT) === */
.notification-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 480px;
  pointer-events: none;
}

.notification-toast {
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  border-left: 4px solid var(--info);
}

.notification-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.notification-toast.hide {
  transform: translateY(-100px);
  opacity: 0;
}

.notification-toast.success {
  border-left-color: var(--success);
  background: linear-gradient(135deg, #E8F5E9 0%, white 100%);
}

.notification-toast.warning {
  border-left-color: var(--warning);
  background: linear-gradient(135deg, #FFF3E0 0%, white 100%);
}

.notification-toast.error {
  border-left-color: var(--error);
  background: linear-gradient(135deg, #FFEBEE 0%, white 100%);
}

.notification-toast.info {
  border-left-color: var(--info);
  background: linear-gradient(135deg, #E3F2FD 0%, white 100%);
}

.notification-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.notification-message {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
}

/* Ancienne notification (backward compatibility) */
.notification {
  background: white;
  border-left: 4px solid var(--info);
  padding: 15px;
  margin: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

.notification.success { border-left-color: var(--success); }
.notification.warning { border-left-color: var(--warning); }
.notification.error { border-left-color: var(--error); }

/* Animation fade out pour suppression notification et demandes cadre */
.notif-item.fade-out,
.demande-card-large.fade-out {
  animation: fadeOutNotif 0.4s ease-out forwards;
}

@keyframes fadeOutNotif {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
    max-height: 200px;
  }
  50% {
    opacity: 0.5;
    transform: translateX(20px) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translateX(40px) scale(0.9);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* === NAVIGATION BOTTOM === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  box-shadow: 0 -2px 10px var(--shadow);
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  text-decoration: none;
  color: var(--text-gray);
  transition: all 0.3s;
}

.nav-item.active {
  color: var(--chronos);
}

.nav-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.nav-label {
  font-size: 11px;
}

/* === DESKTOP GRID === */
.desktop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .badges-list {
    justify-content: center;
  }
}

/* === UTILITIES === */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }

.hidden { display: none; }
