/* ==========================================================================
   DENTINET - Dra. Florencia Arias Banegas • Odontología Integral
   Estilos CSS, Paleta de Color de Marca y Odontograma Interactivo FDI
   ========================================================================== */

:root {
  --berry-50: #faf4f7;
  --berry-100: #f5e8ef;
  --berry-500: #8b245e;
  --berry-600: #6b1b48;
  --berry-700: #5c1d42;
  --berry-800: #4a1535;
  --berry-900: #380d26;
  --coral-500: #e63956;
  --teal-500: #00a896;
  --gold-500: #e9c46a;
}

/* Tipografía y suavizado */
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #faf8f5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f3efe9;
}
::-webkit-scrollbar-thumb {
  background: #d6cfc5;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #b5aba0;
}

/* Glassmorphism & Cards */
.glass-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(230, 224, 215, 0.8);
}

.glass-dark {
  background: rgba(56, 13, 38, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Transiciones suaves */
.transition-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.transition-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(92, 29, 66, 0.08), 0 8px 10px -6px rgba(92, 29, 66, 0.04);
}

/* Pulso de disponibilidad */
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.3; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.live-dot {
  position: relative;
}
.live-dot::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: pulse-ring 2s infinite ease-in-out;
}

/* ==========================================================================
   ODONTOGRAMA DIGITAL INTERACTIVO (FDI)
   ========================================================================== */
.odontogram-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  user-select: none;
}

.tooth-quadrant {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.tooth-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

.tooth-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  line-height: 1;
}

.tooth-svg {
  width: 38px;
  height: 38px;
  cursor: pointer;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.05));
  transition: transform 0.15s ease, filter 0.15s ease;
}

.tooth-svg:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 4px 6px rgba(92, 29, 66, 0.25));
  z-index: 10;
}

.tooth-surface {
  fill: #ffffff;
  stroke: #94a3b8;
  stroke-width: 1.5;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.tooth-surface:hover {
  fill: #f1e9ec;
}

/* Estados de Superficies Dentales */
.tooth-surface.state-caries {
  fill: #e63956 !important; /* Rojo Coral: Caries activa */
}

.tooth-surface.state-restored {
  fill: #00a896 !important; /* Verde Azulado / Teal: Obturación / Arreglo */
}

.tooth-surface.state-sealant {
  fill: #10b981 !important; /* Verde: Sellador */
}

.tooth-surface.state-fracture {
  fill: #e9c46a !important; /* Amarillo Oro: Fractura */
}

/* Estados de Pieza Completa (Overlays) */
.tooth-item.state-crown .tooth-svg {
  background-color: #fef08a;
  border-radius: 6px;
  border: 2px solid #e9c46a;
}

.tooth-item.state-endodontics .tooth-number::after {
  content: '⚡';
  font-size: 0.7rem;
  color: #8b245e;
  position: absolute;
  top: -10px;
}

.tooth-item.state-extraction-needed::after {
  content: '✕';
  position: absolute;
  top: 14px;
  font-size: 28px;
  font-weight: 900;
  color: #e63956;
  line-height: 1;
  pointer-events: none;
}

.tooth-item.state-missing::after {
  content: '✕';
  position: absolute;
  top: 14px;
  font-size: 28px;
  font-weight: 900;
  color: #380d26;
  line-height: 1;
  pointer-events: none;
}

.tooth-item.state-missing .tooth-svg {
  opacity: 0.35;
}

.tooth-item.state-implant .tooth-number::after {
  content: '🔩';
  font-size: 0.7rem;
  position: absolute;
  top: -10px;
}

/* Modal y Popover */
.modal-backdrop {
  background-color: rgba(45, 12, 32, 0.65);
  backdrop-filter: blur(6px);
}

/* Estilos de Impresión */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  .no-print, nav, footer, button, .admin-sidebar, .tab-buttons {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .print-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
