/* ═══════════════════════════════════════════════════
   SUMAIYA'S LEARNING WORLD — NOTES STYLES
   Dashboard · Write Note · View Notes · Notes List
═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   5. NOTES DASHBOARD SECTION
═══════════════════════════════════════════════════ */

/* Dashboard Layout - Desktop First */
.notes-dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

/* Left Sidebar */
.notes-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: transform .25s ease, box-shadow .25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.streak-card-sm {
  background: linear-gradient(145deg, #FFF0E8, #FFE4D6);
  border: 2px solid rgba(255, 140, 0, 0.2);
}

.notes-count-card {
  background: linear-gradient(145deg, var(--blue-soft), var(--blue-light));
  border: 2px solid rgba(114, 182, 247, 0.3);
}

.motivation-card {
  background: linear-gradient(145deg, var(--green-light), #E8FFF3);
  border: 2px solid rgba(109, 217, 154, 0.3);
}

.stat-icon-lg {
  font-size: 3rem;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-number {
  font-family: var(--font-main);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1;
}

.stat-label-lg {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-mid);
}

.stat-subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  margin-top: 4px;
}

.motivation-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-mid);
  font-style: italic;
  line-height: 1.5;
}

/* Right Main Area */
.notes-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Write Note Card */
.write-note-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 2px solid rgba(195, 155, 245, 0.2);
}

.write-note-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.write-icon {
  font-size: 1.5rem;
}

.write-note-header h3 {
  font-family: var(--font-main);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-dark);
  flex: 1;
}

.today-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-mid);
  background: var(--purple-soft);
  padding: 6px 12px;
  border-radius: 20px;
}

/* REQUIRED TEXTAREA - id="note" */
textarea#note, textarea#note-write {
  width: 100%;
  min-height: 140px;
  border: 2px dashed rgba(195, 155, 245, 0.5);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  background: var(--purple-soft);
  resize: vertical;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  line-height: 1.7;
  margin-bottom: 12px;
}

textarea#note::placeholder, textarea#note-write::placeholder {
  color: var(--text-light);
}

textarea#note:focus, textarea#note-write:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(195, 155, 245, 0.2);
  border-style: solid;
}

.write-note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

/* Previous Notes Preview Card */
.previous-notes-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.notes-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.notes-list-header h3 {
  font-family: var(--font-main);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
}

.btn-view-all {
  background: transparent;
  border: none;
  color: var(--purple);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 4px 8px;
  border-radius: 8px;
}

.btn-view-all:hover {
  transform: translateX(4px);
  background: var(--purple-soft);
}

/* Preview List on Home */
.notes-preview-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Note Item Cards */
.note-item {
  background: linear-gradient(145deg, var(--pink-soft), var(--purple-soft));
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--purple);
  transition: transform 0.2s, box-shadow 0.2s;
}

.note-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.note-item:last-child {
  margin-bottom: 0;
}

.note-content {
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
  font-weight: 600;
}

.note-date {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   NOTES SECTION HEADER
═══════════════════════════════════════════════════ */

.notes-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--purple-soft);
}

.btn-back-nav {
  background: var(--purple-soft);
  border: 2px solid var(--purple-light);
  color: var(--text-dark);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 30px;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-back-nav:hover {
  transform: translateY(-2px);
  background: var(--purple-light);
  box-shadow: 0 4px 12px rgba(195, 155, 245, 0.3);
}

.btn-back-nav span {
  font-size: 1.1rem;
}

.notes-section-title {
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 1rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   VIEW NOTES SCREEN ENHANCEMENTS
═══════════════════════════════════════════════════ */

.view-notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-back-home {
  background: var(--purple-soft);
  border: none;
  color: var(--text-dark);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 20px;
  transition: transform 0.2s, background 0.2s;
}

.btn-back-home:hover {
  transform: translateY(-2px);
  background: var(--purple-light);
}

.notes-stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-pill {
  background: var(--card-bg);
  border-radius: 30px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
  box-shadow: var(--shadow-card);
}

.notes-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Write Screen Card */
#write-screen .journal-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 2px solid rgba(195, 155, 245, 0.2);
}

#write-screen h1 {
  font-family: var(--font-main);
  color: var(--text-dark);
  margin-bottom: 10px;
}

.save-btn {
  background: linear-gradient(135deg, var(--purple), #b07ae8);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 11px 28px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(195,155,245,.5);
  transition: transform .2s, box-shadow .2s;
  letter-spacing: .3px;
}
.save-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 24px rgba(195,155,245,.6);
}
.save-btn:active { transform: scale(.97); }

.message {
  margin-top: 10px;
  font-size: 0.95rem;
  text-align: center;
  font-weight: 600;
}

.message.success {
  color: #27ae60;
}

.message.error {
  color: #e74c3c;
}

/* ═══════════════════════════════════════════════════
   NOTES LIST (View Screen)
═══════════════════════════════════════════════════ */

.notes-list-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  max-height: 500px;
  overflow-y: auto;
}

.note-item {
  background: linear-gradient(145deg, var(--pink-soft), var(--purple-soft));
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--purple);
  transition: transform 0.2s;
}

.note-item:hover {
  transform: translateX(4px);
}

.note-content {
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
  font-weight: 600;
}

.note-date {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 700;
}

.loading {
  color: var(--text-mid);
  text-align: center;
  padding: 30px;
  font-weight: 600;
}

.empty {
  color: var(--text-light);
  text-align: center;
  padding: 40px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Notes Dashboard - Stack on tablet */
  .notes-dashboard {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .notes-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .notes-sidebar .stat-card {
    flex: 1;
    min-width: 140px;
    padding: 16px;
  }

  .stat-icon-lg {
    font-size: 2rem;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .notes-preview-list {
    max-height: 250px;
  }

  /* View notes screen */
  .view-notes-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .notes-grid-view {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* Notes Dashboard - Full width on mobile */
  .notes-sidebar {
    flex-direction: column;
  }

  .notes-sidebar .stat-card {
    min-width: auto;
  }

  .write-note-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .write-note-header h3 {
    font-size: 1.1rem;
  }

  .write-note-footer {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .notes-list-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .notes-stats-bar {
    flex-wrap: wrap;
  }

  .stat-pill {
    font-size: 0.8rem;
    padding: 8px 14px;
  }
}
