/* ============================================
   SHERI THE LOVE — Dork Diaries Style
   Notebook / Diary / Doodle Aesthetic
   ============================================ */

/* Google Fonts loaded in HTML:
   - Caveat (handwritten headers)
   - Nunito (body)
   - Patrick Hand (doodle text)
   Add Patrick Hand + Indie Flower to HTML link */

@import url('https://fonts.googleapis.com/css2?family=Indie+Flower&family=Patrick+Hand&display=swap');

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

body {
  font-family: 'Patrick Hand', 'Nunito', sans-serif;
  font-size: 16px;
  color: #4A4A4A;
  background-color: #FFF8F0;
  /* Lined paper background */
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 31px,
      #F8BBD0 31px,
      #F8BBD0 32px
    );
  background-size: 100% 32px;
  min-height: 100vh;
  padding-bottom: 80px;
  line-height: 1.6;
}

/* Red margin line (like real notebook) */
body::before {
  content: '';
  position: fixed;
  left: 40px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #EF9A9A;
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

/* === HEADER === */
.header {
  background: linear-gradient(135deg, #CE93D8 0%, #F48FB1 50%, #FFD54F 100%);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 3px dashed #FFF;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.logo {
  font-family: 'Indie Flower', 'Caveat', cursive;
  font-size: 1.6rem;
  color: #FFF;
  text-decoration: none;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  letter-spacing: 1px;
}

.cookie-counter {
  background: #FFF;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: 2px dashed #FFD54F;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.cookie-icon { font-size: 1.2rem; }

/* === CONTAINER === */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

/* === DORK DIARIES CARD (notebook paper feel) === */
.card {
  background: #FFFDF7;
  border: 2px solid #E1BEE7;
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  box-shadow: 3px 3px 0 rgba(206,147,216,0.3);
  /* Slightly rotated for doodle feel */
}

.card::before {
  content: '♡';
  position: absolute;
  top: -8px;
  right: 10px;
  font-size: 1rem;
  color: #F48FB1;
}

.card-header h1, .card-header h2, .card-header h3 {
  font-family: 'Indie Flower', cursive;
  color: #7B1FA2;
}

/* === DOODLE DECORATIONS === */
.doodle-star {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0.5;
  pointer-events: none;
}

/* Tape effect on cards */
.card-tape {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255,213,79,0.6);
  width: 60px;
  height: 18px;
  border-radius: 2px;
}

/* === TYPOGRAPHY — Dork Diaries === */
h1 {
  font-family: 'Indie Flower', cursive;
  font-size: 1.8rem;
  color: #7B1FA2;
  line-height: 1.3;
  /* Underline doodle style */
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: #F48FB1;
  text-underline-offset: 4px;
}

h2 {
  font-family: 'Indie Flower', cursive;
  font-size: 1.4rem;
  color: #AB47BC;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.2rem;
  color: #CE93D8;
}

p {
  font-family: 'Patrick Hand', sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
}

/* === SUBJECT CARDS (Homepage) === */
.subject-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.subject-card {
  background: #FFFDF7;
  border: 2px dashed #E1BEE7;
  border-radius: 8px;
  padding: 1.2rem 0.8rem;
  text-align: center;
  text-decoration: none;
  color: #4A4A4A;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  box-shadow: 2px 2px 0 rgba(206,147,216,0.2);
}

.subject-card:nth-child(odd) { transform: rotate(-1deg); }
.subject-card:nth-child(even) { transform: rotate(1deg); }

.subject-card:active {
  transform: scale(0.95) rotate(0deg);
  border-color: #CE93D8;
  background: #FCE4EC;
  border-style: solid;
}

.subject-icon { font-size: 2.2rem; }

.subject-name {
  font-family: 'Indie Flower', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: #7B1FA2;
}

.subject-desc {
  font-family: 'Patrick Hand', sans-serif;
  font-size: 0.8rem;
  color: #999;
  line-height: 1.3;
}

/* Arrow doodle on hover */
.subject-card::after {
  content: '→';
  position: absolute;
  bottom: 5px;
  right: 8px;
  font-size: 1rem;
  color: #CE93D8;
  opacity: 0.5;
}

/* === QUICK ACTIONS (horizontal scroll) === */
.quick-actions {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.quick-action {
  background: #FFFDF7;
  border: 2px solid #E1BEE7;
  border-radius: 12px;
  padding: 0.8rem;
  text-decoration: none;
  color: #7B1FA2;
  min-width: 100px;
  text-align: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 rgba(206,147,216,0.2);
}

.quick-action:active {
  transform: scale(0.95);
  background: #FCE4EC;
}

.quick-action-icon { font-size: 1.5rem; display: block; margin-bottom: 0.2rem; }
.quick-action-label { font-family: 'Patrick Hand', cursive; font-size: 0.9rem; font-weight: 700; }

/* === DAILY FACT (sticky note style) === */
.daily-fact {
  background: #FFF9C4;
  border: none;
  border-radius: 2px;
  padding: 1rem 1.2rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #5D4037;
  position: relative;
  box-shadow: 3px 3px 0 rgba(255,193,7,0.3);
  transform: rotate(-1deg);
}

.daily-fact::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,213,79,0.7);
  width: 50px;
  height: 16px;
  border-radius: 2px;
}

.daily-fact-header {
  font-family: 'Indie Flower', cursive;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #F57F17;
  font-size: 1.1rem;
}

/* === NAVIGATION CARDS (old style, kept for compatibility) === */
.nav-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.nav-card {
  background: #FFFDF7;
  border: 2px dashed #E1BEE7;
  border-radius: 8px;
  padding: 1.5rem 1rem;
  text-align: center;
  text-decoration: none;
  color: #4A4A4A;
  box-shadow: 2px 2px 0 rgba(206,147,216,0.2);
}

.nav-card-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.nav-card-title { font-family: 'Indie Flower', cursive; font-size: 1.1rem; color: #7B1FA2; }

/* === STATS (doodle boxes) === */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.stat-box {
  background: #F3E5F5;
  border: 2px dashed #CE93D8;
  border-radius: 8px;
  padding: 0.8rem;
  text-align: center;
}

.stat-value {
  font-family: 'Indie Flower', cursive;
  font-size: 1.8rem;
  color: #7B1FA2;
  font-weight: 700;
}

.stat-label {
  font-family: 'Patrick Hand', sans-serif;
  font-size: 0.85rem;
  color: #888;
}

/* === BUTTONS (sketchy style) === */
.btn {
  padding: 0.8rem 1.5rem;
  border: 2px solid;
  border-radius: 8px;
  font-family: 'Patrick Hand', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: #CE93D8;
  border-color: #AB47BC;
  color: #FFF;
  box-shadow: 2px 2px 0 rgba(171,71,188,0.3);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  background: #FFFDF7;
  border-color: #E1BEE7;
  color: #7B1FA2;
  box-shadow: 2px 2px 0 rgba(206,147,216,0.2);
}

.btn-block { display: block; width: 100%; }

/* === FORM ELEMENTS (notebook style) === */
input[type="text"],
textarea,
select {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-bottom: 2px dashed #CE93D8;
  background: transparent;
  font-family: 'Patrick Hand', sans-serif;
  font-size: 1.1rem;
  color: #4A4A4A;
  outline: none;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-bottom-color: #7B1FA2;
  border-bottom-style: solid;
}

textarea {
  min-height: 100px;
  resize: vertical;
  border: 2px dashed #CE93D8;
  border-radius: 4px;
  padding: 1rem;
  background: rgba(255,253,247,0.5);
}

textarea:focus {
  border-color: #7B1FA2;
  border-style: solid;
  background: #FFF;
}

select {
  background: #FFFDF7;
  border: 2px dashed #CE93D8;
  border-radius: 4px;
  padding: 0.8rem;
  cursor: pointer;
}

/* === PROGRESS BAR === */
.progress-bar {
  background: #F3E5F5;
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
  border: 1px solid #E1BEE7;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #CE93D8, #F48FB1, #FFD54F);
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* === STARS === */
.stars { display: flex; gap: 0.5rem; justify-content: center; margin: 1rem 0; }
.star { font-size: 2rem; cursor: pointer; opacity: 0.3; transition: all 0.2s; }
.star.active { opacity: 1; transform: scale(1.1); }

/* === PROFILE === */
.level-display {
  text-align: center;
  padding: 1rem;
}

.level-emoji { font-size: 3rem; }

/* === BADGE GRID === */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.badge-item {
  text-align: center;
  padding: 0.5rem;
  border: 2px dashed #E1BEE7;
  border-radius: 8px;
  font-size: 0.8rem;
}

.badge-icon { font-size: 1.5rem; display: block; margin-bottom: 0.2rem; }

/* === WRITING LIST === */
.writing-item {
  background: #FFFDF7;
  border: 2px solid #E1BEE7;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 2px 2px 0 rgba(206,147,216,0.2);
  transition: all 0.2s;
  position: relative;
}

.writing-item:active {
  transform: scale(0.98);
  box-shadow: 1px 1px 0 rgba(206,147,216,0.2);
}

.writing-item-title {
  font-family: 'Indie Flower', cursive;
  font-size: 1.2rem;
  color: #7B1FA2;
  margin-bottom: 0.3rem;
}

.writing-item-meta {
  font-size: 0.8rem;
  color: #999;
}

.writing-item-preview {
  font-size: 0.9rem;
  color: #777;
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* === SHARE BUTTON === */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #25D366;
  color: #FFF;
  border: none;
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-family: 'Patrick Hand', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* === READ PAGE (clean diary page) === */
.read-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  background: #FFFDF7;
  min-height: 100vh;
  /* Lined paper */
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 31px,
      #F8BBD0 31px,
      #F8BBD0 32px
    );
}

.read-page h1 {
  font-family: 'Indie Flower', cursive;
  color: #7B1FA2;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.read-page h2 {
  font-family: 'Indie Flower', cursive;
  color: #CE93D8;
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.read-byline {
  font-family: 'Patrick Hand', cursive;
  color: #CE93D8;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px dashed #E1BEE7;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

.fade-in { animation: fadeIn 0.5s ease; }

/* Cookie earned animation */
.cookie-earned {
  animation: bounceIn 0.5s ease;
}

/* === DOODLE BORDER DECORATIONS === */
.doodle-border {
  border: 3px solid #CE93D8;
  border-image: repeating-linear-gradient(
    45deg,
    #CE93D8,
    #CE93D8 5px,
    transparent 5px,
    transparent 10px
  ) 3;
}

/* === FLOATING DOODLES (decorative) === */
.decorative-cookies {
  position: fixed;
  font-size: 1.5rem;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.cookie-1 { top: 15%; right: 5%; transform: rotate(15deg); }
.cookie-2 { top: 40%; left: 3%; transform: rotate(-10deg); }
.cookie-3 { bottom: 25%; right: 8%; transform: rotate(25deg); }
.cookie-4 { bottom: 40%; left: 5%; transform: rotate(-20deg); }

/* === NOTEBOOK SPIRAL HOLES === */
.spiral-holes {
  position: fixed;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 20px;
  z-index: 0;
  pointer-events: none;
}

.spiral-hole {
  width: 14px;
  height: 14px;
  border: 2px solid #DDD;
  border-radius: 50%;
  background: #F5F5F5;
  margin-bottom: 48px;
}

/* === UTILITIES === */
.hide { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }

/* === RESPONSIVE === */
@media (max-width: 400px) {
  body::before { left: 20px; }
  .container { padding: 0.8rem; }
  .subject-grid { gap: 0.6rem; }
  .subject-card { padding: 1rem 0.6rem; }
  .subject-name { font-size: 1rem; }
  .subject-icon { font-size: 1.8rem; }
  h1 { font-size: 1.5rem; }
  .logo { font-size: 1.3rem; }
}

@media (min-width: 768px) {
  .subject-grid { grid-template-columns: 1fr 1fr 1fr; }
  .container { padding: 1.5rem; }
}

/* === TRIVIA SPECIFIC === */
.trivia-option {
  background: #FFFDF7;
  border: 2px solid #E1BEE7;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  font-family: 'Patrick Hand', sans-serif;
  font-size: 1.1rem;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
  display: block;
  box-shadow: 2px 2px 0 rgba(206,147,216,0.2);
}

.trivia-option:active { transform: scale(0.98); }

.trivia-option.correct {
  background: #C8E6C9;
  border-color: #66BB6A;
  color: #2E7D32;
}

.trivia-option.wrong {
  background: #FFCDD2;
  border-color: #EF5350;
  color: #C62828;
}

.trivia-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.trivia-explanation {
  background: #FFF9C4;
  border: 2px dashed #FFD54F;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #5D4037;
  transform: rotate(-0.5deg);
}

.trivia-score {
  font-family: 'Indie Flower', cursive;
  font-size: 3rem;
  color: #7B1FA2;
  text-align: center;
}
