/* VOX LOCUS AMOENUS - Design System & Modern CSS Stylesheet (PWA Mobile Ready) */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 26, 44, 0.75);
  --bg-card-hover: rgba(30, 42, 68, 0.85);
  --border-color: rgba(212, 175, 55, 0.25);
  --border-glow: rgba(212, 175, 55, 0.6);
  
  --primary-gold: #d4af37;
  --primary-gold-bright: #f3cf55;
  --accent-cyan: #38bdf8;
  --accent-emerald: #34d399;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-gold: #e5c158;
  
  --font-title: 'Cinzel', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.2);
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Ambient Background Lights */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-gold) 0%, transparent 70%);
  top: -150px;
  left: -150px;
}
.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #0284c7 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
}

/* Install PWA Mobile Banner */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, #1e1b4b 0%, #0f172a 100%);
  border-bottom: 2px solid var(--primary-gold);
  padding: 0.8rem 1.2rem;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
  animation: slideDown 0.3s ease;
}

.install-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.install-icon {
  font-size: 1.8rem;
}

.install-text {
  display: flex;
  flex-direction: column;
}

.install-text strong {
  color: var(--primary-gold-bright);
  font-size: 0.95rem;
}

.install-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.install-btn {
  background: var(--primary-gold);
  color: #090d16;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.install-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Layout Container */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.2rem;
  position: relative;
  z-index: 1;
}

/* Header & Brand */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.laurel-icon {
  font-size: 2.6rem;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
}

.brand-titles .app-title {
  font-family: var(--font-title);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-gold-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-titles .app-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.nav-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  min-height: 44px; /* Touch target optimal */
}

.nav-btn:hover, .nav-btn:active {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

/* Search Section */
.search-section {
  margin-bottom: 1.8rem;
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.4rem 1rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.search-bar-wrapper:focus-within {
  border-color: var(--primary-gold);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.3);
}

.search-icon {
  font-size: 1.3rem;
  margin-right: 0.8rem;
  opacity: 0.7;
}

#search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 1.15rem;
  font-family: var(--font-body);
  padding: 0.65rem 0;
}

#search-input::placeholder {
  color: #64748b;
  font-weight: 300;
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}

/* Filters Toolbar */
.filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.filter-chip {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
}

.filter-chip:hover, .filter-chip.active {
  background: var(--primary-gold);
  color: #090d16;
  border-color: var(--primary-gold);
  font-weight: 600;
}

.filter-select {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  min-height: 38px;
}

/* Results Status Bar */
.results-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  padding: 0 0.4rem;
}

/* Dictionary Cards Grid */
.dictionary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.card:hover, .card:active {
  background: var(--bg-card-hover);
  border-color: var(--primary-gold);
  transform: translateY(-3px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.card-lemma {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 1px;
}

.card-num {
  font-size: 0.85rem;
  vertical-align: super;
  color: var(--accent-cyan);
  margin-left: 3px;
}

.card-inflection {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.8rem;
}

.card-meaning {
  font-size: 0.92rem;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.7rem;
  margin-top: auto;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
}

.badge.gold {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--primary-gold-bright);
}

.fav-star-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0.4;
  padding: 0.4rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-star-btn:hover, .fav-star-btn.active {
  opacity: 1;
}

/* Spinner & Loading */
.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 45px;
  height: 45px;
  border: 4px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--primary-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.8rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-close-btn {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

/* Flashcards */
.flashcard-modal {
  text-align: center;
}

.flashcard-header {
  margin-bottom: 1.2rem;
}

.flashcard-header h2 {
  font-family: var(--font-title);
  color: var(--primary-gold);
  font-size: 1.5rem;
}

.flashcard-box {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.2rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.fc-lemma {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: var(--primary-gold-bright);
  margin: 0.4rem 0;
}

.fc-inflection {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1rem;
}

.fc-hint {
  display: block;
  margin-top: 1.2rem;
  font-size: 0.78rem;
  color: #64748b;
  text-transform: uppercase;
}

.fc-meaning {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-top: 0.4rem;
}

.flashcard-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 1.2rem;
  gap: 0.6rem;
}

.fc-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  cursor: pointer;
  flex: 1;
  min-height: 44px;
}

.fc-btn.primary {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}

.hidden {
  display: none !important;
}

/* Responsive Mobile Adjustments */
@media (max-width: 600px) {
  .app-container {
    padding: 1rem 0.8rem;
  }
  .brand-titles .app-title {
    font-size: 1.5rem;
  }
  .laurel-icon {
    font-size: 2.2rem;
  }
  .dictionary-grid {
    grid-template-columns: 1fr;
  }
  .modal-card {
    padding: 1.2rem;
  }
  .btn-text {
    font-size: 0.8rem;
  }
}

.footer {
  margin-top: 3rem;
  text-align: center;
  color: #64748b;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.2rem;
}
