/**
 * DIARY STYLES - Diario Vivo Lunar
 * LuneMaya - Phase 1 MVP
 *
 * Mystical dark theme matching the main app aesthetic
 */

/* ============================================
   COLOR VARIABLES
   ============================================ */
:root {
  --diary-bg: #1A1A2E;
  --diary-bg-elevated: rgba(26, 26, 40, 0.95);
  --diary-purple: #4A1A6B;
  --diary-gold: #D4AF37;
  --diary-teal: #0D7377;
  --diary-text-primary: rgba(255, 255, 255, 0.95);
  --diary-text-secondary: rgba(255, 255, 255, 0.7);
  --diary-text-tertiary: rgba(255, 255, 255, 0.5);
  --diary-border: rgba(255, 255, 255, 0.1);
  --diary-glow: rgba(212, 175, 55, 0.6);
}

/* ============================================
   DIARY OVERLAY - Full Screen Modal
   ============================================ */
.diary-overlay {
  position: fixed;
  inset: 0;
  background: var(--diary-bg);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  overflow-y: auto;
}

.diary-overlay.active {
  display: flex;
  opacity: 1;
}

.diary-container {
  width: 100%;
  max-width: 600px;
  margin: auto;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================
   DIARY SCREENS
   ============================================ */
.diary-screen {
  display: none;
  animation: slideInUp 0.4s ease-out;
  text-align: center;
}

.diary-screen.active {
  display: block;
}

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

/* ============================================
   HEADER SECTION
   ============================================ */
.diary-header {
  margin-bottom: 1.5rem;
}

.current-moon {
  display: inline-block;
  font-size: 1rem;
  color: var(--diary-gold);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  padding: 0.5rem 1rem;
  border: 1px solid var(--diary-border);
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.05);
}

.diary-screen h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--diary-text-primary);
  margin: 1rem 0 0.5rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.subtitle {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--diary-text-tertiary);
  margin-bottom: 2rem;
  font-style: italic;
}

/* ============================================
   SYMBOL GRIDS
   ============================================ */
.energy-grid,
.planes-grid,
.gestures-grid {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
  padding: 0 1rem;
}

.energy-grid {
  grid-template-columns: repeat(4, 1fr);
}

.planes-grid {
  grid-template-columns: repeat(3, 1fr);
}

.gestures-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   SYMBOL BUTTONS
   ============================================ */
.symbol-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  padding: 1.5rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--diary-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.symbol-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
  transform: translateY(-2px);
}

.symbol-btn.selected {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--diary-gold);
  transform: scale(1.1);
  box-shadow: 0 0 25px var(--diary-glow);
}

.symbol-btn.selected::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.symbol-btn .symbol-emoji {
  display: block;
  margin-bottom: 0.5rem;
}

.symbol-btn .symbol-label {
  display: block;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.7rem;
  color: var(--diary-text-secondary);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.symbol-btn.selected .symbol-label {
  color: var(--diary-gold);
  font-weight: 600;
}

/* ============================================
   MEANING DISPLAY
   ============================================ */
.selected-meaning {
  min-height: 60px;
  margin: 1.5rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.02) 100%);
  border-left: 3px solid var(--diary-gold);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.selected-meaning.visible {
  opacity: 1;
}

.selected-meaning p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: rgba(212, 175, 55, 0.9);
  margin: 0;
  line-height: 1.6;
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */
.diary-nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.diary-btn {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 1rem;
  padding: 0.875rem 2rem;
  border: 2px solid var(--diary-border);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--diary-text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.diary-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(212, 175, 55, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.diary-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.diary-next,
.diary-save {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
  border-color: var(--diary-gold);
  color: var(--diary-gold);
}

.diary-next:hover:not(:disabled),
.diary-save:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(212, 175, 55, 0.15) 100%);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.diary-back {
  background: transparent;
  border-color: var(--diary-border);
}

/* ============================================
   CONFIRMATION SCREEN
   ============================================ */
.confirm-check {
  font-size: 4rem;
  color: var(--diary-gold);
  margin-bottom: 1rem;
  animation: scaleIn 0.5s ease-out;
}

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

.entry-summary {
  font-size: 1.5rem;
  color: var(--diary-text-primary);
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid var(--diary-border);
}

.mini-insight {
  margin: 2rem auto;
  padding: 1.5rem;
  max-width: 450px;
  background: linear-gradient(135deg, rgba(74, 26, 107, 0.2) 0%, rgba(13, 115, 119, 0.2) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  text-align: left;
}

.mini-insight strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.125rem;
  color: var(--diary-gold);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mini-insight p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--diary-text-secondary);
  line-height: 1.7;
  margin: 0;
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.view-map {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
  border-color: var(--diary-gold);
  color: var(--diary-gold);
}

.diary-close {
  background: transparent;
  border-color: var(--diary-border);
}

/* ============================================
   FLOATING ACTION BUTTON (FAB)
   ============================================ */
.diary-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--diary-purple) 0%, var(--diary-teal) 100%);
  border: 2px solid var(--diary-gold);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px var(--diary-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  transition: all 0.3s ease;
  z-index: 999;
}

.diary-fab:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5), 0 0 40px var(--diary-glow);
}

.diary-fab.has-entry {
  opacity: 0.6;
}

.diary-fab.has-entry::after {
  content: '✓';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: var(--diary-gold);
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--diary-bg);
  font-weight: bold;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.diary-progress {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--diary-gold);
  box-shadow: 0 0 10px var(--diary-glow);
  transform: scale(1.3);
}

.progress-dot.completed {
  background: rgba(212, 175, 55, 0.5);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .diary-container {
    padding: 1.5rem 1rem;
  }

  .diary-screen h2 {
    font-size: 1.5rem;
  }

  .symbol-btn {
    font-size: 2rem;
    padding: 1rem 0.25rem;
  }

  .symbol-btn .symbol-label {
    font-size: 0.625rem;
  }
}

@media (max-width: 480px) {
  .energy-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }

  .planes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .gestures-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .symbol-btn {
    font-size: 1.75rem;
    padding: 0.75rem 0.25rem;
  }

  .diary-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }

  .diary-fab {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* ============================================
   ANIMATIONS & EFFECTS
   ============================================ */
@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.symbol-btn {
  animation: floatIn 0.4s ease-out backwards;
}

.symbol-btn:nth-child(1) { animation-delay: 0.05s; }
.symbol-btn:nth-child(2) { animation-delay: 0.1s; }
.symbol-btn:nth-child(3) { animation-delay: 0.15s; }
.symbol-btn:nth-child(4) { animation-delay: 0.2s; }
.symbol-btn:nth-child(5) { animation-delay: 0.25s; }
.symbol-btn:nth-child(6) { animation-delay: 0.3s; }
.symbol-btn:nth-child(7) { animation-delay: 0.35s; }
.symbol-btn:nth-child(8) { animation-delay: 0.4s; }

/* Haptic feedback simulation */
.symbol-btn:active {
  transform: scale(0.95);
}
