/* =========================================================================
   GLOSARIO ESTOICO & WIDGET DE TÉRMINOS - GERMÁN GHIGGERI
   Estilos visuales alineados con la identidad oscura y dorada del sitio
   ========================================================================= */

/* --- BOTÓN EN NAVBAR & ENLACES --- */
.nav-glosario-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold-light) !important;
  font-weight: 500;
  position: relative;
  transition: var(--transition-smooth);
}

.nav-glosario-btn::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
  transition: width 0.3s ease;
}

.nav-glosario-btn:hover::after {
  width: 100%;
}

.nav-glosario-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  background: rgba(230, 180, 76, 0.15);
  border: 1px solid rgba(230, 180, 76, 0.3);
  color: var(--gold-primary);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- SECCIÓN WIDGET: TÉRMINO ESTOICO DEL MOMENTO (INDEX & BLOG) --- */
.stoa-random-section {
  position: relative;
  padding: 4.5rem 0;
  overflow: hidden;
}

.stoa-random-container {
  width: 100%;
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.stoa-random-card {
  position: relative;
  background: linear-gradient(135deg, rgba(12, 17, 30, 0.95) 0%, rgba(19, 25, 43, 0.85) 100%);
  border: 1px solid rgba(230, 180, 76, 0.28);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 35px rgba(230, 180, 76, 0.06);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
  .stoa-random-card {
    padding: 3.25rem 3.5rem;
  }
}

.stoa-random-card:hover {
  border-color: rgba(230, 180, 76, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 45px rgba(230, 180, 76, 0.12);
}

.stoa-random-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stoa-random-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(230, 180, 76, 0.1);
  border: 1px solid rgba(230, 180, 76, 0.25);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
}

.stoa-random-actions-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stoa-btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-body);
}

.stoa-btn-refresh:hover {
  color: #fff;
  background: rgba(230, 180, 76, 0.15);
  border-color: rgba(230, 180, 76, 0.35);
}

.stoa-btn-refresh svg {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stoa-btn-refresh.spin svg {
  transform: rotate(360deg);
}

.stoa-random-content {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.stoa-random-content.fading {
  opacity: 0;
  transform: translateY(8px);
}

.stoa-random-header-wrap {
  margin-bottom: 1.5rem;
}

.stoa-random-term-title {
  font-family: var(--font-title);
  font-size: 2.1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.65rem;
}

@media (min-width: 768px) {
  .stoa-random-term-title {
    font-size: 2.6rem;
  }
}

.stoa-random-greek {
  font-family: 'Cinzel', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--gold-light);
  font-size: 1.35rem;
  text-shadow: 0 0 14px rgba(230, 180, 76, 0.35);
}

.stoa-random-translation {
  font-size: 1.1rem;
  color: var(--gold-primary);
  font-weight: 400;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
}

.stoa-random-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 900px) {
  .stoa-random-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
  }
}

.stoa-random-box-def {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.stoa-random-item-block {
  background: rgba(6, 9, 17, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.25rem 1.4rem;
  border-radius: 12px;
}

.stoa-item-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-primary);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.stoa-item-text {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

.stoa-random-quote-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stoa-random-quote-card {
  position: relative;
  background: rgba(230, 180, 76, 0.05);
  border-left: 3px solid var(--gold-primary);
  border-radius: 0 12px 12px 0;
  padding: 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stoa-quote-text {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.12rem;
  color: #ffffff;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.stoa-quote-author {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--gold-light);
  text-transform: uppercase;
}

.stoa-random-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 640px) {
  .stoa-random-bottom-bar {
    flex-direction: row;
  }
}

.stoa-btn-open-full {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: #060911;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--gold-glow);
  transition: all 0.25s ease;
  text-decoration: none;
}

.stoa-btn-open-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 24px rgba(230, 180, 76, 0.4);
  color: #000;
}

.stoa-hint-text {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin: 0;
}

/* --- MODAL FLOTANTE / PANTALLA COMPLETA DEL GLOSARIO (STOA LEXICON) --- */
.stoa-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 5, 10, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.stoa-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.stoa-modal-wrapper {
  position: relative;
  width: 100%;
  max-width: 1120px;
  max-height: 90vh;
  background: #090e1a;
  border: 1px solid rgba(230, 180, 76, 0.32);
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 50px rgba(230, 180, 76, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stoa-modal-backdrop.active .stoa-modal-wrapper {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.stoa-modal-header {
  padding: 1.75rem 2rem 1.25rem 2rem;
  background: linear-gradient(180deg, rgba(15, 22, 38, 0.95) 0%, rgba(9, 14, 26, 0.8) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 10;
}

.stoa-modal-header-info {
  max-width: 820px;
}

.stoa-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(230, 180, 76, 0.12);
  border: 1px solid rgba(230, 180, 76, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.stoa-modal-title {
  font-family: var(--font-title);
  font-size: 1.7rem;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
  letter-spacing: 0.03em;
}

@media (min-width: 768px) {
  .stoa-modal-title {
    font-size: 2.1rem;
  }
}

.stoa-modal-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.stoa-modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-left: 1rem;
}

.stoa-modal-close-btn:hover {
  color: #ffffff;
  background: rgba(230, 180, 76, 0.2);
  border-color: var(--gold-primary);
  transform: rotate(90deg);
}

/* Modal Search & Filters (Sticky Bar) */
.stoa-modal-controls {
  padding: 1.25rem 2rem;
  background: rgba(11, 16, 29, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  z-index: 5;
}

.stoa-modal-search-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.stoa-search-container {
  position: relative;
  flex: 1;
}

.stoa-search-input-field {
  width: 100%;
  background: rgba(6, 9, 17, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.75rem 2.75rem 0.75rem 2.85rem;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.stoa-search-input-field:focus {
  outline: none;
  border-color: var(--gold-primary);
  background: rgba(6, 9, 17, 0.95);
  box-shadow: 0 0 16px rgba(230, 180, 76, 0.18);
}

.stoa-search-icon-svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-primary);
  pointer-events: none;
}

.stoa-search-clear-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 1.25rem;
  cursor: pointer;
  display: none;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.stoa-search-clear-btn:hover {
  color: #ffffff;
}

.stoa-categories-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.stoa-categories-bar::-webkit-scrollbar {
  display: none;
}

.stoa-cat-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.stoa-cat-chip:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.stoa-cat-chip.active {
  background: rgba(230, 180, 76, 0.18);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  font-weight: 500;
}

.stoa-modal-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 0.75rem;
}

/* Modal Body / Scrollable Content */
.stoa-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem 2.5rem 2rem;
  scroll-behavior: smooth;
}

/* Grid of Term Cards */
.stoa-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 860px) {
  .stoa-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stoa-card {
  background: rgba(14, 20, 34, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.stoa-card:hover {
  border-color: rgba(230, 180, 76, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(230, 180, 76, 0.06);
  transform: translateY(-2px);
}

.stoa-card.highlighted {
  border-color: var(--gold-primary);
  box-shadow: 0 0 35px rgba(230, 180, 76, 0.3);
  animation: stoaPulse 1.8s ease;
}

@keyframes stoaPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.stoa-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.stoa-card-title-group {
  flex: 1;
}

.stoa-card-name {
  font-family: var(--font-title);
  font-size: 1.35rem;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stoa-card-original {
  font-family: 'Cinzel', Georgia, serif;
  font-style: italic;
  font-size: 0.98rem;
  color: var(--gold-light);
  font-weight: 400;
}

.stoa-card-translation {
  font-size: 0.9rem;
  color: var(--gold-primary);
  font-weight: 400;
}

.stoa-card-cat-badge {
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
}

.stoa-card-def {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.stoa-card-app-box {
  background: rgba(6, 9, 17, 0.55);
  border-left: 2px solid rgba(230, 180, 76, 0.5);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 0.95rem;
  margin-bottom: 1.15rem;
}

.stoa-card-app-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stoa-card-app-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.stoa-card-quote-box {
  background: rgba(230, 180, 76, 0.04);
  border: 1px dashed rgba(230, 180, 76, 0.2);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  position: relative;
}

.stoa-card-quote-text {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 0.88rem;
  color: #f1f5f9;
  line-height: 1.5;
  margin: 0;
}

.stoa-card-quote-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
}

.stoa-card-quote-author {
  font-size: 0.75rem;
  color: var(--gold-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stoa-copy-quote-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  transition: all 0.2s ease;
}

.stoa-copy-quote-btn:hover {
  color: var(--gold-light);
}

/* Empty State in Search */
.stoa-modal-empty {
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stoa-modal-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.stoa-modal-empty-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.stoa-modal-empty-desc {
  color: var(--text-muted);
  max-width: 440px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Toast Notification */
.stoa-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #13192b;
  border: 1px solid var(--gold-primary);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 20px var(--gold-glow);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stoa-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
