/* ========================================
   Family History Website - Styles
   ======================================== */

/* CSS Variables */
:root {
  --color-primary: #E74C3C;
  --color-secondary: #3498DB;
  --color-accent: #F39C12;
  --color-success: #27AE60;
  --color-india: #FF9933;
  --color-usa: #3C3B6E;
  --color-baby: #9B59B6;
  --color-love: #E91E63;
  --color-wedding: #FFD700;
  --color-bg: #FDF6E3;
  --color-bg-dark: #1a1a2e;
  --color-text: #2C3E50;
  --color-text-light: #7F8C8D;
  --font-heading: 'Fredoka One', cursive;
  --font-body: 'Nunito', sans-serif;
  --timeline-line: #BDC3C7;
  --shadow-soft: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-medium: 0 8px 30px rgba(0,0,0,0.15);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========================================
   Header & Hero Section
   ======================================== */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: white;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  margin-bottom: 1rem;
  animation: fadeInDown 1s ease-out;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: rgba(255,255,255,0.9);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-characters {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin: 2rem 0;
  animation: fadeIn 1s ease-out 0.6s both;
}

.hero-characters .character {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.hero-characters .character.chikki {
  width: 90px;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  cursor: pointer;
}

.scroll-indicator svg {
  width: 40px;
  height: 40px;
  fill: white;
}

/* ========================================
   Timeline Section
   ======================================== */
.timeline-section {
  padding: 4rem 1rem;
  background: var(--color-bg);
  position: relative;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  text-align: center;
  margin-bottom: 3rem;
  color: var(--color-text);
}

.timeline {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  padding: 2rem 0;
}

/* Timeline central line */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    var(--color-india),
    var(--color-india) 25%,
    var(--color-usa) 50%,
    var(--color-baby) 100%
  );
  border-radius: 2px;
}

/* Timeline Event */
.timeline-event {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 0;
  width: 50%;
  position: relative;
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.6s ease-out;
}

.timeline-event.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-event:nth-child(even) {
  align-self: flex-end;
  justify-content: flex-start;
  margin-left: 50%;
  transform: translateX(50px);
}

.timeline-event:nth-child(even).visible {
  transform: translateX(0);
}

/* Timeline dot */
.timeline-event::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: white;
  border: 4px solid var(--color-primary);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  box-shadow: var(--shadow-soft);
}

.timeline-event:nth-child(odd)::before {
  right: -12px;
}

.timeline-event:nth-child(even)::before {
  left: -12px;
}

/* Event specific colors */
.timeline-event[data-location="india"]::before {
  border-color: var(--color-india);
}

.timeline-event[data-location="usa"]::before {
  border-color: var(--color-usa);
}

.timeline-event[data-type="birth"]::before {
  border-color: var(--color-baby);
  background: var(--color-baby);
}

.timeline-event[data-type="love"]::before {
  border-color: var(--color-love);
  background: var(--color-love);
}

.timeline-event[data-type="wedding"]::before {
  border-color: var(--color-wedding);
  background: var(--color-wedding);
}

/* Timeline Card */
.timeline-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 0 2rem;
  max-width: 380px;
  box-shadow: var(--shadow-soft);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 12px solid transparent;
}

.timeline-event:nth-child(odd) .timeline-card::before {
  right: -24px;
  border-left-color: white;
}

.timeline-event:nth-child(even) .timeline-card::before {
  left: -24px;
  border-right-color: white;
}

.timeline-year {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.timeline-year .location-flag {
  font-size: 1.2rem;
}

.timeline-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.timeline-description {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.timeline-characters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.timeline-characters .character {
  width: 60px;
  height: auto;
}

.timeline-characters .character.mini {
  width: 45px;
}

/* Celebration effects */
.celebration {
  position: relative;
}

.celebration::after {
  content: '🎉';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 1.5rem;
  animation: celebratePop 0.5s ease-out;
}

/* ========================================
   Confetti Animation
   ======================================== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confettiFall 4s linear forwards;
}

/* ========================================
   Family Section
   ======================================== */
.family-section {
  padding: 4rem 1rem;
  background: linear-gradient(180deg, var(--color-bg) 0%, #fff 100%);
  text-align: center;
}

.family-portrait {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  margin: 3rem auto;
  max-width: 600px;
}

.family-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.family-member .character {
  width: 150px;
  height: auto;
  transition: transform 0.3s ease;
}

.family-member .character.chikki {
  width: 110px;
}

.family-member:hover .character {
  transform: scale(1.1);
}

.family-member-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-text);
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--color-bg-dark);
  color: white;
  text-align: center;
  padding: 2rem;
}

.footer-hearts {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.footer p {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-15px);
  }
  60% {
    transform: translateX(-50%) translateY(-7px);
  }
}

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

@keyframes celebratePop {
  0% {
    transform: scale(0) rotate(-20deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
  /* Timeline Mobile Layout */
  .timeline::before {
    left: 20px;
  }

  .timeline-event,
  .timeline-event:nth-child(even) {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    padding-left: 50px;
  }

  .timeline-event::before,
  .timeline-event:nth-child(even)::before {
    left: 8px;
    right: auto;
  }

  .timeline-event:nth-child(odd) .timeline-card::before,
  .timeline-event:nth-child(even) .timeline-card::before {
    left: -24px;
    right: auto;
    border-right-color: white;
    border-left-color: transparent;
  }

  .timeline-card {
    margin: 0;
    max-width: none;
  }

  /* Hero Mobile */
  .hero-characters {
    flex-wrap: wrap;
  }

  .hero-characters .character {
    width: 80px;
  }

  .hero-characters .character.chikki {
    width: 60px;
  }

  /* Family Portrait Mobile */
  .family-portrait {
    flex-direction: column;
    gap: 1.5rem;
  }

  .family-member .character {
    width: 120px;
  }

  .family-member .character.chikki {
    width: 90px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .timeline-card {
    padding: 1rem;
  }

  .timeline-year {
    font-size: 1.2rem;
  }

  .timeline-title {
    font-size: 1rem;
  }

  .timeline-description {
    font-size: 0.85rem;
  }
}

/* ========================================
   Utility Classes
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
