/**
 * DIARY MAP STYLES - Lunar Map Visualization
 * LuneMaya - Phase 2
 *
 * Styles for Grid, Spiral, and List views
 */

/* ===== MAP CONTAINER ===== */
.diary-map-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 50%, #0d0d1a 100%);
  z-index: 1001;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
  display: none;
}

.diary-map-overlay.active {
  display: block;
}

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

.diary-map-overlay.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

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

.diary-map-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
}

/* ===== MAP HEADER ===== */
.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.map-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--diary-gold, #d4af37);
  margin: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.map-close-btn:hover {
  color: var(--diary-gold, #d4af37);
  background: rgba(212, 175, 55, 0.1);
  transform: rotate(90deg);
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.view-toggle-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.view-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.view-toggle-btn.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--diary-gold, #d4af37);
  color: var(--diary-gold, #d4af37);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

/* ===== STATS SECTION ===== */
.map-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--diary-gold, #d4af37);
  font-family: 'Cormorant Garamond', serif;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ===== GRID VIEW ===== */
.map-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.grid-day-header {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  padding: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.grid-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: visible;
  padding: 6px;
  min-height: 80px;
}

.grid-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.grid-cell:hover::before {
  opacity: 1;
}

.grid-cell:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  border-color: rgba(212, 175, 55, 0.4);
}

.grid-cell.has-entry {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.2);
}

.grid-cell.today {
  border: 2px solid var(--diary-gold, #d4af37);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.grid-cell.empty {
  opacity: 0.25;
  cursor: default;
}

.grid-cell.empty:hover {
  transform: none;
  box-shadow: none;
}

.grid-cell.out-of-range {
  opacity: 0.15;
}

.grid-cell-date {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 0.25rem;
}

.grid-cell.has-entry .grid-cell-date {
  color: rgba(255, 255, 255, 0.7);
}

.grid-cell.today .grid-cell-date {
  color: var(--diary-gold, #d4af37);
  font-weight: bold;
}

.grid-cell-energy {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ===== SPIRAL VIEW ===== */
.spiral-container {
  width: 100%;
  height: 500px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 2rem;
}

.spiral-canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
}

.spiral-point {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 8px currentColor;
}

.spiral-point:hover {
  transform: translate(-50%, -50%) scale(1.6);
  box-shadow: 0 0 15px currentColor;
  z-index: 10;
}

/* ===== LIST VIEW ===== */
.map-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.list-entry {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.list-entry:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(212, 175, 55, 0.3);
  transform: translateX(5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.list-entry-date {
  min-width: 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.list-entry-date-day {
  font-size: 2rem;
  font-weight: bold;
  color: var(--diary-gold, #d4af37);
  font-family: 'Cormorant Garamond', serif;
  line-height: 1;
}

.list-entry-date-month {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

.list-entry-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-entry-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.list-entry-energy {
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.list-entry-planes {
  font-size: 1.25rem;
  display: flex;
  gap: 0.5rem;
}

.list-entry-gesture {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== ENTRY DETAIL MODAL ===== */
.entry-detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1002;
  animation: fadeIn 0.2s ease;
}

.entry-detail-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1a1a2e 0%, #0d0d1a 100%);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  padding: 2rem;
  z-index: 1003;
  min-width: 320px;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: slideInUp 0.3s ease;
}

.entry-detail-modal h3 {
  margin: 0 0 1.5rem;
  color: var(--diary-gold, #d4af37);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  text-align: center;
}

.entry-detail-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.entry-detail-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.entry-detail-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.entry-detail-value {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.entry-detail-meaning {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 0.5rem;
}

.entry-detail-close-btn {
  width: 100%;
  padding: 1rem;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--diary-gold, #d4af37);
  border-radius: 10px;
  color: var(--diary-gold, #d4af37);
  cursor: pointer;
  margin-top: 1.5rem;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.entry-detail-close-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* ===== PATTERN INSIGHTS ===== */
.insights-section {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(74, 26, 107, 0.08) 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.insights-title {
  color: var(--diary-gold, #d4af37);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 500;
}

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(212, 175, 55, 0.5);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: all 0.3s ease;
}

.insight-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--diary-gold, #d4af37);
}

.insight-item:last-child {
  border-bottom: none;
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(255, 255, 255, 0.4);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-style: italic;
}

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

  .map-title {
    font-size: 1.5rem;
  }

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

  .stat-value {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .grid-cell-energy {
    font-size: 1.25rem;
  }

  .grid-cell-score-number {
    font-size: 1.2rem;
    bottom: 2px;
  }

  .view-toggle-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8rem;
  }

  .spiral-container {
    height: 350px;
  }

  .entry-detail-modal {
    max-width: 90%;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .map-grid {
    gap: 0.375rem;
  }

  .grid-cell-date {
    font-size: 0.65rem;
  }

  .grid-cell-energy {
    font-size: 1rem;
  }

  .grid-cell-score-number {
    font-size: 1rem;
    bottom: 2px;
  }

  .map-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .list-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .list-entry-date {
    flex-direction: row;
    gap: 0.5rem;
    align-items: baseline;
  }

  .list-entry-date-day {
    font-size: 1.5rem;
  }

  .spiral-container {
    height: 300px;
  }

  .view-toggle {
    gap: 0.5rem;
  }

  .view-toggle-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ===== SCROLLBAR STYLING ===== */
.diary-map-overlay::-webkit-scrollbar {
  width: 8px;
}

.diary-map-overlay::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.diary-map-overlay::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 4px;
}

.diary-map-overlay::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}
