:root {
  --bg-main: #FAF6F0;
  --primary: #8B263E;
  --secondary: #B84A62;
  --card-bg-pink: #F8E8EE;
  --card-bg-white: #FFFFFF;
  --text-main: #4A3E3D;
  --font-headings: 'Amiri', serif;
  --font-body: 'Cairo', sans-serif;
  --font-dates: 'Playfair Display', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  direction: rtl;
  padding-bottom: 80px; /* space for audio player */
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  color: var(--primary);
}

.date-font {
  font-family: var(--font-dates);
  direction: ltr;
  display: inline-block;
}

/* Utilities */
.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px 0 rgba(139, 38, 62, 0.1);
  border-radius: 15px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 1. Lock Screen (Wax Seal Envelope) */
#lock-screen {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--bg-main);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 1s ease, visibility 1s;
}
#lock-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.envelope {
  width: 90%;
  max-width: 400px;
  background-color: var(--card-bg-white);
  border: 2px solid var(--primary);
  border-radius: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.wax-seal {
  width: 60px;
  height: 60px;
  background-color: var(--primary);
  border-radius: 50%;
  position: absolute;
  top: -30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3), 0 5px 10px rgba(0,0,0,0.2);
  transition: transform 0.5s ease;
}
.wax-seal.broken {
  transform: scale(0);
}

.passcode-input {
  margin-top: 20px;
  padding: 10px;
  font-size: 18px;
  border: 1px solid var(--secondary);
  border-radius: 5px;
  text-align: center;
  font-family: var(--font-dates);
  width: 80%;
  outline: none;
}
.passcode-btn {
  margin-top: 15px;
  padding: 10px 20px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.1em;
  transition: background 0.3s;
}
.passcode-btn:hover {
  background-color: var(--secondary);
}

/* App Header & Love Counter */
header {
  text-align: center;
  padding: 40px 20px;
}
.love-counter {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.counter-box {
  background: var(--card-bg-pink);
  padding: 15px;
  border-radius: 10px;
  min-width: 80px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(139, 38, 62, 0.1);
}
.counter-box span {
  display: block;
  font-family: var(--font-dates);
  font-size: 24px;
  color: var(--primary);
  font-weight: bold;
}
.counter-box small {
  font-size: 14px;
}

/* Sections */
section {
  margin-bottom: 60px;
}
.section-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2em;
}

/* 4. Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background-color: var(--secondary);
  top: 0; bottom: 0; left: 50%;
  margin-left: -2px;
}
.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
}
.timeline-item.right { left: 50%; }
.timeline-item.left { left: 0; }

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  right: -10px; top: 15px;
  background-color: var(--card-bg-white);
  border: 4px solid var(--primary);
  border-radius: 50%;
  z-index: 1;
}
.timeline-item.right::after { left: -10px; right: auto; }

.timeline-content {
  padding: 20px;
  background-color: var(--card-bg-white);
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.timeline-date {
  font-family: var(--font-body);
  color: var(--secondary);
  font-size: 14px;
  margin-bottom: 10px;
}
.timeline-icon {
  font-size: 24px;
  margin-bottom: 10px;
}
.timeline-img {
  width: 100%;
  border-radius: 8px;
  margin-top: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Responsive Timeline */
@media screen and (max-width: 768px) {
  .timeline::after { left: 31px; }
  .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
  .timeline-item.right { left: 0; }
  .timeline-item.left::after, .timeline-item.right::after { left: 21px; right: auto; }
}

/* 5. Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  aspect-ratio: 1;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-item:hover img {
  transform: scale(1.05);
}

.album-title {
  position: absolute;
  bottom: 0; left: 0; width: 100%;
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 10px;
  text-align: center;
  font-family: var(--font-headings);
  font-size: 1.2em;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s;
}
.lightbox.active {
  opacity: 1; visibility: visible;
}
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 80%;
  max-height: 80vh;
}
.lightbox-content img {
  max-width: 100%; max-height: 70vh;
  border-radius: 10px;
  border: 5px solid white;
}
.lightbox-content p {
  color: white; margin-top: 15px; font-size: 1.2em; font-family: var(--font-headings); text-align: center;
}
.lightbox-close {
  position: absolute; top: 20px; right: 30px;
  color: white; font-size: 40px; cursor: pointer;
  z-index: 2010;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  font-size: 30px;
  padding: 15px 20px;
  cursor: pointer;
  border-radius: 5px;
  z-index: 2010;
  transition: background 0.3s;
}
.lightbox-nav:hover {
  background: rgba(255,255,255,0.5);
}
.lightbox-prev {
  left: 20px;
}
.lightbox-next {
  right: 20px;
}

/* 6. Map */
#map {
  height: 400px;
  width: 100%;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  z-index: 1;
}

/* 7. Daily Message */
.daily-message {
  text-align: center;
  padding: 40px;
  max-width: 600px;
  margin: 0 auto;
}
.daily-message p {
  font-size: 1.5em;
  font-family: var(--font-headings);
  color: var(--primary);
}

/* 8. Bucket List */
.bucket-list {
  max-width: 600px;
  margin: 0 auto;
}
.bucket-item {
  display: flex;
  align-items: center;
  background: var(--card-bg-white);
  padding: 15px 20px;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: background 0.3s;
}
.bucket-item:hover {
  background: var(--card-bg-pink);
}
.bucket-item .heart-checkbox {
  width: 24px; height: 24px;
  border: 2px solid var(--secondary);
  border-radius: 50%;
  margin-left: 15px;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: all 0.3s;
  flex-shrink: 0;
}
.bucket-item.completed .heart-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-size: 12px;
}
.bucket-item.completed span {
  text-decoration: line-through;
  opacity: 0.6;
}
.progress-container {
  width: 100%;
  background: var(--card-bg-white);
  border-radius: 10px;
  height: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0;
  transition: width 0.5s ease;
}

/* 2. Floating Audio Player */
.audio-player {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 100;
  width: 90%;
  max-width: 450px;
  direction: ltr; /* English media controls */
}
.track-cover {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.player-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.track-info {
  text-align: right;
  font-family: var(--font-body);
}
.track-title {
  font-weight: bold; font-size: 14px;
  color: var(--text-main);
  display: block;
}
.progress-container-audio {
  width: 100%;
  background: var(--card-bg-white);
  border-radius: 5px;
  height: 6px;
  cursor: pointer;
  position: relative;
}
.progress-bar-audio {
  height: 100%;
  background: var(--primary);
  width: 0%;
  border-radius: 5px;
  transition: width 0.1s linear;
}
.time-display {
  font-size: 11px;
  color: var(--text-main);
  text-align: right;
  margin-top: -3px;
  direction: ltr;
}
.player-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
}
.player-controls button {
  background: none; border: none; font-size: 24px;
  color: var(--primary); cursor: pointer;
  transition: transform 0.2s;
}
.player-controls button:hover {
  transform: scale(1.1);
}
