/**
 * Sky Calendar Styles
 * Brand-aligned with lavender/purple theme
 */

/* Base Styles */
body {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--bg-primary);
  background-image: repeating-linear-gradient(
    transparent,
    transparent 31px,
    rgba(139, 111, 71, 0.15) 31px,
    rgba(139, 111, 71, 0.15) 32px
  );
  background-size: 100% 32px;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.sky-calendar-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* Header */
.sky-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.header-content {
  flex: 1;
}

.sky-title {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  color: var(--accent-red);
}

.sky-subtitle {
  font-family: 'Spectral', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

.home-link {
  font-size: 0.9rem;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--text-primary);
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.home-link:hover {
  color: var(--accent-bright);
  text-decoration-color: var(--accent-bright);
}

/* Month Navigation */
.month-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.month-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 250px;
  text-align: center;
  margin: 0;
}

.nav-button {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #e8dcf0 0%, #d4c5e0 100%);
  border-radius: 50px;
  border: 2px solid rgba(180, 167, 214, 0.3);
  color: var(--text-primary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(107, 91, 149, 0.25),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.nav-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #d4c5e0 0%, #b4a7d6 100%);
  box-shadow: 0 8px 20px rgba(107, 91, 149, 0.35);
}

.nav-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(107, 91, 149, 0.3);
}

/* Calendar Container */
.calendar-container {
  position: relative;
  margin-bottom: 3rem;
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  max-width: 100%;
}

.calendar-header-cell {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.5rem;
  font-weight: 500;
}

.calendar-day {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #e8dcf0 0%, #d4c5e0 100%);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow:
    0 4px 12px rgba(107, 91, 149, 0.25),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.calendar-day-empty {
  background: transparent;
  box-shadow: none;
}

.calendar-day-has-image {
  cursor: pointer;
}

.calendar-day-has-image:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(107, 91, 149, 0.35);
}

.day-number {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
  z-index: 10;
  position: relative;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.day-thumbnail-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.day-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.calendar-day-has-image:hover .day-thumbnail {
  opacity: 1;
}

/* Loading and Empty States */
.calendar-loading,
.calendar-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Featured Image Section (Lightbox) */
.featured-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(74, 66, 102, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.featured-container {
  position: relative;
  max-width: 1000px;
  width: 100%;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 12px 48px rgba(107, 91, 149, 0.5);
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8dcf0 0%, #d4c5e0 100%);
  border: 2px solid rgba(180, 167, 214, 0.3);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(107, 91, 149, 0.25);
}

.close-button:hover {
  background: linear-gradient(135deg, #d4c5e0 0%, #b4a7d6 100%);
  transform: rotate(90deg);
}

.featured-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
  z-index: 10;
}

.image-nav-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8dcf0 0%, #d4c5e0 100%);
  border: 2px solid rgba(180, 167, 214, 0.3);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  pointer-events: all;
  box-shadow: 0 4px 12px rgba(107, 91, 149, 0.25);
}

.image-nav-button:hover {
  background: linear-gradient(135deg, #d4c5e0 0%, #b4a7d6 100%);
  transform: scale(1.1);
}

.featured-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  display: block;
}

/* Featured Metadata */
.featured-metadata {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.metadata-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.metadata-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Stats Summary */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.stat-card {
  background: linear-gradient(135deg, #e8dcf0 0%, #d4c5e0 100%);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(107, 91, 149, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-value {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-purple);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .sky-calendar-wrapper {
    padding: 2rem 1rem 3rem;
  }

  .sky-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .sky-title {
    font-size: 2rem;
  }

  .month-navigation {
    gap: 1rem;
  }

  .month-label {
    font-size: 1.25rem;
    min-width: 200px;
  }

  .nav-button {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
  }

  .calendar-grid {
    gap: 0.5rem;
  }

  .calendar-day {
    padding: 0.5rem;
  }

  .day-number {
    font-size: 0.75rem;
  }

  .featured-container {
    padding: 1.5rem;
  }

  .featured-image {
    max-height: 50vh;
  }

  .metadata-row {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .close-button {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .image-nav-button {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .sky-calendar-wrapper {
    padding: 1.5rem 0.75rem 2rem;
  }

  .sky-title {
    font-size: 1.75rem;
  }

  .sky-subtitle {
    font-size: 0.9rem;
  }

  .month-label {
    font-size: 1.1rem;
    min-width: 150px;
  }

  .nav-button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .calendar-grid {
    gap: 0.375rem;
  }

  .calendar-day {
    padding: 0.375rem;
    border-radius: 8px;
  }

  .day-number {
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
  }

  .featured-section {
    padding: 1rem;
  }

  .featured-container {
    padding: 1rem;
    border-radius: 12px;
  }

  .featured-image {
    margin-bottom: 1rem;
  }

  .metadata-row {
    font-size: 0.75rem;
  }
}
