/* Theme overrides for Gematria Calculator: Mystical Deep Purple/Indigo & Gold theme */
:root {
  --primary: #6366f1;
  --primary-rgb: 99, 102, 241;
  --accent: #d97706; /* Mystical Gold */
  --accent-rgb: 217, 119, 6;
  --surface-border: rgba(99, 102, 241, 0.12);
  --surface-border-hover: rgba(99, 102, 241, 0.3);
  --gradient-main: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #312e81 100%);
  --gradient-hover: linear-gradient(135deg, #4f46e5 0%, #4338ca 50%, #1e1b4b 100%);
  --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
  --shadow-glow: 0 20px 40px -15px rgba(99, 102, 241, 0.2), 0 0 0 1px rgba(99, 102, 241, 0.06);
  --bg-dots: rgba(99, 102, 241, 0.02);
}

/* Mystical Background Stars decoration */
.mystical-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.mystical-decorations::after {
  content: '';
  position: absolute;
  top: 5%;
  left: 10%;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #fef08a 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseGlow 4s infinite ease-in-out;
}

.mystical-decorations::before {
  content: '';
  position: absolute;
  bottom: 25%;
  right: 12%;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, #fde047 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseGlow 3s infinite ease-in-out 1s;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

/* Form block adjustments */
.form-input-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gematria-input {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
  transition: all var(--transition-normal);
}

.gematria-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

/* Layout for Results cards */
.gematria-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .gematria-results-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.gematria-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gematria-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: var(--shadow-sm);
}

.gematria-card.highlighted {
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.04) 0%, rgba(var(--accent-rgb), 0.04) 100%);
  border-color: rgba(var(--accent-rgb), 0.25);
  box-shadow: 0 8px 24px -8px rgba(var(--accent-rgb), 0.15);
}

.gematria-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.gematria-card-value {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  transition: color 0.3s ease;
}

.gematria-card.highlighted .gematria-card-value {
  color: var(--accent);
}

/* Character Breakdown Viewer */
.breakdown-section {
  background: rgba(0, 0, 0, 0.015);
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.breakdown-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breakdown-formula {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}

.breakdown-formula span {
  display: inline-block;
  background: rgba(var(--primary-rgb), 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin: 0.15rem;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Cipher Map Tables */
.cipher-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cipher-tab-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.cipher-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.02);
}

.cipher-tab-btn.active {
  color: #ffffff;
  background: var(--gradient-main);
}

.cipher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
  max-height: 250px;
  overflow-y: auto;
  padding: 0.25rem;
}

.cipher-char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.25rem;
  font-size: 0.9rem;
}

.cipher-char-letter {
  font-weight: 700;
  color: var(--text-primary);
}

.cipher-char-val {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}
