/**
 * Annotation System Styles
 * Elegant, curated design for synonym learning
 */

/* ========================================
   Typography Foundation
   ======================================== */

/* Spanish Text - Elegant Serif */
.spanish-text {
  font-family: 'Merriweather', 'Georgia', serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

/* English Text - Clear Sans-Serif */
.english-text {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

/* Linguistic Notation - Monospace */
.linguistic-notation {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.9em;
  letter-spacing: 0;
}

/* ========================================
   Annotation Overlay
   ======================================== */

.annotation-overlay {
  position: absolute;
  z-index: 1000;
  max-width: 400px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.annotation-overlay.visible {
  opacity: 1;
}

/* Overlay Positions */
.overlay-top-left {
  top: 20px;
  left: 20px;
}

.overlay-top-right {
  top: 20px;
  right: 20px;
}

.overlay-bottom-left {
  bottom: 20px;
  left: 20px;
}

.overlay-bottom-right {
  bottom: 20px;
  right: 20px;
}

.overlay-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Overlay Styles */
.overlay-elegant .overlay-background {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 252, 0.95));
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 24px;
}

.overlay-minimal .overlay-background {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
  padding: 16px;
}

.overlay-bold .overlay-background {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
  padding: 20px;
}

.overlay-subtle .overlay-background {
  background: rgba(248, 249, 250, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  padding: 12px;
}

/* Overlay Content */
.overlay-content {
  position: relative;
  z-index: 1;
}

.overlay-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a202c;
}

.overlay-subtitle {
  font-size: 0.95rem;
  color: #4a5568;
  margin-bottom: 12px;
}

.overlay-body {
  font-size: 0.9rem;
  color: #2d3748;
  line-height: 1.6;
}

.overlay-metadata {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.overlay-footer {
  margin-top: 16px;
  font-size: 0.85rem;
  color: #718096;
}

/* Close Button */
.overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.overlay-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

/* Animations */
.animation-fade {
  animation: fadeIn 0.3s ease;
}

.animation-slide {
  animation: slideUp 0.3s ease;
}

.animation-scale {
  animation: scaleIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   Metadata Tags
   ======================================== */

.metadata-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 8px;
  margin-bottom: 4px;
}

/* Regional Tags */
.regional-tag {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  color: #1565c0;
  border: 1px solid #90caf9;
}

/* Formality Tags */
.formality-formal {
  background: linear-gradient(135deg, #f3e5f5, #e1bee7);
  color: #6a1b9a;
  border: 1px solid #ce93d8;
}

.formality-informal {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  color: #e65100;
  border: 1px solid #ffb74d;
}

.formality-literary {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  color: #2e7d32;
  border: 1px solid #81c784;
}

.formality-colloquial {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  color: #c2185b;
  border: 1px solid#f06292;
}

.formality-neutral {
  background: linear-gradient(135deg, #f5f5f5, #eeeeee);
  color: #616161;
  border: 1px solid #bdbdbd;
}

/* Context Tags */
.context-tag {
  background: var(--tag-color, #e0e0e0);
  color: white;
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* ========================================
   Verb Highlighting
   ======================================== */

.verb-highlight {
  background: linear-gradient(120deg, #ffeaa7 0%, #fdcb6e 100%);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.verb-highlight:hover {
  background: linear-gradient(120deg, #fdcb6e 0%, #fab1a0 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(253, 203, 110, 0.4);
}

.verb-highlight::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2d3748;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.verb-highlight:hover::after {
  opacity: 1;
}

/* ========================================
   Layered Definitions
   ======================================== */

.definition-layered {
  position: relative;
}

.definition-layer-1,
.definition-layer-2,
.definition-layer-3 {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.definition-layer-1 {
  background: #f8f9fa;
  border-left: 4px solid #667eea;
}

.definition-layer-2 {
  background: #e9ecef;
  border-left: 4px solid #764ba2;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 12px;
  margin: 0;
}

.definition-layer-3 {
  background: #dee2e6;
  border-left: 4px solid #f093fb;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 12px;
  margin: 0;
}

/* Show Layer 2 on hover */
.definition-layered:hover .definition-layer-2 {
  max-height: 200px;
  opacity: 1;
  padding: 12px;
  margin-bottom: 8px;
}

/* Show Layer 3 on click/expand */
.definition-layered.expanded .definition-layer-3 {
  max-height: 400px;
  opacity: 1;
  padding: 12px;
  margin-bottom: 8px;
}

.layer-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========================================
   Intensity Spectrum
   ======================================== */

.intensity-spectrum {
  margin: 16px 0;
}

.spectrum-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.spectrum-bar {
  height: 32px;
  background: #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.spectrum-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  transition: width 0.6s ease;
  position: relative;
}

.spectrum-fill.low {
  background: linear-gradient(90deg, #48bb78, #68d391);
}

.spectrum-fill.medium {
  background: linear-gradient(90deg, #ed8936, #f6ad55);
}

.spectrum-fill.high {
  background: linear-gradient(90deg, #e53e3e, #fc8181);
}

.spectrum-value {
  font-weight: 700;
  color: white;
  font-size: 0.85rem;
}

.spectrum-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #718096;
}

/* ========================================
   Cultural Notes
   ======================================== */

.cultural-note {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid;
}

.callout-cultural {
  border-left-color: #667eea;
}

.callout-linguistic {
  border-left-color: #48bb78;
}

.callout-historical {
  border-left-color: #ed8936;
}

.callout-etymological {
  border-left-color: #9f7aea;
}

.note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.note-icon {
  font-size: 1.5rem;
}

.note-type {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: #4a5568;
}

.note-content {
  color: #2d3748;
  line-height: 1.7;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  .annotation-overlay {
    max-width: calc(100vw - 40px);
  }

  .overlay-elegant .overlay-background,
  .overlay-minimal .overlay-background {
    padding: 16px;
  }

  .overlay-title {
    font-size: 1.25rem;
  }

  .metadata-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
  }
}
