/* =========================================================================
   THÈME 3D — LGS (SIC SARL)
   Même palette de couleurs (variables.css), rendu volumétrique en relief.
   Fichier d'habillage : aucune variable de couleur n'est modifiée.
   ========================================================================= */

/* ---------- Surface de fond : profondeur ambiante ---------- */
body {
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--primary-glow), transparent 60%),
    radial-gradient(1000px 500px at 110% 110%, var(--secondary-light), transparent 55%),
    var(--bg-app);
  background-attachment: fixed;
}

/* ---------- Cartes & panneaux : relief avec biseau lumineux ---------- */
.card,
.stat-card,
.data-table-wrapper,
.modal-dialog,
.toast-item,
.global-search-box {
  box-shadow:
    /* liseré supérieur lumineux (bevel haut) */
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    /* ombre portée profonde pour la levée */
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 10px 24px -6px rgba(15, 23, 42, 0.16),
    0 22px 50px -18px rgba(79, 70, 229, 0.12);
}

.card:hover,
.stat-card:hover,
.data-table-wrapper:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 2px 4px rgba(15, 23, 42, 0.06),
    0 16px 34px -8px rgba(15, 23, 42, 0.22),
    0 30px 60px -20px rgba(79, 70, 229, 0.18);
}

/* Second plan des cartes : colonne de profondeur */
.card::after,
.stat-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.07), transparent);
  filter: blur(6px);
  border-radius: 50%;
  opacity: 0.6;
  pointer-events: none;
}

/* ---------- Boutons : bouton 3D enfoncé / relevé ---------- */
.btn {
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 4px 8px rgba(15, 23, 42, 0.12),
    0 1px 2px rgba(15, 23, 42, 0.08);
  transform: translateY(0);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 7px 14px rgba(15, 23, 42, 0.18),
    0 2px 4px rgba(15, 23, 42, 0.1);
}

.btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(15, 23, 42, 0.1);
}

/* Gradient gloss sur les boutons pleins */
.btn-primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.btn-secondary {
  background: linear-gradient(180deg, var(--secondary) 0%, var(--secondary-hover) 100%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.btn-success {
  background: linear-gradient(180deg, var(--success) 0%, var(--success-hover) 100%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.btn-danger {
  background: linear-gradient(180deg, #f87171 0%, var(--danger) 100%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.btn-warning {
  background: linear-gradient(180deg, #fbbf24 0%, var(--warning) 100%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Bouton outline : relief creusé */
.btn-outline {
  background: linear-gradient(180deg, var(--bg-surface-elevated) 0%, var(--bg-muted) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    0 3px 6px rgba(15, 23, 42, 0.08);
}
.btn-outline:hover {
  transform: translateY(-1px);
}

/* ---------- Barre latérale : frise de profondeur ---------- */
.app-sidebar {
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.6),
    2px 0 12px rgba(15, 23, 42, 0.04);
}

/* Lien actif : brillance volumétrique */
.nav-link.active {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 14px var(--primary-glow);
}

/* ---------- En-tête : plateau en hauteur ---------- */
.app-header {
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 6px 18px rgba(15, 23, 42, 0.08);
}

.header-icon-btn,
.sidebar-toggle-btn,
.theme-toggle-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 4px rgba(15, 23, 42, 0.08);
}
.header-icon-btn:active,
.sidebar-toggle-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* ---------- Champs de saisie : rainure (inset) ---------- */
.form-control,
.form-select,
.table-search-input,
.role-switcher-select {
  box-shadow:
    inset 0 2px 4px rgba(15, 23, 42, 0.06),
    inset 0 -1px 0 rgba(255, 255, 255, 0.6);
}
.form-control:focus,
.form-select:focus,
.table-search-input:focus,
.role-switcher-select:focus {
  box-shadow:
    inset 0 2px 4px rgba(15, 23, 42, 0.04),
    0 0 0 4px var(--primary-glow);
  transform: translateY(-1px);
}

/* ---------- Badges : pastille en relief ---------- */
.badge-primary,
.badge-success,
.badge-warning,
.badge-danger,
.badge-info {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 2px 4px rgba(15, 23, 42, 0.08);
}

/* ---------- Blocs de statistiques : icônes en "bouton" ---------- */
.stat-icon-wrapper {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 4px 8px rgba(15, 23, 42, 0.12);
}

/* ---------- Logo et mini-avatar : jetons 3D ---------- */
.sidebar-logo {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 14px var(--primary-glow),
    0 1px 2px rgba(15, 23, 42, 0.2);
}
.user-avatar-mini {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 3px 8px rgba(15, 23, 42, 0.25);
}

/* ---------- Modal : profondeur renforcée ---------- */
.modal-backdrop {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.72));
}
.modal-dialog {
  transform: perspective(1200px) translateZ(0);
  animation: modal3d 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes modal3d {
  0% { opacity: 0; transform: perspective(1200px) translateY(28px) rotateX(6deg) scale(0.96); }
  100% { opacity: 1; transform: perspective(1200px) translateY(0) rotateX(0) scale(1); }
}

/* ---------- Notifications toast : pastilles flottantes ---------- */
.toast-item {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 12px 30px -6px rgba(15, 23, 42, 0.3);
}

/* ---------- Bulles de chat (3D) ---------- */
.chat-message-bubble.incoming {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 4px 10px rgba(15, 23, 42, 0.1);
}
.chat-message-bubble.outgoing {
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 4px 10px var(--primary-glow);
}

/* ---------- Modes de paiement / cartes interactives ---------- */
.payment-method-card,
.schedule-slot-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 5px 12px rgba(15, 23, 42, 0.1);
}
.payment-method-card:hover,
.schedule-slot-card:hover {
  transform: translateY(-3px) scale(1.005);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 10px 22px rgba(15, 23, 42, 0.16),
    0 18px 40px -12px var(--primary-glow);
}

/* ---------- Lignes de tableau : soulèvement au survol ---------- */
.data-table tbody tr {
  transform: translateY(0);
}
.data-table tbody tr:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 3px 0 0 var(--primary),
    0 3px 10px rgba(15, 23, 42, 0.08);
}

/* ---------- Felts animés de survol du texte ---------- */
.stat-value {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---------- Icônes du menu : jetons 3D réalistes ---------- */
.nav-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 16px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4) 45%, rgba(226, 232, 240, 0.35) 100%),
    linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(120, 130, 150, 0.18),
    0 1px 2px rgba(15, 23, 42, 0.18),
    0 4px 8px -1px rgba(15, 23, 42, 0.22);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}
.nav-link:hover .nav-icon {
  transform: translateY(-1px) translateZ(2px) scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(120, 130, 150, 0.15),
    0 2px 3px rgba(15, 23, 42, 0.2),
    0 8px 16px -2px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.4);
}
.nav-link:active .nav-icon {
  transform: translateY(1px) scale(0.95);
  box-shadow:
    inset 0 2px 5px rgba(15, 23, 42, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5),
    0 1px 2px rgba(15, 23, 42, 0.12);
}
.nav-link.active .nav-icon {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0.25) 100%),
    linear-gradient(180deg, #ffffff 0%, #edeffd 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(99, 102, 241, 0.35),
    0 1px 2px rgba(79, 70, 229, 0.35),
    0 5px 12px -1px var(--primary-glow);
  transform: translateY(0) scale(1.03);
}

[data-theme="dark"] .nav-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06) 50%, transparent 100%),
    linear-gradient(180deg, #2a2f45 0%, #1f2437 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 4px 8px -1px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .nav-link:hover .nav-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 50%, transparent 100%),
    linear-gradient(180deg, #343a55 0%, #232840 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 2px 3px rgba(0, 0, 0, 0.5),
    0 8px 16px -2px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .nav-link.active .nav-icon {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 100%),
    linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 5px 14px -1px var(--primary-glow);
}

/* ---------- Mode sombre : activer le mode 3D ---------- */
[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(79, 70, 229, 0.18), transparent 60%),
    var(--bg-app);
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .data-table-wrapper,
[data-theme="dark"] .modal-dialog,
[data-theme="dark"] .toast-item,
[data-theme="dark"] .global-search-box,
[data-theme="dark"] .payment-method-card,
[data-theme="dark"] .schedule-slot-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 10px 24px -6px rgba(0, 0, 0, 0.55),
    0 22px 50px -18px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .card::after,
[data-theme="dark"] .stat-card::after {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
}

[data-theme="dark"] .btn,
[data-theme="dark"] .header-icon-btn,
[data-theme="dark"] .sidebar-toggle-btn,
[data-theme="dark"] .theme-toggle-btn,
[data-theme="dark"] .badge-primary,
[data-theme="dark"] .badge-success,
[data-theme="dark"] .badge-warning,
[data-theme="dark"] .badge-danger,
[data-theme="dark"] .badge-info {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 10px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .table-search-input,
[data-theme="dark"] .role-switcher-select {
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .stat-value {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
