/**
 * Base Styles Module
 * Reset, body, container, header, life-counter, on-this-day
 */

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

/* Smooth scrolling for all scrollable elements */
html {
  scroll-behavior: smooth;
}

/* Reduce flickering on mobile with GPU acceleration */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Quicksand", sans-serif;
  background: linear-gradient(
    180deg,
    #f8f4ff 0%,
    #f5f8f5 25%,
    #f0f8f0 40%,
    #fff0f5 60%,
    #f5f0f7 100%
  );
  color: var(--text-dark);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  position: relative;
  overflow: hidden;
  display: flex;
  margin: 0;
  padding: 0;
  /* GPU acceleration for smooth rendering */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20%;
  background: linear-gradient(
    to top,
    rgba(180, 220, 180, 0.25) 0%,
    rgba(180, 220, 180, 0.15) 20%,
    rgba(180, 220, 180, 0.08) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    /* Flores violetas */
    radial-gradient(circle at 15% 20%, rgba(147, 112, 219, 0.2) 0%, transparent 35%),
    radial-gradient(circle at 85% 30%, rgba(218, 112, 214, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 50% 70%, rgba(177, 156, 217, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 25% 80%, rgba(221, 160, 221, 0.19) 0%, transparent 38%),
    radial-gradient(circle at 75% 15%, rgba(147, 112, 219, 0.17) 0%, transparent 32%),
    radial-gradient(circle at 40% 50%, rgba(230, 230, 250, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(218, 112, 214, 0.2) 0%, transparent 35%),
    radial-gradient(circle at 10% 60%, rgba(177, 156, 217, 0.17) 0%, transparent 37%),
    /* Flores blancas - MUY VISIBLES */
    radial-gradient(ellipse 70% 60% at 30% 40%, rgba(255, 255, 255, 0.35) 0%, transparent 30%),
    radial-gradient(ellipse 60% 70% at 70% 60%, rgba(255, 255, 255, 0.32) 0%, transparent 28%),
    radial-gradient(ellipse 65% 55% at 20% 75%, rgba(255, 255, 255, 0.3) 0%, transparent 32%),
    radial-gradient(ellipse 55% 65% at 80% 25%, rgba(255, 255, 255, 0.33) 0%, transparent 29%),
    radial-gradient(ellipse 60% 60% at 45% 15%, rgba(255, 255, 255, 0.31) 0%, transparent 31%),
    radial-gradient(ellipse 70% 50% at 60% 85%, rgba(255, 255, 255, 0.34) 0%, transparent 27%),
    radial-gradient(ellipse 50% 70% at 55% 50%, rgba(255, 255, 255, 0.28) 0%, transparent 33%),
    /* Hojas y elementos verdes - MUY VISIBLES */
    radial-gradient(ellipse 90% 50% at 35% 55%, rgba(180, 220, 180, 0.25) 0%, transparent 40%),
    radial-gradient(ellipse 70% 60% at 65% 45%, rgba(170, 210, 170, 0.22) 0%, transparent 38%),
    radial-gradient(ellipse 80% 45% at 15% 65%, rgba(175, 215, 175, 0.24) 0%, transparent 42%),
    radial-gradient(ellipse 60% 70% at 85% 35%, rgba(185, 225, 185, 0.21) 0%, transparent 36%),
    radial-gradient(ellipse 100% 40% at 50% 25%, rgba(178, 218, 178, 0.23) 0%, transparent 39%),
    radial-gradient(ellipse 50% 80% at 25% 30%, rgba(190, 230, 190, 0.24) 0%, transparent 41%),
    radial-gradient(ellipse 75% 55% at 75% 70%, rgba(182, 222, 182, 0.22) 0%, transparent 37%),
    /* Formas abstractas de jardín - MUY VISIBLES */
    radial-gradient(ellipse 100% 25% at 0% 100%, rgba(180, 220, 180, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 100% 30% at 100% 100%, rgba(175, 215, 175, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 40% 100% at 0% 50%, rgba(185, 225, 185, 0.25) 0%, transparent 45%),
    radial-gradient(ellipse 45% 100% at 100% 50%, rgba(178, 218, 178, 0.26) 0%, transparent 48%),
    radial-gradient(ellipse 80% 15% at 50% 0%, rgba(190, 230, 190, 0.2) 0%, transparent 35%);
  pointer-events: none;
  z-index: 0;
  animation: gardenBloom 40s ease-in-out infinite;
}

@keyframes gardenBloom {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.005);
  }
}

/* Decorative Flowers - Flores violetas sutiles como jardín */
.flower-decoration {
  position: fixed;
  width: clamp(40px, 8vw, 60px);
  height: clamp(40px, 8vw, 60px);
  opacity: 0.08;
  pointer-events: none;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 0;
  filter: blur(0.5px);
  animation: flowerFloat 40s ease-in-out infinite;
}

.flower-top-left {
  animation-delay: 0s;
}

.flower-top-right {
  animation-delay: 5s;
}

.flower-bottom-left {
  animation-delay: 10s;
}

.flower-bottom-right {
  animation-delay: 15s;
}

@keyframes flowerFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.15;
  }
  25% {
    transform: translate(5px, -8px) scale(1.05);
    opacity: 0.18;
  }
  50% {
    transform: translate(-3px, 5px) scale(0.98);
    opacity: 0.12;
  }
  75% {
    transform: translate(8px, 3px) scale(1.02);
    opacity: 0.16;
  }
}

.flower-top-left {
  top: -30px;
  left: -30px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="30" r="15" fill="%239370db"/><circle cx="70" cy="50" r="15" fill="%23b19cd9"/><circle cx="50" cy="70" r="15" fill="%23da70d6"/><circle cx="30" cy="50" r="15" fill="%23d8bfd8"/><circle cx="50" cy="50" r="20" fill="%238a2be2"/></svg>');
}

.flower-top-right {
  top: 100px;
  right: -20px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="30" r="15" fill="%23da70d6"/><circle cx="70" cy="50" r="15" fill="%239370db"/><circle cx="50" cy="70" r="15" fill="%23b19cd9"/><circle cx="30" cy="50" r="15" fill="%23d8bfd8"/><circle cx="50" cy="50" r="20" fill="%238a2be2"/></svg>');
}

.flower-bottom-left {
  bottom: 50px;
  left: 50px;
  width: 120px;
  height: 120px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="30" r="15" fill="%23b19cd9"/><circle cx="70" cy="50" r="15" fill="%23da70d6"/><circle cx="50" cy="70" r="15" fill="%239370db"/><circle cx="30" cy="50" r="15" fill="%23d8bfd8"/><circle cx="50" cy="50" r="20" fill="%238a2be2"/></svg>');
}

.flower-bottom-right {
  bottom: -40px;
  right: 100px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="30" r="15" fill="%23d8bfd8"/><circle cx="70" cy="50" r="15" fill="%23b19cd9"/><circle cx="50" cy="70" r="15" fill="%23da70d6"/><circle cx="30" cy="50" r="15" fill="%239370db"/><circle cx="50" cy="50" r="20" fill="%238a2be2"/></svg>');
}

.container {
  max-width: 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0.5rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  /* Smooth rendering with GPU */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Header - Reducido para dar más atención al calendario */
header {
  text-align: center;
  margin-bottom: 0.2rem;
  flex-shrink: 0;
  padding: 0;
  opacity: 0.9;
}

.title {
  font-family: "Pacifico", cursive;
  font-size: clamp(1rem, 2.8vw, 1.3rem);
  color: #9370db;
  margin: 0;
  text-shadow: 0 1px 2px rgba(147, 112, 219, 0.1);
  line-height: 1.1;
  font-weight: 400;
  opacity: 0.9;
}

.flower-icon {
  display: inline-block;
  animation: rotate 3s ease-in-out infinite;
}

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

.subtitle {
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  color: #da70d6;
  opacity: 0.75;
  line-height: 1.2;
  margin: 0 0 0.2rem 0;
  font-family: "Quicksand", sans-serif;
  font-weight: 500;
}

/* Contador de vida - Reducido al 5% de atención */
.life-counter {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  border: 1px solid rgba(255, 182, 193, 0.12);
  box-shadow: 0 1px 4px rgba(255, 182, 193, 0.08);
  position: relative;
  overflow: hidden;
  opacity: 0.9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem 1rem;
  min-height: 2rem;
}

/* Línea decorativa removida para diseño compacto */

.life-counter-main {
  display: flex;
  align-items: center;
}

.age-display {
  font-size: clamp(0.7rem, 1.6vw, 0.8rem);
  font-weight: 600;
  color: #9370db;
  white-space: nowrap;
  font-family: "Quicksand", sans-serif;
  line-height: 1;
}

.life-counter-details {
  display: flex;
  align-items: center;
}

.birth-stats {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: clamp(0.6rem, 1.3vw, 0.7rem);
  color: #9370db;
  font-weight: 500;
  font-family: "Quicksand", sans-serif;
  line-height: 1;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  opacity: 0.85;
}

.stat-separator {
  opacity: 0.4;
  font-size: 0.5rem;
}

.stat-separator {
  color: rgba(147, 112, 219, 0.25);
  font-weight: 300;
  font-size: 1em;
}

.next-birthday {
  font-size: clamp(0.55rem, 1.2vw, 0.65rem);
  color: #da70d6;
  font-weight: 500;
  font-family: "Quicksand", sans-serif;
  opacity: 0.8;
  white-space: nowrap;
  display: flex;
  align-items: center;
  line-height: 1;
}

/* Botones de acción en el banner de vida */
.life-counter-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 1.4rem;
}

.life-counter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(147, 112, 219, 0.2);
  background: rgba(255, 255, 255, 0.5);
  color: #9370db;
  font-size: clamp(0.55rem, 1.2vw, 0.65rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Quicksand", sans-serif;
  line-height: 1;
  height: 1.4rem;
  vertical-align: middle;
  box-sizing: border-box;
  text-align: center;
}

.life-counter-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(147, 112, 219, 0.35);
}

.life-counter-btn .btn-icon {
  font-size: 1em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.life-counter-btn .btn-text {
  white-space: nowrap;
  line-height: 1;
}

.life-counter-btn.has-user {
  background: rgba(147, 112, 219, 0.15);
  border-color: rgba(147, 112, 219, 0.3);
}

@media (max-width: 600px) {
  .life-counter {
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
  }
  
  .life-counter-main,
  .life-counter-details,
  .next-birthday {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  
  .birth-stats {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .life-counter-actions {
    width: 100%;
    justify-content: center;
    align-items: center;
    margin-top: 0.2rem;
    gap: 10px;
  }
  
  .life-counter-btn .btn-text {
    display: none;
  }
  
  .life-counter-btn {
    padding: 0;
    height: 1.6rem;
    width: 1.6rem;
    min-width: 1.6rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .life-counter-btn .btn-icon {
    font-size: 0.85rem;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }
}

/* Sección "En este día..." - Estilo Violeta */
.on-this-day {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(218, 183, 227, 0.3) 0%, rgba(196, 165, 214, 0.3) 100%);
  background-image: url('data:image/svg+xml,<svg width="40" height="40" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="1.2" fill="%23d4b5e0" opacity="0.2"/><circle cx="22" cy="22" r="0.8" fill="%23c9a8d9" opacity="0.15"/><circle cx="18" cy="22" r="0.8" fill="%23c9a8d9" opacity="0.15"/><circle cx="22" cy="18" r="0.8" fill="%23c9a8d9" opacity="0.15"/><circle cx="18" cy="18" r="0.8" fill="%23c9a8d9" opacity="0.15"/></svg>');
  background-size: 40px 40px;
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(177, 156, 217, 0.2);
  border: 1px solid rgba(218, 112, 214, 0.2);
  animation: slideInDown 0.6s ease-out;
}

.on-this-day-header {
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.on-this-day-title {
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  color: #9370db;
  font-weight: 600;
  display: flex;
  align-items: center;
  font-family: "Quicksand", sans-serif;
  gap: 0.3rem;
  opacity: 0.75;
}

.on-this-day-content {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.3rem 0.5rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.on-this-day-content::-webkit-scrollbar {
  display: none;
}

.on-this-day-item {
  flex-shrink: 0;
  width: 100px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(177, 156, 217, 0.25);
  background: linear-gradient(135deg, #c4a5d6 0%, #dab7e3 100%);
  border: 1px solid rgba(218, 112, 214, 0.2);
}

.on-this-day-item:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 4px 16px rgba(177, 156, 217, 0.4), 0 2px 8px rgba(196, 165, 214, 0.3);
  border-color: rgba(218, 112, 214, 0.3);
}

.on-this-day-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.on-this-day-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  padding: 0.3rem;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

/* Notificación de fotos nuevas */
#new-photos-notification {
  animation: slideInDown 0.3s ease-out;
}
