/*
 * Design System - Week View
 *
 * Week grid layout, day columns, time blocks, and interactive states.
 * Based on the design exploration in tmp/week_view_mockup_v11.html
 */

/* ============================================
   Week View Container
   ============================================ */

.week-view {
  /* No padding - main element already provides page padding */
}

/* ============================================
   Week Navigator Header (in week view content, not the main app header)
   ============================================ */

.week-view header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--parchment);
  position: relative;
}

.week-view header::before {
  content: '✦  ·  ✦  ·  ✦  ·  ✦  ·  ✦  ·  ✦  ·  ✦';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: var(--dusty-rose);
  letter-spacing: 8px;
  opacity: 0.6;
}

.week-view header::after {
  content: '✦';
  position: absolute;
  right: 50%;
  bottom: -12px;
  transform: translateX(50%);
  font-size: 20px;
  color: var(--terra-cotta);
  background: var(--paper-bg);
  padding: 0 var(--space-md);
}

.logo {
  font-family: var(--font-logo);
  font-size: 60px;
  font-weight: 400;
  color: var(--ink-dark);
  letter-spacing: 1px;
  position: relative;
  flex: 1;
}

.logo::after {
  content: '~';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 24px;
  color: var(--dusty-rose);
  opacity: 0.5;
}

/* Week range - centered */
.week-range {
  font-family: var(--font-accent);
  font-size: 40px;
  color: var(--ink-medium);
  letter-spacing: 1px;
  flex: 1;
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-buttons {
  display: flex;
  gap: var(--space-md);
  flex: 1;
  justify-content: flex-end;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  padding: var(--space-sm) var(--space-lg);
  background: rgba(255, 255, 255, 0.6);
  border: none;
  cursor: pointer;
  position: relative;
  color: var(--ink-dark);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    2px 2px 0 rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease;
}

/* Hand-drawn SVG border for button */
.btn .btn-border {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  pointer-events: none;
  z-index: 0;
}

.btn-text {
  position: relative;
  z-index: 1;
}

/* Color splash appears on hover */
.btn.color-lavender:hover {
  background: linear-gradient(135deg,
    rgba(232, 217, 240, 0.6) 0%,
    rgba(220, 201, 229, 0.6) 100%
  );
}

.btn.color-mint:hover {
  background: linear-gradient(135deg,
    rgba(198, 225, 222, 0.6) 0%,
    rgba(181, 213, 210, 0.6) 100%
  );
}

.btn.color-peach:hover {
  background: linear-gradient(135deg,
    rgba(255, 232, 214, 0.6) 0%,
    rgba(255, 220, 196, 0.6) 100%
  );
}

/* Watercolor blur effect on hover */
.btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.2s ease;
  z-index: -1;
  border-radius: 12px;
}

.btn.color-lavender::before {
  background: #E8D9F0;
}

.btn.color-mint::before {
  background: #C6E1DE;
}

.btn.color-peach::before {
  background: #FFE8D6;
}

.btn:hover::before {
  opacity: 0.6;
}

/* ============================================
   Week Grid
   ============================================ */

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-lg);
  max-width: 1600px;
  margin: 0 auto;
}

@media (min-width: 1800px) {
  .week-grid {
    max-width: 1800px;
  }
}

/* ============================================
   Day Columns
   ============================================ */

.day-column {
  background: rgba(255, 255, 255, 0.6);
  padding: var(--space-lg);
  position: relative;
  min-height: 600px;
  border: none;
  cursor: pointer;
  text-decoration: none;

  /* Subtle shadow for depth */
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    3px 3px 0 rgba(0, 0, 0, 0.08);

  /* Smooth transitions */
  transition: all 0.2s ease;
}

/* Hover state - subtle lift and emphasis */
.day-column:hover {
  background: rgba(255, 255, 255, 0.75);
  text-decoration: none;

  /* Lift effect - stronger shadow */
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.8),
    5px 8px 12px rgba(0, 0, 0, 0.12);

  /* Keep rotation */
  transform: rotate(var(--rotate));
}

/* Preserve rotation on hover by using CSS variable */
.day-column:nth-child(1) { --rotate: -0.4deg; transform: rotate(-0.4deg); }
.day-column:nth-child(2) { --rotate: 0.3deg; transform: rotate(0.3deg); }
.day-column:nth-child(3) { --rotate: -0.2deg; transform: rotate(-0.2deg); }
.day-column:nth-child(4) { --rotate: 0.4deg; transform: rotate(0.4deg); }
.day-column:nth-child(5) { --rotate: -0.3deg; transform: rotate(-0.3deg); }
.day-column:nth-child(6) { --rotate: 0.2deg; transform: rotate(0.2deg); }
.day-column:nth-child(7) { --rotate: -0.2deg; transform: rotate(-0.2deg); }

/* SVG border positioned absolutely */
.day-column .border-svg {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  pointer-events: none;
  z-index: 0;
  transition: stroke 0.2s ease;
}

/* Border gets very slightly darker on hover */
.day-column:hover .border-svg path {
  stroke: #A89580;
}

/* Content sits above SVG border */
.day-column > *:not(.border-svg) {
  position: relative;
  z-index: 1;
}

.day-name {
  font-family: var(--font-handwritten);
  font-size: 36px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--ink-dark);
  text-align: center;
  position: relative;
}

.day-name::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--dusty-rose);
  opacity: 0.4;
  border-radius: 2px;
}

.day-date {
  font-family: var(--font-accent);
  font-size: 24px;
  text-align: center;
  color: var(--ink-medium);
  margin-bottom: var(--space-lg);
  letter-spacing: 1px;
}

/* Decorative elements */
.day-column .decoration-star {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 14px;
  color: var(--dusty-rose);
  opacity: 0.5;
  z-index: 1;
}

.day-column .decoration-accent {
  position: absolute;
  top: 24px;
  left: 12px;
  font-size: 24px;
  color: var(--terra-cotta);
  opacity: 0.3;
  z-index: 1;
}

/* ============================================
   Time Blocks
   ============================================ */

.time-blocks {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.time-block {
  padding: var(--space-md);
  border-radius: 5px;
  position: relative;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  overflow: hidden;
}

/* Texture overlay */
.time-block::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.3'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.3;
}

/* Watercolor blur effect on hover */
.time-block::before {
  content: '';
  position: absolute;
  inset: -6px;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.2s ease;
  z-index: -1;
  border-radius: 8px;
}

.time-block:hover::before {
  opacity: 0.6;
}

/* Week-specific time block overrides */
.time-block.immovable .block-title,
.time-block.immovable .block-time {
  color: white;
}

.time-block.immovable .block-time {
  opacity: 0.85;
}

/* NOTE: Color gradient classes for time blocks are now in time-blocks.css
   to make them globally available across all views (week, day, etc.) */

/* ============================================
   Time Block Content
   ============================================ */

/* Week block tasks list */
.week-block-tasks {
  margin-top: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.week-block-task {
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.week-block-task-title {
  font-size: 13px;
  line-height: 1.3;
  display: block;
}

/* Completed task styling in week view - just strikethrough */
.week-block-task.task-completed .week-block-task-title {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Block with all tasks complete - golden glow */
.time-block.block-all-complete {
  background: linear-gradient(135deg, rgba(255, 235, 180, 0.95) 0%, rgba(255, 220, 150, 0.9) 100%);
  border-color: #DAA520;
}

.time-block.block-all-complete::before {
  background: #FFD700;
}

.time-block.block-all-complete .block-title,
.time-block.block-all-complete .block-time {
  opacity: 0.85;
}

.block-time {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 400;
  display: block;
  margin-bottom: var(--space-xs);
  opacity: 0.7;
  letter-spacing: 0.3px;
}

.block-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  display: block;
  letter-spacing: 0.2px;
  position: relative;
  z-index: 1;
}

@media (min-width: 1800px) {
  .day-column {
    padding: var(--space-xl);
  }
}
