/* Jime Color Palette - Autumn & Warm */
:root {
  --jime-dark: #2d1b0a;
  --jime-main: #8b4513;
  --jime-accent: #cd853f;
  --jime-bright: #ff8c42;
  --jime-warm: #f4a261;
  --jime-deep: #e76f51;
  --jime-soft: #faf0e6;
  --jime-text: #faf0e6;
}

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Quicksand:wght@400;600&display=swap');

/* Prevent horizontal scroll */
html {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  overscroll-behavior-y: none;
}

/* Ensure all main containers don't cause horizontal scroll */
.diary, header, .collage-grid, .timeline, .stats-dashboard {
  max-width: 100%;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #2d1b0a, #1a0f05);
  color: #faf0e6;
  font-family: 'Quicksand', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}
@media (max-width:600px){ body{ padding-bottom:72px; } }
@media (prefers-reduced-motion: reduce){ .jimejournal-topbar{ backdrop-filter:none; } }

/* Títulos principales con Dancing Script */
h1, h2, h3, .initials-title, .tile-title, .collage-tile h3, .notes-header h4, .dashboard-header h3, .today-header h3, .mosaic-date-header {
  font-family: 'Dancing Script', cursive !important;
  letter-spacing: 0.04em;
}

/* Cuerpo y textos secundarios con Quicksand */
p, li, .collage-desc, .tile-date, .tile-footer, .note-text, .note-date, .stat-label, .stat-number, .memory-note, .memory-notes-section, .timeline-year-label, .timeline-point span, .view-toggle, .mosaic-overlay, .activity-text, .activity-time, .no-memories {
  font-family: 'Quicksand', sans-serif !important;
}

.background-stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255,140,66,0.15) 2px, transparent 2px),
    radial-gradient(circle at 60% 70%, rgba(244,162,97,0.2) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, rgba(231,111,81,0.1) 1.5px, transparent 1.5px),
    radial-gradient(circle at 30% 80%, rgba(205,133,63,0.12) 1px, transparent 1px);
  background-size: 80px 80px, 120px 120px, 60px 60px, 100px 100px;
  background-position: 0 0, 40px 40px, 20px 20px, 60px 60px;
  pointer-events: none;
  z-index: -1;
  animation: twinkleStars 4s ease-in-out infinite alternate;
}

@keyframes twinkleStars {
  0% { opacity: 0.6; }
  100% { opacity: 0.9; }
}

/* Autumn decorative elements */
.autumn-decoration {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-leaf {
  position: absolute;
  font-size: 1.5rem;
  animation: floatLeaf 8s linear infinite;
  opacity: 0.4;
}

.floating-leaf:nth-child(1) { left: 10%; animation-delay: 0s; }
.floating-leaf:nth-child(2) { left: 25%; animation-delay: 2s; }
.floating-leaf:nth-child(3) { left: 40%; animation-delay: 4s; }
.floating-leaf:nth-child(4) { left: 55%; animation-delay: 1s; }
.floating-leaf:nth-child(5) { left: 70%; animation-delay: 3s; }
.floating-leaf:nth-child(6) { left: 85%; animation-delay: 5s; }

@keyframes floatLeaf {
  0% { transform: translateY(100vh) rotate(0deg); }
  100% { transform: translateY(-100px) rotate(360deg); }
}

/* Corner decorations */
.corner-decoration {
  position: fixed;
  font-size: 2rem;
  z-index: 1;
  opacity: 0.6;
  animation: wind-sway 6s ease-in-out infinite;
}

.corner-decoration.top-left { top: 20px; left: 20px; }
.corner-decoration.top-right { top: 20px; right: 20px; }
.corner-decoration.bottom-left { bottom: 20px; left: 20px; }
.corner-decoration.bottom-right { bottom: 20px; right: 20px; }

@keyframes wind-sway {
  0%, 100% { 
    transform: rotate(-3deg) scale(1);
    opacity: 0.3;
  }
  25% { 
    transform: rotate(2deg) scale(1.05);
    opacity: 0.4;
  }
  75% { 
    transform: rotate(-1deg) scale(0.95);
    opacity: 0.35;
  }
}

header {
  padding: 1rem min(2rem, 5vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  box-sizing: border-box;
}
.jimejournal-topbar{ position:sticky; top:0; z-index:120; background:rgba(45,27,10,0.6); backdrop-filter:blur(10px) saturate(140%); border-bottom:1px solid rgba(250,240,230,0.25); }

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control-btn {
  background: rgba(139, 69, 19, 0.15);
  border: 1px solid var(--jime-main);
  color: var(--jime-text);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
}

.control-btn:hover {
  background: rgba(139, 69, 19, 0.3);
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--jime-main);
}

.fullscreen-btn {
  display: none !important;
}

header h2 {
  font-size: 1.7rem;
  font-family: 'Dancing Script', cursive;
  color: #8b4513;
}

.back-btn {
  color: #faf0e6;
  text-decoration: none;
  border: 1px solid #faf0e6;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background-color: #faf0e6;
  color: #2d1b0a;
}

.initials-title {
  text-align: center;
  font-size: 4rem;
  font-family: 'Dancing Script', cursive;
  background: linear-gradient(45deg, var(--jime-bright), var(--jime-warm), var(--jime-main));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 3rem 0 2rem;
  letter-spacing: 0.15rem;
  text-shadow: 2px 2px 8px rgba(139, 69, 19, 0.3);
  position: relative;
  overflow: visible;
  padding: 0 50px;
}
/* Bottom tabbar (isolated) */
.jimejournal-tabbar { position:fixed; bottom:0; left:0; width:100%; display:flex; justify-content:space-around; align-items:stretch; background:rgba(30,19,8,0.85); backdrop-filter:blur(12px) saturate(140%); border-top:1px solid rgba(250,240,230,0.25); z-index:900; padding:.35rem 0 .3rem; }
.jimejournal-tabbar .tabbar-item { flex:1; text-align:center; text-decoration:none; color:#faf0e6; font-size:.65rem; font-weight:600; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.2rem; padding:.55rem 0 .45rem; border-radius:8px; position:relative; transition:background .35s,color .35s; user-select:none; }
.jimejournal-tabbar .tabbar-item .tab-ico { font-size:1.25rem; }
.jimejournal-tabbar .tabbar-item:hover { background:rgba(250,240,230,0.08); }
.jimejournal-tabbar .tabbar-item:active { transform:translateY(1px); }
.jimejournal-tabbar .tabbar-item.active { color:#2d1b0a; background:#faf0e6; box-shadow:0 0 0 1px rgba(250,240,230,0.6), 0 4px 12px -2px rgba(250,240,230,0.6); }
.jimejournal-tabbar .tabbar-item.active::after { content:''; position:absolute; top:0; left:50%; transform:translate(-50%,-50%); width:42%; height:4px; border-radius:10px; background:linear-gradient(90deg,#faf0e6,#f4a261 70%); box-shadow:0 0 8px -2px #faf0e6, 0 0 14px -4px #faf0e6; }
.jimejournal-tabbar .tabbar-indicator { position:absolute; bottom:0; left:0; height:4px; width:40px; background:linear-gradient(90deg,#faf0e6,#f4a261); border-radius:4px 4px 0 0; box-shadow:0 0 8px rgba(250,240,230,0.6); transition: transform .45s cubic-bezier(.22,.8,.25,1), width .35s ease; pointer-events:none; }
@media (prefers-reduced-motion: reduce){ .jimejournal-tabbar{ backdrop-filter:none; } }

.initials-title::before {
  content: "🍂";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(-15deg);
  font-size: 2rem;
  animation: sway 3s ease-in-out infinite;
}

.initials-title::after {
  content: "🍁";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(15deg);
  font-size: 2rem;
  animation: sway 3s ease-in-out infinite reverse;
}

@keyframes sway {
  0%, 100% { transform: translateY(-50%) rotate(-15deg); }
  50% { transform: translateY(-40%) rotate(-5deg); }
}

.collage-grid {
  display: grid;
  /* Always show photos two-by-two (two columns) */
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  align-items: stretch;
}

.collage-tile {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.15), rgba(205, 133, 63, 0.1));
  border: 1px solid rgba(139, 69, 19, 0.25);
  border-radius: 16px;
  padding: 0;
  color: #faf0e6;
  text-align: left;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 6px 18px rgba(139, 69, 19, 0.25);
  cursor: pointer;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.collage-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(139, 69, 19, 0.35);
  border-color: rgba(139, 69, 19, 0.5);
}

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

.tile-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.collage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.collage-tile:hover .collage-img {
  transform: scale(1.05);
}

.tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(45,27,10,0) 50%, rgba(45,27,10,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.75rem 0.9rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.collage-tile:hover .tile-overlay {
  opacity: 1;
}

.tile-title {
  font-family: 'Dancing Script', cursive;
  font-size: 1.2rem;
  color: #cd853f;
}

.tile-date {
  font-size: 0.8rem;
  opacity: 0.85;
}

.tile-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem 0.75rem;
}

/* Cute NEW badge */
.new-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, var(--jime-main), var(--jime-bright));
  color: var(--jime-dark);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(139, 69, 19, 0.45), inset 0 1px 2px rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
  animation: popIn 500ms ease-out, glowPulse 2.5s ease-in-out infinite;
}

.new-badge.small {
  font-size: 0.65rem;
  padding: 2px 8px;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes popIn {
  0% { transform: translateY(-6px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 0 0 rgba(139, 69, 19, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(139, 69, 19, 0.0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 69, 19, 0.6); }
}

.collage-tile h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  font-family: 'Dancing Script', cursive;
  color: #cd853f;
}

.collage-desc {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(26, 15, 5, 0.95);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox img {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(139, 69, 19, 0.6);
  object-fit: contain;
  transition: opacity 0.25s ease;
}

.lightbox-caption {
  color: #faf0e6;
  font-size: 1rem;
  text-align: center;
  font-style: italic;
  margin: 0;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 2rem;
  color: #faf0e6;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.3s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  transform: scale(1.2);
  color: #8b4513;
}

/* Memory Notes Section */
.memory-notes-section {
  width: 100%;
  max-width: 600px;
  background: rgba(139, 69, 19, 0.1);
  border: 1px solid var(--jime-main);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(139, 69, 19, 0.3);
}

.notes-header h4 {
  margin: 0;
  color: var(--jime-main);
  font-family: 'Dancing Script', cursive;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-control-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.lightbox-nav-btn {
  background: rgba(139, 69, 19, 0.2);
  border: 1px solid var(--jime-main);
  color: var(--jime-text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav-btn:hover {
  background: var(--jime-main);
  color: var(--jime-dark);
  transform: scale(1.1);
}

.add-note-btn {
  background: var(--jime-main);
  color: var(--jime-dark);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-note-btn:hover {
  background: var(--jime-bright);
  transform: scale(1.1);
}

.notes-container {
  min-height: 60px;
  margin-bottom: 1rem;
}

.memory-note {
  background: rgba(139, 69, 19, 0.05);
  border: 1px solid rgba(139, 69, 19, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  position: relative;
  transition: all 0.3s ease;
}

.memory-note:hover {
  background: rgba(139, 69, 19, 0.1);
  border-color: var(--jime-main);
}

.note-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #ff8c42;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.note-delete:hover {
  background: rgba(255, 140, 66, 0.2);
  opacity: 1;
  transform: scale(1.1);
}

.note-text {
  color: var(--jime-text);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}

.note-date {
  font-size: 0.8rem;
  opacity: 0.7;
  font-style: italic;
  color: var(--jime-main);
}

.add-note-form {
  background: rgba(139, 69, 19, 0.05);
  border: 1px solid rgba(139, 69, 19, 0.2);
  border-radius: 8px;
  padding: 1rem;
}

.add-note-form textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(139, 69, 19, 0.1);
  border: 1px solid var(--jime-main);
  border-radius: 8px;
  padding: 0.8rem;
  color: var(--jime-text);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 1rem;
}

.add-note-form textarea::placeholder {
  color: rgba(250, 240, 230, 0.6);
  font-style: italic;
}

.add-note-form textarea:focus {
  outline: none;
  border-color: var(--jime-bright);
  box-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
}

.note-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}

.save-note-btn, .cancel-note-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.save-note-btn {
  background: var(--jime-main);
  color: var(--jime-dark);
}

.save-note-btn:hover {
  background: var(--jime-bright);
  transform: scale(1.05);
}

.cancel-note-btn {
  background: rgba(139, 69, 19, 0.2);
  color: var(--jime-text);
}

.cancel-note-btn:hover {
  background: rgba(139, 69, 19, 0.3);
  transform: scale(1.05);
}

/* Timeline */
.timeline {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin: 2rem 1rem;
  overflow-x: auto;
  padding: 1rem 0 2rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--jime-accent) transparent;
}

.timeline::before {
  content: '';
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--jime-accent) 10%, 
    var(--jime-bright) 30%,
    var(--jime-warm) 50%,
    var(--jime-main) 70%,
    var(--jime-accent) 90%, 
    transparent 100%);
  border-radius: 2px;
  animation: autumnGlow 4s ease-in-out infinite alternate;
}

@keyframes autumnGlow {
  0% { 
    box-shadow: 0 0 8px var(--jime-accent); 
    filter: hue-rotate(0deg);
  }
  50% {
    box-shadow: 0 0 20px var(--jime-bright);
    filter: hue-rotate(10deg);
  }
  100% { 
    box-shadow: 0 0 15px var(--jime-warm);
    filter: hue-rotate(-10deg);
  }
}

.timeline::-webkit-scrollbar {
  height: 6px;
}

.timeline::-webkit-scrollbar-track {
  background: transparent;
}

.timeline::-webkit-scrollbar-thumb {
  background: var(--jime-accent);
  border-radius: 3px;
}

.timeline-year {
  display: flex;
  align-items: center;
  margin: 0 1rem;
}

.timeline-year-label {
  background: linear-gradient(135deg, var(--jime-main), var(--jime-accent));
  color: var(--jime-dark);
  padding: 0.5rem 1rem;
  border: 2px solid var(--jime-bright);
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
  margin-bottom: 1rem;
}

.timeline-point {
  position: relative;
  flex: 0 0 auto;
  text-align: center;
  transition: all 0.3s ease;
  z-index: 2;
}

.timeline-point:hover {
  transform: scale(1.05);
}

.timeline-point::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--jime-bright), var(--jime-warm));
  border-radius: 50%;
  box-shadow: 0 0 12px var(--jime-accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { 
    transform: translateX(-50%) scale(1); 
    box-shadow: 0 0 12px var(--jime-accent);
  }
  50% { 
    transform: translateX(-50%) scale(1.2); 
    box-shadow: 0 0 20px var(--jime-bright);
  }
}

.timeline-img {
  display: block;
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--jime-accent);
  margin: 0 auto 0.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.timeline-img::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  background: linear-gradient(45deg, var(--jime-bright), var(--jime-warm), var(--jime-accent));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-img:hover {
  transform: scale(1.15) rotate(2deg);
  border-color: var(--jime-bright);
  box-shadow: 0 0 20px rgba(255, 140, 66, 0.6);
}

.timeline-img:hover::before {
  opacity: 1;
}

.timeline-point span {
  display: block;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #faf0e6;
  white-space: nowrap;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Keep overlay visible on touch devices for readability */
  .tile-overlay { opacity: 1; }
  .collage-grid {
    /* Keep exactly two columns on small screens as well */
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
    padding: 1rem;
  }
  .tile-media { aspect-ratio: 3 / 4; }
  .tile-title { font-size: 1.05rem; }
  .tile-date { font-size: 0.75rem; }
  .header-controls {
    gap: 0.5rem;
  }
  
  .control-btn {
  min-width: 44px;
  height: 44px;
  font-size: 1.15rem;
  }
  
  .stats-dashboard, .on-this-day {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .charts-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .view-controls {
    padding: 0 1rem;
    gap: 0.5rem;
  }
  
  .view-toggle {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
  
  .mosaic-container {
    padding: 1rem;
  }
  
  .mosaic-date-group {
    columns: 1;
  }
  
  .timeline {
    gap: 1rem;
    margin: 1rem 0.5rem;
  }
  
  .timeline-img {
    width: 50px;
    height: 50px;
  }
  
  .lightbox {
    padding: 1rem;
  }
  
  .memory-notes-section {
    padding: 1rem;
  }
  
  .notes-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .add-note-btn {
    align-self: center;
  }
}

@media (max-width: 480px) {
  .initials-title {
    font-size: 3rem;
    margin: 2rem 0 1.5rem;
  }
  
  .collage-grid { padding: 0.75rem 1rem 1.25rem; }
  
  .timeline-point span {
    font-size: 0.7rem;
  }
  
  .timeline-year-label {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Statistics Dashboard */
.stats-dashboard {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(26, 15, 5, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem;
  box-sizing: border-box;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--jime-main);
  padding-bottom: 1rem;
}

.dashboard-header h3 {
  color: var(--jime-main);
  font-size: 1.8rem;
  margin: 0;
  font-family: 'Dancing Script', cursive;
}

.close-dashboard {
  background: none;
  border: none;
  color: var(--jime-text);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-dashboard:hover {
  background: rgba(139, 69, 19, 0.2);
  transform: scale(1.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(139, 69, 19, 0.1);
  border: 1px solid var(--jime-main);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

.stat-icon {
  font-size: 2.5rem;
  opacity: 0.8;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--jime-main);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: rgba(139, 69, 19, 0.1);
  border: 1px solid var(--jime-main);
  border-radius: 12px;
  padding: 1.5rem;
}

.chart-card h4 {
  color: var(--jime-main);
  margin-bottom: 1rem;
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
}

.year-chart {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.chart-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chart-label {
  min-width: 60px;
  font-weight: bold;
  color: var(--jime-main);
}

.chart-fill {
  height: 20px;
  background: linear-gradient(90deg, var(--jime-main), var(--jime-bright));
  border-radius: 10px;
  transition: width 0.5s ease;
}

.chart-value {
  min-width: 30px;
  text-align: center;
  font-weight: bold;
}

.recent-activity {
  background: rgba(139, 69, 19, 0.1);
  border: 1px solid var(--jime-main);
  border-radius: 12px;
  padding: 1.5rem;
}

.recent-activity h4 {
  color: var(--jime-main);
  margin-bottom: 1rem;
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  background: rgba(139, 69, 19, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--jime-main);
}

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

.activity-text {
  flex: 1;
}

.activity-time {
  font-size: 0.8rem;
  opacity: 0.7;
  font-style: italic;
}

/* On This Day Section */
.on-this-day {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(26, 15, 5, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem;
  box-sizing: border-box;
}

.today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--jime-main);
  padding-bottom: 1rem;
}

.today-header h3 {
  color: var(--jime-main);
  font-size: 1.8rem;
  margin: 0;
  font-family: 'Dancing Script', cursive;
}

.close-today {
  background: none;
  border: none;
  color: var(--jime-text);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-today:hover {
  background: rgba(139, 69, 19, 0.2);
  transform: scale(1.1);
}

.memory-year {
  margin-bottom: 2rem;
  background: rgba(139, 69, 19, 0.1);
  border: 1px solid var(--jime-main);
  border-radius: 12px;
  padding: 1.5rem;
}

.year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(139, 69, 19, 0.3);
}

.year-header span:first-child {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--jime-main);
}

.years-ago {
  font-style: italic;
  opacity: 0.8;
  font-size: 0.9rem;
}

.year-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.today-photo {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.today-photo:hover {
  transform: scale(1.05);
}

.today-photo img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.today-photo-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: 0.5rem;
  font-size: 0.8rem;
  text-align: center;
}

.no-memories {
  text-align: center;
  color: var(--jime-main);
  font-style: italic;
  padding: 2rem;
  font-size: 1.1rem;
}

/* View Controls */
.view-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  padding: 0 2rem;
}

.view-toggle {
  background: rgba(139, 69, 19, 0.1);
  border: 1px solid var(--jime-main);
  color: var(--jime-text);
  padding: 0.8rem;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle:hover {
  background: rgba(139, 69, 19, 0.2);
  transform: translateY(-2px) scale(1.05);
}

.view-toggle.active {
  background: var(--jime-main);
  color: var(--jime-dark);
  box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
}

/* Mosaic Container */
.mosaic-container {
  display: none;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.mosaic-container.active {
  display: block;
}

.mosaic-date-group {
  margin-bottom: 3rem;
}

.mosaic-date-header {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--jime-main);
  margin-bottom: 1.5rem;
  text-align: center;
  padding: 1rem;
  background: rgba(139, 69, 19, 0.1);
  border-radius: 12px;
  border: 1px solid var(--jime-main);
  font-family: 'Dancing Script', cursive;
}

.mosaic-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}

.mosaic-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

.mosaic-item img {
  width: 100%;
  display: block;
  border-radius: 12px;
}

.mosaic-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(45, 27, 10, 0.9));
  color: var(--jime-text);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
  font-family: 'Dancing Script', cursive;
}

/* Responsive Mosaic Layout */
@media (min-width: 768px) {
  .mosaic-date-group {
    columns: 2;
    column-gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .mosaic-date-group {
    columns: 3;
    column-gap: 2rem;
  }
}

@media (min-width: 1200px) {
  .mosaic-date-group {
    columns: 4;
    column-gap: 2rem;
  }
}

/* Presentation Mode */
.presentation-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 2000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.presentation-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.presentation-img {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(139, 69, 19, 0.5);
}

.presentation-caption {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 1rem 2rem;
  border-radius: 8px;
  text-align: center;
  color: #faf0e6;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 80%;
}

.presentation-title {
  font-size: 1.2rem;
  font-weight: bold;
  font-family: 'Dancing Script', cursive;
}

.presentation-date {
  font-size: 0.9rem;
  opacity: 0.8;
}

.presentation-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  z-index: 2001;
}

.presentation-btn {
  background: rgba(139, 69, 19, 0.8);
  border: 2px solid var(--jime-main);
  color: #faf0e6;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.presentation-btn:hover {
  background: var(--jime-main);
  transform: scale(1.1);
}

/* Mobile adjustments for notes header */
@media (max-width: 768px) {
  .notes-header {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem;
  }
  
  .notes-header h4 {
    font-size: 1.1rem !important;
    white-space: nowrap;
  }
  
  .lightbox-control-group {
    flex-shrink: 0;
  }
  
  .lightbox-nav-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  
  .add-note-btn {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .lightbox-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .add-note-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
  
  .presentation-caption {
    bottom: 100px;
    padding: 0.75rem 1.5rem;
  }
  
  .presentation-controls {
    bottom: 30px;
    gap: 0.75rem;
  }
  
  .presentation-btn {
    width: 45px;
    height: 45px;
  }
}

/* Seasonal shimmer for timeline */
.timeline::before {
  background-size: 200% 100%;
  animation: autumn-shimmer 8s ease-in-out infinite;
}

@keyframes autumn-shimmer {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Gentle fade-in for page elements */
.collage-grid,
.memory-notes-section,
.stats-dashboard {
  animation: gentle-fade-in 1s ease-out;
}

@keyframes gentle-fade-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ============================================
   PHOTO ACTIONS (Favorite, Download)
   ============================================ */

.action-btn {
  background: rgba(139, 69, 19, 0.15);
  border: 1px solid var(--jime-main);
  color: var(--jime-text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background: var(--jime-main);
  color: var(--jime-dark);
  transform: scale(1.1);
}

.favorite-star-btn.active {
  background: var(--jime-bright);
  color: #fff;
  animation: starPulse 0.5s ease;
}

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

.controls-divider {
  color: var(--jime-main);
  opacity: 0.3;
  font-size: 1.2rem;
  user-select: none;
}

.favorite-tile-btn {
  background: rgba(139, 69, 19, 0.1);
  border: 1px solid rgba(139, 69, 19, 0.3);
  color: var(--jime-text);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.favorite-tile-btn:hover,
.favorite-tile-btn.active {
  background: rgba(139, 69, 19, 0.2);
  opacity: 1;
  transform: scale(1.05);
}

.favorite-tile-btn.active {
  border-color: var(--jime-bright);
}

/* SKELETON SCREENS */

.skeleton-note {
  padding: 1rem;
  background: rgba(139, 69, 19, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, rgba(139, 69, 19, 0.1) 25%, rgba(139, 69, 19, 0.2) 50%, rgba(139, 69, 19, 0.1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ANIMATIONS */

.lightbox-enter {
  animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pull-refresh-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--jime-main);
  color: var(--jime-dark);
  padding: 0.5rem 1.5rem;
  border-radius: 0 0 12px 12px;
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .action-btn { width: 38px; height: 38px; font-size: 1rem; }
  .favorite-tile-btn { font-size: 0.9rem; padding: 0.25rem 0.5rem; }
  .controls-divider { font-size: 1rem; }
  .notes-header { flex-direction: row !important; align-items: center !important; gap: .5rem; flex-wrap: nowrap !important; justify-content: space-between !important; }
  .notes-header h4 { font-size: 1rem; white-space: nowrap; margin: 0 !important; }
  .lightbox-control-group { flex-shrink: 0; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 480px) {
  .action-btn { width: 36px; height: 36px; font-size: 0.95rem; }
  .favorite-tile-btn { font-size: 0.85rem; padding: 0.2rem 0.4rem; }
  .controls-divider { font-size: 0.9rem; margin: 0 0.1rem; }
  .lightbox-control-group { gap: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
