/* ============================================
   FAIZAN TO LAIBA - ROMANTIC WEBSITE (OPTIMIZED)
   ============================================ */

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

/* CSS Variables - Theme System */
:root {
  --bg-primary: linear-gradient(135deg, #ffeef8 0%, #ffe0f0 50%, #ffd5e5 100%);
  --bg-secondary: rgba(255, 255, 255, 0.7);
  --text-primary: #5a3d5c;
  --text-secondary: #8b5a8c;
  --accent-color: #ff6b9d;
  --accent-glow: rgba(255, 107, 157, 0.4);
  --heart-color: #ff4081;
  --button-bg: linear-gradient(135deg, #ff6b9d 0%, #ff8a80 100%);
  --shadow-color: rgba(255, 107, 157, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.25);
  --chat-left: linear-gradient(135deg, #ffb6c1 0%, #ffc0cb 100%);
  --chat-right: linear-gradient(135deg, #ff6b9d 0%, #ff8a80 100%);
}

[data-theme="dark-love"] {
  --bg-primary: linear-gradient(135deg, #1a0a1a 0%, #2d1b2d 50%, #1a0a1a 100%);
  --bg-secondary: rgba(45, 27, 45, 0.8);
  --text-primary: #ffb6c1;
  --text-secondary: #ffc0cb;
  --accent-color: #ff69b4;
  --accent-glow: rgba(255, 105, 180, 0.4);
  --heart-color: #ff1493;
  --button-bg: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
  --shadow-color: rgba(255, 20, 147, 0.3);
  --glass-bg: rgba(45, 27, 45, 0.4);
  --chat-left: linear-gradient(135deg, #4a2c4a 0%, #5a3d5a 100%);
  --chat-right: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
}

[data-theme="sunset"] {
  --bg-primary: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 50%, #c44569 100%);
  --bg-secondary: rgba(255, 255, 255, 0.2);
  --text-primary: #fff5f5;
  --text-secondary: #ffe0e0;
  --accent-color: #ffd93d;
  --accent-glow: rgba(255, 217, 61, 0.5);
  --heart-color: #ff6b6b;
  --button-bg: linear-gradient(135deg, #ffd93d 0%, #ff9a56 100%);
  --shadow-color: rgba(255, 154, 86, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --chat-left: rgba(255, 255, 255, 0.25);
  --chat-right: linear-gradient(135deg, #ffd93d 0%, #ff9a56 100%);
}

[data-theme="night-sky"] {
  --bg-primary: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  --bg-secondary: rgba(48, 43, 99, 0.6);
  --text-primary: #e0e0ff;
  --text-secondary: #b8b8ff;
  --accent-color: #9d4edd;
  --accent-glow: rgba(157, 78, 221, 0.5);
  --heart-color: #c77dff;
  --button-bg: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
  --shadow-color: rgba(157, 78, 221, 0.4);
  --glass-bg: rgba(48, 43, 99, 0.4);
  --chat-left: rgba(123, 44, 191, 0.4);
  --chat-right: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
}

[data-theme="cute-pink"] {
  --bg-primary: linear-gradient(135deg, #ffcce0 0%, #ffb3d9 50%, #ff99cc 100%);
  --bg-secondary: rgba(255, 255, 255, 0.8);
  --text-primary: #d63384;
  --text-secondary: #e85d9a;
  --accent-color: #ff69b4;
  --accent-glow: rgba(255, 105, 180, 0.4);
  --heart-color: #ff1493;
  --button-bg: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
  --shadow-color: rgba(255, 105, 180, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.4);
  --chat-left: linear-gradient(135deg, #ffcce0 0%, #ffb3d9 100%);
  --chat-right: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
}

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-primary);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading-screen.hidden { opacity: 0; visibility: hidden; }
.loader-heart {
  font-size: 4rem;
  animation: heartbeat 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--heart-color));
}
.loader-text {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  margin-top: 1rem;
  color: var(--accent-color);
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

/* Floating Hearts - Optimized */
.floating-hearts {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.floating-heart {
  position: absolute;
  font-size: 1.2rem;
  color: var(--heart-color);
  opacity: 0.5;
  animation: float-up 10s linear infinite;
  will-change: transform;
}
@keyframes float-up {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.5; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* Stars Background */
.stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  display: none;
}
[data-theme="night-sky"] .stars { display: block; }
.star {
  position: absolute;
  width: 2px; height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Cursor Glow - Desktop Only */
.cursor-glow {
  position: fixed;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
}
@media (pointer: coarse) { .cursor-glow { display: none; } }

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--glass-bg);
}
.logo {
  font-family: 'Dancing Script', cursive;
  font-size: 1.6rem;
  color: var(--accent-color);
  text-shadow: 0 0 15px var(--accent-glow);
  cursor: pointer;
}
.nav-controls {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}
.control-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--button-bg);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px var(--shadow-color);
}
.control-btn:hover { transform: scale(1.1); }

.theme-menu {
  position: absolute;
  top: 55px; right: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  padding: 0.8rem;
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid var(--glass-bg);
  box-shadow: 0 8px 25px var(--shadow-color);
}
.theme-menu.active { display: flex; }
.theme-option {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  text-align: left;
}
.theme-option:hover {
  background: var(--button-bg);
  color: white;
}

/* Main Container */
.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 5rem 1rem 2rem;
  position: relative;
  z-index: 10;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border-radius: 25px;
  padding: 2rem;
  border: 1px solid var(--glass-bg);
  box-shadow: 0 15px 50px var(--shadow-color);
  max-width: 700px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Page Image */
.page-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px var(--shadow-color);
  object-fit: cover;
}

/* Typography */
.typing-text {
  font-family: 'Dancing Script', cursive;
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
  min-height: 3rem;
  text-shadow: 0 0 15px var(--accent-glow);
}
.greeting-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}
.intro-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}
.section-title {
  font-family: 'Dancing Script', cursive;
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px var(--accent-glow);
}

/* Buttons */
.romantic-btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: var(--button-bg);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 5px 20px var(--shadow-color);
  text-decoration: none;
}
.romantic-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px var(--shadow-color);
}

/* Navigation Buttons */
.nav-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.nav-btn {
  padding: 0.6rem 1rem;
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-bg);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-btn:hover {
  background: var(--button-bg);
  color: white;
}
.nav-btn.active {
  background: var(--button-bg);
  color: white;
}

/* Feelings Page */
.feeling-paragraph {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  padding: 1.2rem;
  background: var(--glass-bg);
  border-radius: 15px;
  border-left: 3px solid var(--accent-color);
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}
.feeling-paragraph.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Poetry Page */
.poetry-line {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.8s ease;
  text-shadow: 0 0 8px var(--accent-glow);
}
.poetry-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Questions Page */
.question-card {
  margin-bottom: 1.5rem;
}
.question-text {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.answer-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}
.answer-btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Poppins', sans-serif;
}
.answer-btn.yes { background: linear-gradient(135deg, #4caf50 0%, #81c784 100%); color: white; }
.answer-btn.maybe { background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%); color: white; }
.answer-btn.ofcourse { background: linear-gradient(135deg, #e91e63 0%, #f48fb1 100%); color: white; }
.answer-btn:hover { transform: scale(1.05); }

/* Popup Modal */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.popup-overlay.active { opacity: 1; visibility: visible; }
.popup-content {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  max-width: 350px;
  width: 90%;
  transform: scale(0.9);
  transition: all 0.3s ease;
  border: 1px solid var(--glass-bg);
}
.popup-overlay.active .popup-content { transform: scale(1); }
.popup-heart {
  font-size: 3rem;
  animation: heartbeat 1s ease-in-out infinite;
  margin-bottom: 1rem;
}
.popup-text {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}
.popup-close {
  padding: 0.7rem 1.5rem;
  background: var(--button-bg);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Final Page */
.image-section {
  margin-bottom: 1.5rem;
}
.romantic-image {
  width: 100%;
  max-width: 300px;
  border-radius: 15px;
  box-shadow: 0 10px 30px var(--shadow-color);
}
.image-caption {
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
  color: var(--accent-color);
  margin-top: 0.8rem;
}
.emotional-text {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-primary);
  margin: 1.5rem 0;
  padding: 1.2rem;
  background: var(--glass-bg);
  border-radius: 15px;
}

/* Chat Box */
.chat-container {
  position: fixed;
  bottom: 15px; right: 15px;
  width: 320px;
  max-height: 400px;
  background: var(--bg-secondary);
  border-radius: 15px;
  box-shadow: 0 8px 30px var(--shadow-color);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-bg);
  transition: all 0.3s ease;
}
.chat-container.minimized {
  height: 55px;
  max-height: 55px;
}
.chat-header {
  padding: 0.8rem;
  background: var(--button-bg);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.chat-title { font-size: 0.9rem; font-weight: 500; }
.chat-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}
.chat-messages {
  flex: 1;
  padding: 0.8rem;
  overflow-y: auto;
  max-height: 220px;
}
.chat-message {
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  margin-bottom: 0.6rem;
  max-width: 80%;
  font-size: 0.85rem;
  animation: message-pop 0.3s ease;
}
@keyframes message-pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.chat-message.left {
  background: var(--chat-left);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-message.right {
  background: var(--chat-right);
  color: white;
  align-self: flex-end;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.typing-indicator {
  display: none;
  padding: 0.4rem 0.8rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-style: italic;
}
.typing-indicator.active { display: block; }
.chat-input-area {
  padding: 0.8rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--glass-bg);
}
.chat-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--glass-bg);
  border-radius: 20px;
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  outline: none;
}
.chat-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--button-bg);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* Easter Egg */
.easter-egg {
  position: fixed;
  bottom: 80px; left: 15px;
  padding: 0.8rem 1.2rem;
  background: var(--button-bg);
  color: white;
  border-radius: 12px;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s ease;
  z-index: 400;
  box-shadow: 0 8px 25px var(--shadow-color);
}
.easter-egg.show { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 768px) {
  .navbar { padding: 0.6rem 1rem; }
  .logo { font-size: 1.3rem; }
  .control-btn { width: 36px; height: 36px; font-size: 1rem; }
  .main-container { padding: 4.5rem 0.8rem 1rem; }
  .glass-card { padding: 1.5rem; border-radius: 20px; }
  .typing-text { font-size: 1.6rem; }
  .section-title { font-size: 2rem; }
  .poetry-line { font-size: 1.3rem; }
  .chat-container {
    width: calc(100% - 30px);
    right: 15px; left: 15px;
  }
  .nav-buttons { gap: 0.4rem; }
  .nav-btn { padding: 0.5rem 0.8rem; font-size: 0.8rem; }
  .page-image { max-width: 100%; }
}

@media (max-width: 480px) {
  .typing-text { font-size: 1.4rem; }
  .question-text { font-size: 1.1rem; }
  .answer-buttons { flex-direction: column; align-items: center; }
  .answer-btn { width: 70%; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--glass-bg); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 8px; }

/* Selection */
::selection { background: var(--accent-color); color: white; }

/* Page Transition */
.page-transition { animation: page-fade-in 0.5s ease; }
@keyframes page-fade-in {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Glow Text */
.glow-text { animation: text-glow 2s ease-in-out infinite alternate; }
@keyframes text-glow {
  0% { text-shadow: 0 0 10px var(--accent-glow); }
  100% { text-shadow: 0 0 20px var(--accent-glow); }
}
