﻿/* Odontogram Demo Styles */

.odontogram-demo-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.odontogram-card-demo {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.odontogram-header-demo {
  margin-bottom: 20px;
}

.odontogram-header-demo h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.odontogram-header-demo h4 i {
  color: var(--primary-light);
}

.odontogram-header-demo p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.odontogram-main-demo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.odontogram-teeth-area-demo {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dental-arch-demo {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
  padding: 16px 40px;
}

.dental-arch-demo.upper {
  border-bottom: 2px solid var(--border);
  padding-bottom: 20px;
}

.dental-arch-demo.lower {
  padding-top: 12px;
}

.arch-label-demo {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.arch-label-demo.right {
  left: auto;
  right: 0;
  transform: translateY(-50%) rotate(90deg);
}

.quadrant-demo {
  display: flex;
  gap: 4px;
}

.quadrant-demo.q1,
.quadrant-demo.q4 {
  flex-direction: row-reverse;
}

/* Tooth Professional Style */
.tooth-pro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}

.dental-arch-demo.lower .tooth-pro {
  flex-direction: column-reverse;
}

.tooth-pro:hover {
  transform: scale(1.15);
  z-index: 10;
}

.tooth-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  transition: color 0.2s;
}

/* Tooth number colors by treatment */
.tooth-num.obturacion { color: var(--primary-light); }
.tooth-num.corona { color: #a855f7; }
.tooth-num.endodoncia { color: #ec4899; }
.tooth-num.extraccion { color: var(--danger); text-decoration: line-through; }
.tooth-num.implante { color: #06b6d4; }
.tooth-num.perno { color: #eab308; }
.tooth-num.caries { color: var(--danger); }
.tooth-num.pendiente { color: var(--warning); }

.tooth-svg-demo {
  width: 42px;
  height: 52px;
  transition: filter 0.2s;
}

.tooth-svg-demo.anterior {
  width: 34px;
  height: 44px;
}

.tooth-pro:hover .tooth-svg-demo {
  filter: brightness(1.2);
}

/* Surfaces */
.surface {
  fill: #374151;
  stroke: #1e293b;
  stroke-width: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.surface:hover {
  fill: #4b5563;
  stroke: var(--primary);
  stroke-width: 2;
}

/* Surface treatment colors */
.surface.obturacion {
  fill: rgba(99, 102, 241, 0.5);
  stroke: var(--primary);
}

.surface.corona {
  fill: rgba(168, 85, 247, 0.5);
  stroke: #a855f7;
}

.surface.endodoncia {
  fill: rgba(236, 72, 153, 0.5);
  stroke: #ec4899;
}

.surface.extraccion {
  fill: rgba(239, 68, 68, 0.3);
  stroke: var(--danger);
  stroke-dasharray: 3 2;
}

.surface.implante {
  fill: rgba(6, 182, 212, 0.5);
  stroke: #06b6d4;
}

.surface.perno {
  fill: rgba(234, 179, 8, 0.5);
  stroke: #eab308;
}

.surface.caries {
  fill: rgba(239, 68, 68, 0.6);
  stroke: var(--danger);
}

.surface.pendiente {
  fill: rgba(245, 158, 11, 0.6);
  stroke: var(--warning);
}

/* Extraction lines */
.extraction-line {
  stroke: var(--danger);
  stroke-width: 2;
  stroke-linecap: round;
}

.tooth-pro.extracted {
  opacity: 0.6;
}

/* References panel */
.odonto-references {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 160px;
}

.odonto-references h5 {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.ref-item:last-child {
  border-bottom: none;
}

.ref-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-icon.obturacion { background: rgba(99, 102, 241, 0.3); border: 2px solid var(--primary); }
.ref-icon.corona { background: rgba(168, 85, 247, 0.3); border: 2px solid #a855f7; }
.ref-icon.endodoncia { background: rgba(236, 72, 153, 0.3); border: 2px solid #ec4899; }
.ref-icon.perno { background: rgba(234, 179, 8, 0.3); border: 2px solid #eab308; }
.ref-icon.extraccion { background: rgba(239, 68, 68, 0.2); border: 2px dashed var(--danger); }
.ref-icon.implante { background: rgba(6, 182, 212, 0.3); border: 2px solid #06b6d4; }
.ref-icon.caries { background: rgba(239, 68, 68, 0.3); border: 2px solid var(--danger); }
.ref-icon.pendiente { background: rgba(245, 158, 11, 0.3); border: 2px solid var(--warning); }

/* Tooth detail popup */
.tooth-detail-popup {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 100;
}

.tooth-detail-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tdp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tdp-header h5 {
  margin: 0;
  font-size: 0.95rem;
}

.tdp-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.tdp-close:hover {
  background: rgba(255,255,255,0.1);
}

.tdp-history {
  max-height: 180px;
  overflow-y: auto;
}

.tdp-note {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
}

.tdp-note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tdp-tag {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
}

.tdp-note-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
}

.tdp-note-row i {
  width: 14px;
  color: var(--text-muted);
}

.tdp-note-row.muted {
  color: var(--text-dim);
}

.tdp-add {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: var(--gradient-1);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tdp-add:hover {
  filter: brightness(1.1);
}

/* Responsive */
@media (max-width: 900px) {
  .odontogram-main-demo {
    grid-template-columns: 1fr;
  }
  
  .odonto-references {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  
  .odonto-references h5 {
    width: 100%;
    text-align: center;
  }
  
  .ref-item {
    border-bottom: none;
    padding: 6px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
  }
  
  .dental-arch-demo {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
  }
  
  .quadrant-demo {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .tooth-svg-demo {
    width: 32px;
    height: 40px;
  }
  
  .tooth-svg-demo.anterior {
    width: 26px;
    height: 34px;
  }
  
  .arch-label-demo {
    display: none;
  }
  
  .tooth-detail-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
  }
}
