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

/* Password Screen Styles */
.password-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: url('assets/kitty.jpg') center/cover fixed no-repeat;
  display: flex; justify-content: center; align-items: center;
  z-index: 9999; transition: all 0.5s ease; 
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrollbar but allow vertical scroll */
  padding: 3rem 1rem;
}
.password-screen::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,105,180,0.6), rgba(255,20,147,0.6));
  z-index: 0;
}
.password-screen > * { position: relative; z-index: 1; }
.password-screen.hidden { opacity: 0; pointer-events: none; transform: scale(1.03); }

/* Container for password box and side memes */
.password-wrapper {
  display: flex; align-items: center; gap: 2rem; max-width: 90%; margin: 0 auto;
}

/* Side meme styling */
.side-meme { width: 200px; animation: danceBounce 2s ease-in-out infinite; }
.side-meme.left { animation-delay: 0s; }
.side-meme.right { animation-delay: 0.5s; }
@keyframes danceBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg) scale(1); }
  25% { transform: translateY(-15px) rotate(5deg) scale(1.05); }
  50% { transform: translateY(0) rotate(-5deg) scale(1.1); }
  75% { transform: translateY(-10px) rotate(5deg) scale(1.05); }
}

/* Desktop only helper class */
.desktop-only {
  display: block;
}

/* Mobile responsive for password screen */
@media (max-width: 768px) {
  .desktop-only { 
    display: none !important; 
  }
  .password-wrapper { 
    justify-content: center; 
    flex-direction: column; 
    gap: 1rem; 
    width: 100%;
    max-width: 100%;
  }
  .password-screen {
    padding: 1rem;
  }
}

.password-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center; max-width: 420px; width: 100%;
  animation: floatPassword 3s ease-in-out infinite; flex-shrink: 0;
}
@keyframes floatPassword { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.password-container h2 { color: #ff1493; margin-bottom: 1.5rem; font-family: 'Comic Sans MS', cursive; font-size: 2rem; }
.password-input {
  width: 100%; padding: 1rem; font-size: 1.2rem; border: 3px solid #ff69b4;
  border-radius: 10px; margin-bottom: 1rem; font-family: 'Comic Sans MS', cursive; text-align: center;
}
.password-submit {
  background: linear-gradient(135deg, #ff69b4, #ff1493); color: white; border: none;
  padding: 1rem 2rem; font-size: 1.2rem; border-radius: 10px; cursor: pointer;
  font-family: 'Comic Sans MS', cursive; font-weight: bold; transition: transform 0.3s;
}
.password-submit:hover { transform: scale(1.05); }
.password-error { color: #ff1493; margin-top: 1rem; display: none; }

/* Main Content Styles */
.main-content { display: none; }
.main-content.show { display: block; }

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background-image: url('assets/kitty.jpg');
  background-size: cover; background-position: center; background-attachment: fixed;
  overflow-x: hidden; position: relative;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* Overlay for better text visibility */
body::before {
  content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(45deg, rgba(255, 105, 180, 0.7), rgba(255, 20, 147, 0.7), rgba(255, 105, 180, 0.7), rgba(255, 182, 193, 0.7));
  background-size: 400% 400%; animation: gradientShift 3s ease infinite;
  pointer-events: none; z-index: 1;
}
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* New Layout with Side GIFs */
.content-with-gifs {
  display: flex;
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.side-gifs {
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.center-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 1024px) {
  .content-with-gifs {
    flex-direction: column;
  }
  .side-gifs {
    position: static;
  }
}

/* Photo Section Styles */
.photo-section { 
  padding: 2rem 0; 
  text-align: center; 
  z-index: 10; 
  position: relative; 
}

/* Align photo section to top */
.photo-section-top {
  padding-top: 0;
  margin-top: 0;
}

.photo-placeholder {
  background: linear-gradient(135deg, rgba(255, 182, 193, 0.95), rgba(255, 105, 180, 0.95));
  padding: 3rem; 
  border-radius: 25px; 
  margin: 0 auto 2rem; 
  max-width: 600px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3), 0 0 30px rgba(255, 105, 180, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.5);
}

.photo-placeholder h2 { 
  color: white; 
  margin-bottom: 2rem; 
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3); 
}

.photo-with-caption {
  margin: 2rem 0;
}

.custom-image {
  max-width: 100%; 
  height: auto; 
  border-radius: 20px; 
  box-shadow: 0 15px 40px rgba(0,0,0,0.4), 0 0 30px rgba(255, 105, 180, 0.5);
  margin: 1rem 0; 
  border: 5px solid rgba(255, 255, 255, 0.5);
}

.photo-caption {
  color: white;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  font-style: italic;
}

/* Envelope Wrapper */
.envelope-wrapper {
  position: relative;
  z-index: 10;
  margin: 2rem 0;
}

/* Envelope Section */
.envelope-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 1rem 0;
  position: relative;
  z-index: 10;
}

.envelope {
  width: 400px;
  height: 250px;
  background: linear-gradient(135deg, #ffb6c1, #ff69b4);
  position: relative;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  margin-bottom: 0;
}

/* Remove all hover effects to prevent stuttering */
.envelope:hover {
  /* No hover effects */
}

.envelope-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 200px solid transparent;
  border-right: 200px solid transparent;
  border-top: 150px solid #ff1493;
  transform-origin: top center;
  transition: transform 0.6s;
  z-index: 2;
  pointer-events: none; /* Prevent hover conflicts */
}

.envelope.open .envelope-top {
  transform: rotateX(180deg);
}

.envelope-body {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.envelope-label {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  z-index: 1;
  position: relative;
  padding: 0 1rem;
  white-space: nowrap;
  margin-top: 90px;
}

/* Letter overlay background */
.letter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.envelope.open ~ .letter-overlay {
  opacity: 1;
  visibility: visible;
}

.letter {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  transition: all 0.6s ease;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow-y: auto;
  z-index: 1000;
}

.envelope.open .letter {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Cat gif below envelope */
.envelope-cat-gif {
  display: flex;
  justify-content: center;
  margin-top: -20px;
  padding: 0 1rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.letter-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff69b4;
  color: white;
  border: none;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  z-index: 1001;
}

.letter-close:hover {
  background: #ff1493;
}

.letter-content {
  font-family: 'Georgia', serif;
  color: #333;
  line-height: 1.8;
}

.letter-content h3 {
  color: #ff1493;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.letter-content p {
  margin-bottom: 1rem;
}

.letter-signature {
  text-align: right;
  font-style: italic;
  margin-top: 2rem;
  color: #ff69b4;
}

/* Photo Gallery */
.photo-gallery {
  padding: 3rem 1rem;
  position: relative;
  z-index: 10;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.gallery-item {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: transform 0.3s;
}

.gallery-item:hover {
  transform: translateY(-10px);
}

.gallery-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.gallery-caption {
  color: #ff1493;
  font-size: 1rem;
  text-align: center;
  font-weight: bold;
}

/* Countdown Section */
.countdown-section {
  min-height: 60vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; position: relative; z-index: 2; margin-top: 2rem;
  overflow: visible; /* Allow content to be visible */
  padding: 2rem 1rem; /* Add padding to prevent cutoff */
}
.hello-kitty-batman { position: absolute; font-size: 3rem; animation: floatAround 15s infinite; z-index: 3; }
@keyframes floatAround {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(100px, -50px) rotate(90deg); }
  50% { transform: translate(-50px, -100px) rotate(180deg); }
  75% { transform: translate(-100px, 50px) rotate(270deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

.pre-birthday { 
  color: white; 
  text-shadow: 3px 3px 6px rgba(0,0,0,0.5), 0 0 20px #ff69b4; 
  z-index: 10; 
  overflow: visible; /* Allow text to be fully visible */
  padding: 0 2rem; /* Add horizontal padding */
}
.pre-birthday h1 {
  font-size: 3rem; 
  margin-bottom: 2rem; 
  animation: bounce 2s infinite;
  filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.3));
  white-space: normal; /* Allow text wrapping if needed */
  word-wrap: break-word;
}
@keyframes bounce { 
  0%, 100% { transform: translateY(0) scale(1); } 
  50% { transform: translateY(-15px) scale(1.03); } /* Reduced scale to prevent cutoff */
}

.countdown { display: flex; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; justify-content: center; }
.time-box {
  background: linear-gradient(135deg, rgba(255, 182, 193, 0.9), rgba(255, 105, 180, 0.9));
  padding: 1.5rem; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 0 20px rgba(255, 105, 180, 0.5);
  min-width: 100px; animation: float 3s ease-in-out infinite; border: 3px solid rgba(255, 255, 255, 0.5);
  position: relative; overflow: hidden;
}
.time-box::before {
  content: '😺'; position: absolute; top: -10px; right: -10px; font-size: 2rem; opacity: 0.3; animation: spin 4s linear infinite;
}
.time-box:nth-child(1) { animation-delay: 0s; }
.time-box:nth-child(2) { animation-delay: 0.5s; }
.time-box:nth-child(3) { animation-delay: 1s; }
.time-box:nth-child(4) { animation-delay: 1.5s; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.time-value { font-size: 3rem; font-weight: bold; color: #fff; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.time-label { font-size: 1rem; color: #fff; margin-top: 0.5rem; font-weight: bold; }

.birthday-message { display: none; animation: fadeIn 2s; z-index: 10; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
.birthday-message h1 {
  font-size: 4rem; color: white; text-shadow: 4px 4px 8px rgba(0,0,0,0.3), 0 0 30px #ff69b4; margin-bottom: 2rem;
  animation: rainbow 2s linear infinite, pulse 1s infinite;
}
@keyframes rainbow { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.meme-section { padding: 3rem 0; max-width: 900px; margin: 0 auto; z-index: 10; position: relative; }
.meme-container { margin: 3rem 0; text-align: center; animation: slideIn 1s; position: relative; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-100px) rotate(-5deg); } to { opacity: 1; transform: translateX(0) rotate(0deg); } }
.meme-text {
  font-size: 2.5rem; color: white; text-shadow: 3px 3px 6px rgba(0,0,0,0.7), 0 0 20px #ff69b4;
  margin: 1rem 0; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; animation: wobble 2s ease-in-out infinite;
}
@keyframes wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.brainrot-text {
  background: linear-gradient(90deg, #ff69b4, #ffb6c1, #ff1493, #ff69b4);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shine 3s linear infinite;
}

/* Darker text with visible emojis */
.brainrot-text-dark {
  color: #ffffff;
  font-weight: bold;
  text-shadow: 4px 4px 8px rgba(0,0,0,0.8), 0 0 25px rgba(255, 105, 180, 1), 0 0 35px rgba(255, 20, 147, 0.8);
  /* White color to show emojis properly with pink glow */
}

@keyframes shine { to { background-position: 200% center; } }

.batman-kitty-border { border: 10px solid transparent; border-image: linear-gradient(45deg, #ff69b4, #000, #ff69b4, #000) 1; animation: borderRotate 4s linear infinite; }
@keyframes borderRotate {
  0% { border-image-source: linear-gradient(45deg, #ff69b4, #000, #ff69b4, #000); }
  50% { border-image-source: linear-gradient(45deg, #000, #ff69b4, #000, #ff69b4); }
  100% { border-image-source: linear-gradient(45deg, #ff69b4, #000, #ff69b4, #000); }
}

.floating-emojis { position: fixed; width: 100%; height: 100%; pointer-events: none; overflow: hidden; top: 0; left: 0; z-index: 5; }
.emoji { position: absolute; font-size: 2rem; animation: floatUp 10s linear infinite; }
@keyframes floatUp { from { transform: translateY(100vh) rotate(0deg); opacity: 1; } to { transform: translateY(-100px) rotate(360deg); opacity: 0; } }

/* Balloons animation */
.balloons-container {
  position: fixed;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  top: 0;
  left: 0;
  z-index: 6;
}

.balloon {
  position: absolute;
  font-size: 3rem;
  animation: floatBalloon 8s linear infinite;
  bottom: -100px;
}

@keyframes floatBalloon {
  from {
    transform: translateY(0) rotate(-10deg);
    opacity: 1;
  }
  to {
    transform: translateY(-120vh) rotate(10deg);
    opacity: 0;
  }
}

.spinning-cat { animation: spin 2s linear infinite; display: inline-block; font-size: 1.5em; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .password-container { 
    padding: 1.75rem; 
    max-width: 90%;
  }
  .password-container h2 { 
    font-size: 1.5rem; 
  }
  .pre-birthday h1 { 
    font-size: 2rem; /* Smaller font on mobile */
    padding: 0 1rem; /* Add padding to prevent cutoff */
  }
  .pre-birthday h2 {
    font-size: 1.5rem; /* Adjust secondary text size */
    padding: 0 1rem;
  }
  .meme-text { font-size: 1.8rem; }
  .time-box { min-width: 86px; padding: 1rem; }
  .photo-placeholder { padding: 1.75rem; margin: 1rem auto; }
  
  .envelope {
    width: 90%;
    max-width: 350px;
    height: 220px;
  }
  
  .envelope-top {
    border-left-width: 175px;
    border-right-width: 175px;
    border-top-width: 130px;
  }
  
  .letter {
    width: 85%;
    padding: 1.5rem;
    font-size: 0.9rem;
  }
  
  .envelope-cat-gif {
    max-width: 90%;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .password-container h2 { font-size: 1.5rem; }
  .password-input, .password-submit { font-size: 1rem; }
  .password-container {
    padding: 1.5rem;
  }
  .time-value { font-size: 2.2rem; }
  .time-label { font-size: 0.85rem; }
  body { background-attachment: scroll; }
  
  .envelope {
    height: 180px;
  }
  
  .envelope-top {
    border-left-width: 150px;
    border-right-width: 150px;
    border-top-width: 100px;
  }
  
  .envelope-label {
    font-size: 1.2rem;
  }
  
  .letter-content h3 {
    font-size: 1.2rem;
  }
  
  .letter {
    padding: 1rem;
    max-height: 70vh;
  }
  
  .envelope-cat-gif {
    max-width: 85%;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}