/* ============================================
   MUCMOTAD - Styles personnalisés
   Complément aux classes Tailwind
   ============================================ */

/* ---- Splash Screen ---- */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3E2723 0%, #5D4037 40%, #6D4C41 70%, #4E342E 100%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.splash-screen.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.splash-logo {
  animation: splashPulse 1.5s ease-in-out infinite;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 193, 7, 0.2);
  border-top-color: #FFC107;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Page Transition ---- */
.page-enter {
  animation: pageSlideIn 0.4s ease-out;
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Cards ---- */
.stat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(93, 64, 55, 0.2);
}

/* ---- Toast Notification ---- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  color: white;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.4s ease-out;
  max-width: 400px;
}

.toast.toast-success {
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
}

.toast.toast-error {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
}

.toast.toast-info {
  background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
}

.toast.toast-out {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
}

/* ---- Modal ---- */
.modal-overlay {
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.modal-content {
  animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #EFEBE9;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #BCAAA4;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #8D6E63;
}

/* ---- Table styles ---- */
.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #F5F0EB;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

/* ---- Input Focus ---- */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #FFC107 !important;
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

/* ---- Password toggle ---- */
.password-toggle {
  cursor: pointer;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: #FFC107;
}

/* ---- Button animations ---- */
.btn-primary {
  background: linear-gradient(135deg, #FFC107 0%, #FFA000 100%);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

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

.btn-secondary {
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(93, 64, 55, 0.3);
}

/* ---- Navbar active link ---- */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #FFC107;
  transition: width 0.3s ease, left 0.3s ease;
  border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

/* ---- Semaine Selector ---- */
.week-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.week-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #EFEBE9;
  color: #5D4037;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.week-btn:hover {
  background: #FFC107;
  color: #3E2723;
}

.week-display {
  font-size: 2rem;
  font-weight: 700;
  color: #3E2723;
  min-width: 60px;
  text-align: center;
}

/* ---- Responsive table wrapper ---- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- Empty state ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-state i {
  font-size: 3rem;
  color: #BCAAA4;
  margin-bottom: 1rem;
}

/* ---- Fade In Stagger ---- */
.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.fade-in-up:nth-child(4) { animation-delay: 0.2s; }
.fade-in-up:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Gradient Text ---- */
.gradient-text {
  background: linear-gradient(135deg, #5D4037, #FFC107);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Avatar ---- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #FFC107, #FF8F00);
  color: #3E2723;
}

/* ---- Print Styles ---- */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white !important;
  }

  .stat-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ---- Mobile menu ---- */
@media (max-width: 768px) {
  .mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(62, 39, 35, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .mobile-menu.open {
    transform: translateX(0);
  }

  .mobile-menu a {
    font-size: 1.25rem;
    color: white;
  }
}

/* ---- Selection highlight color ---- */
::selection {
  background: rgba(255, 193, 7, 0.3);
  color: #3E2723;
}
