/* Nuuko - Cozy Storybook Journaling Experience */
/* Pure CSS version - Stunning & Lightweight */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Crimson+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* === ROOT VARIABLES === */
:root {
  /* Nuuko Color Palette */
  --nuuko-green: #6B8F71;
  --nuuko-clay: #9A6B51; 
  --nuuko-espresso: #3D342C;
  --nuuko-cream: #F3EFE5;
  --nuuko-stone: #8D877E;
  
  /* Extended Palette */
  --cream-light: #FDFCF9;
  --cream-dark: #EDE7DB;
  --green-light: #A6C3A7;
  --green-dark: #5A7A60;
  --clay-light: #CFA88D;
  --stone-light: #A69B93;
  
  /* Mood Colors */
  --mood-anxious: #D67E7E;
  --mood-sad: #A8809C;
  --mood-calm: #8DB0A8;
  --mood-thoughtful: #9BA47C;
  --mood-happy: #C5A572;
  --mood-excited: #D4956B;
  --mood-grateful: #B88B6B;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Crimson Pro', serif;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 50px;
  
  /* Shadows */
  --shadow-soft: 0 2px 8px rgba(61, 52, 44, 0.08), 0 1px 3px rgba(61, 52, 44, 0.06);
  --shadow-medium: 0 8px 25px rgba(61, 52, 44, 0.12), 0 3px 10px rgba(61, 52, 44, 0.08);
  --shadow-warm: 0 8px 32px rgba(154, 107, 81, 0.15);
  
  /* Animations */
  --ease-gentle: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  color: var(--nuuko-espresso);
  background: var(--nuuko-cream);
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  font-size: 16px;
  background: 
    radial-gradient(circle at 20% 30%, rgba(107, 143, 113, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(154, 107, 81, 0.03) 0%, transparent 50%),
    linear-gradient(135deg, var(--nuuko-cream) 0%, var(--cream-dark) 100%);
  background-attachment: fixed;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--nuuko-espresso);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

p {
  color: var(--nuuko-stone);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.text-encouraging {
  color: var(--nuuko-green);
  font-weight: 500;
}

.text-muted {
  color: var(--stone-light);
}

.text-small {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.italic {
  font-style: italic;
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-sidebar {
  grid-template-columns: 2fr 1fr;
  gap: var(--space-2xl);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* === CARDS === */
.card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(141, 135, 126, 0.15);
  backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease-gentle);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
  border-color: rgba(107, 143, 113, 0.3);
}

.card-minimal {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid rgba(141, 135, 126, 0.15);
  backdrop-filter: blur(8px);
}

.card-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(243, 239, 229, 0.98) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(141, 135, 126, 0.12);
  box-shadow: 
    0 8px 32px rgba(154, 107, 81, 0.12),
    0 2px 8px rgba(61, 52, 44, 0.06),
    inset 0 1px 2px rgba(255, 255, 255, 0.6);
  position: relative;
}

.card-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(107, 143, 113, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(154, 107, 81, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.card-hero > * {
  position: relative;
  z-index: 1;
}

/* Book-like entry cards */
.book-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all 0.3s var(--ease-gentle);
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 2px 8px rgba(61, 52, 44, 0.06),
    0 1px 3px rgba(61, 52, 44, 0.04);
  border: 1px solid rgba(141, 135, 126, 0.15);
  position: relative;
  overflow: hidden;
}

.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--nuuko-green) 0%, var(--nuuko-clay) 100%);
  opacity: 0.7;
  transition: all 0.3s var(--ease-gentle);
  border-radius: 0 2px 2px 0;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 8px 25px rgba(61, 52, 44, 0.08),
    0 3px 10px rgba(61, 52, 44, 0.06),
    0 1px 4px rgba(107, 143, 113, 0.1);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(107, 143, 113, 0.25);
}

.book-card:hover::before {
  opacity: 1;
  width: 5px;
}

/* Paper texture */
.paper-texture {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(61, 52, 44, 0.02) 1px, transparent 0);
  background-size: 20px 20px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25;
  transition: all 0.3s var(--ease-gentle);
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-decoration: none;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--nuuko-green), 0 0 0 4px rgba(107, 143, 113, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--nuuko-green) 0%, var(--green-dark) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 143, 113, 0.25), 0 1px 3px rgba(107, 143, 113, 0.15);
  font-weight: 500;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--nuuko-green) 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(107, 143, 113, 0.35), 0 3px 10px rgba(107, 143, 113, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(107, 143, 113, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--nuuko-espresso);
  border: 1px solid rgba(141, 135, 126, 0.25);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(61, 52, 44, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(107, 143, 113, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(61, 52, 44, 0.12), 0 1px 4px rgba(107, 143, 113, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(61, 52, 44, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--nuuko-stone);
}

.btn-ghost:hover {
  background: rgba(107, 143, 113, 0.1);
  color: var(--nuuko-espresso);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
  min-height: 52px;
}

/* === NAVIGATION === */
.nav {
  background: rgba(243, 239, 229, 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(141, 135, 126, 0.15);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 
    0 1px 3px rgba(61, 52, 44, 0.08),
    0 1px 12px rgba(61, 52, 44, 0.04);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--nuuko-espresso);
  transition: all 0.3s var(--ease-gentle);
}

.nav-logo:hover {
  opacity: 0.8;
}

.nav-logo .feather {
  font-size: 1.25rem;
  animation: float 4s ease-in-out infinite;
  transition: transform 0.3s var(--ease-gentle);
}

.nav-logo:hover .feather {
  transform: scale(1.1);
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--nuuko-stone);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.3s var(--ease-gentle);
}

.nav-link:hover {
  background: rgba(107, 143, 113, 0.1);
  color: var(--nuuko-espresso);
  transform: translateY(-1px);
}

.nav-link.active {
  background: var(--nuuko-green);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 143, 113, 0.3);
}

/* === FORMS === */
.form-group {
  margin-bottom: var(--space-lg);
}

.label {
  display: block;
  font-weight: 500;
  color: var(--nuuko-espresso);
  margin-bottom: var(--space-sm);
  font-family: var(--font-serif);
}

.input,
.textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(141, 135, 126, 0.2);
  border-radius: var(--radius-md);
  color: var(--nuuko-espresso);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all 0.3s var(--ease-gentle);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 3px rgba(61, 52, 44, 0.06);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--nuuko-stone);
  font-style: italic;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(107, 143, 113, 0.5);
  box-shadow: 
    0 0 0 3px rgba(107, 143, 113, 0.1), 
    inset 0 1px 3px rgba(61, 52, 44, 0.06);
  background: rgba(255, 255, 255, 0.9);
}

.textarea {
  min-height: 150px;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.7;
}

.writing-area {
  min-height: 350px;
  font-size: 1rem;
  line-height: 1.7;
  border: none;
  background: transparent;
  resize: none;
  padding: 0;
}

.writing-area:focus {
  border: none;
  box-shadow: none;
}

/* === MOOD SPECTRUM === */
.mood-spectrum {
  position: relative;
  height: 10px;
  background: linear-gradient(90deg, 
    var(--mood-anxious) 0%,
    var(--mood-sad) 16.66%,
    var(--mood-calm) 33.33%,
    var(--mood-thoughtful) 50%,
    var(--mood-happy) 66.66%,
    var(--mood-excited) 83.33%,
    var(--mood-grateful) 100%
  );
  border-radius: 6px;
  cursor: pointer;
  margin: 1.25rem 0;
  box-shadow: 
    inset 0 1px 2px rgba(61, 52, 44, 0.08),
    0 1px 3px rgba(61, 52, 44, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mood-thumb {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.92) 100%);
  border: 2px solid var(--nuuko-espresso);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 
    0 4px 15px rgba(61, 52, 44, 0.15), 
    0 2px 6px rgba(61, 52, 44, 0.1),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
  transition: all 0.3s var(--ease-gentle);
  backdrop-filter: blur(10px);
}

.mood-thumb:hover {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 
    0 8px 25px rgba(61, 52, 44, 0.2), 
    0 3px 10px rgba(61, 52, 44, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.9);
  border-color: var(--nuuko-green);
}

.mood-thumb:active {
  transform: translate(-50%, -50%) scale(1.05);
  cursor: grabbing;
}

.mood-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--nuuko-stone);
  margin-bottom: var(--space-sm);
}

.mood-current {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nuuko-clay);
  font-style: italic;
}

/* === CALENDAR === */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(141, 135, 126, 0.15);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.3s var(--ease-gentle);
  cursor: pointer;
  position: relative;
}

.calendar-day.active {
  background: linear-gradient(135deg, var(--nuuko-green) 0%, var(--green-dark) 100%);
  color: white;
  box-shadow: 
    0 2px 8px rgba(107, 143, 113, 0.25),
    0 1px 3px rgba(107, 143, 113, 0.15);
  font-weight: 600;
}

.calendar-day.inactive {
  background: rgba(243, 239, 229, 0.4);
  color: var(--stone-light);
}

.calendar-day:hover {
  background: rgba(107, 143, 113, 0.08);
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(107, 143, 113, 0.1);
}

.calendar-day.active:hover {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--nuuko-green) 100%);
  transform: scale(1.05);
  box-shadow: 
    0 4px 12px rgba(107, 143, 113, 0.3),
    0 2px 6px rgba(107, 143, 113, 0.2);
}

/* === ANIMATIONS === */
@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
  }
  25% { 
    transform: translateY(-3px) rotate(1deg); 
  }
  50% { 
    transform: translateY(-6px) rotate(0deg); 
  }
  75% { 
    transform: translateY(-3px) rotate(-1deg); 
  }
}

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

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

.fade-in {
  animation: fadeIn 0.5s var(--ease-gentle);
}

.slide-up {
  animation: slideUp 0.4s var(--ease-gentle);
}

.float {
  animation: float 4s ease-in-out infinite;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .container,
  .container-sm {
    padding: 0 var(--space-md);
  }
  
  .grid-sidebar {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .nav-content {
    padding: 0 var(--space-md);
  }
  
  .nav-links {
    display: none;
  }
  
  .card {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
  }
  
  .card-hero {
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
  }
  
  .btn {
    padding: 0.875rem 1.75rem;
    font-size: 0.9rem;
    min-height: 48px;
  }
  
  .calendar {
    padding: var(--space-md);
    gap: 0.375rem;
  }
  
  .writing-area {
    padding-left: 2.5rem !important;
    font-size: 0.9rem;
  }
  
  .mood-spectrum {
    height: 8px;
  }
  
  .mood-thumb {
    width: 22px;
    height: 22px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  /* Writing page mobile adjustments */
  .write-controls {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .writing-notebook textarea {
    min-height: 400px !important;
    padding: 2rem 1.5rem 2rem 3rem !important;
    font-size: 1rem !important;
  }
  
  .notebook-holes {
    display: none !important;
  }
}

/* === UTILITIES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.w-full { width: 100%; }

.hidden { display: none !important; }

/* Modal display */
.modal-visible {
  display: flex !important;
}

.divider {
  height: 1px;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(141, 135, 126, 0.3) 50%, 
    transparent 100%
  );
  margin: var(--space-xl) 0;
}

/* === ICON STYLES === */
.icon {
  display: inline-block;
  font-style: normal;
  font-size: 1rem;
}

.icon-sm {
  font-size: 0.875rem;
}

.icon-lg {
  font-size: 1.25rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cream-light);
}

::-webkit-scrollbar-thumb {
  background: var(--nuuko-stone);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--nuuko-espresso);
}

/* Selection styling */
::selection {
  background: rgba(107, 143, 113, 0.2);
  color: var(--nuuko-espresso);
}
