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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #1a202c;
  overflow-x: hidden;
  position: relative;
}

/* ================= Animated Background ================= */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 138, 101, 0.3), transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(138, 180, 248, 0.3), transparent 50%);
  animation: backgroundShift 15s ease infinite;
  z-index: -1;
}

@keyframes backgroundShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ====================== Header ====================== */
.fixed-header {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  color: #667eea;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  z-index: 1000;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  letter-spacing: -0.5px;
}

.fixed-header.signed-in {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  color: white;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5);
}

/* ====================== Profile Menu ====================== */
.profile-menu {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1001;
}

.profile-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  font-weight: 600;
}

.profile-icon:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

/* Dropdown base style */
.dropdown {
  position: absolute;
  top: 60px;
  right: 0;
  width: 220px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.3s ease;
}

.dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown ul li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown ul li:last-child {
  border-bottom: none;
}

.dropdown ul li a {
  display: block;
  text-decoration: none;
  color: #2d3748;
  padding: 14px 20px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border-radius: 12px;
}

.dropdown ul li a:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.dropdown.show ul li {
  animation: fadeSlideIn 0.25s ease forwards;
}

@keyframes fadeSlideIn {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ====================== Top Navigation ====================== */
.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 100px auto 40px;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  width: fit-content;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.top-nav a {
  text-decoration: none;
  color: #2d3748;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 1rem;
}

.top-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.top-nav a:hover {
  color: #667eea;
}

.top-nav a:hover::after {
  width: 80%;
}

/* ====================== Welcome Section ====================== */
.welcome-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  text-align: center;
  padding: 40px 20px;
  animation: fadeInUp 0.8s ease;
  position: relative;
}

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

.welcome-container h1 {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  letter-spacing: -2px;
}

.welcome-container p {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 3rem;
  max-width: 600px;
  font-weight: 500;
  line-height: 1.6;
}

.cta-button {
  background: white;
  color: #667eea;
  border: none;
  padding: 18px 48px;
  font-size: 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: left 0.5s ease;
  z-index: -1;
}

.cta-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  color: white;
}

.cta-button:hover::before {
  left: 0;
}

.cta-button:active {
  transform: translateY(-2px);
}

/* ====================== FAQ Section ====================== */
#faq {
  max-width: 900px;
  margin: 60px auto 100px;
  padding: 0 20px;
}

#faq h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 3rem;
  font-weight: 800;
  text-align: center;
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.faq-item {
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  backdrop-filter: blur(20px);
}

.faq-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.faq-question {
  width: 100%;
  padding: 24px 28px;
  background: none;
  border: none;
  text-align: left;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.faq-question:hover {
  color: #667eea;
}

.faq-question span {
  font-size: 1.8rem;
  font-weight: 300;
  color: #667eea;
  transition: transform 0.3s ease;
}

.faq-question.active span {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 28px;
  background: rgba(248, 250, 255, 0.5);
  transition: all 0.4s ease;
}

.faq-answer.active {
  padding: 24px 28px;
  max-height: 500px;
}

.faq-answer p {
  margin: 0;
  color: #4a5568;
  line-height: 1.8;
  font-size: 1.05rem;
}

/* ====================== Modal ====================== */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10002;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

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

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(92vw, 480px);
  background: white;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  animation: modalSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card h3 {
  margin: 0 0 12px 0;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-card p {
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-btn {
  flex: 1;
  min-width: 140px;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.modal-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.modal-btn-secondary {
  background: #f7fafc;
  color: #4a5568;
  border: 2px solid #e2e8f0;
}

.modal-btn-secondary:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

/* ====================== Signed-in Glow Effect ====================== */
body.signed-in::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 70%);
  animation: rotateGlow 20s linear infinite;
  z-index: -1;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ====================== Responsive ====================== */
@media (max-width: 768px) {
  .top-nav {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-btn {
    min-width: 100%;
  }

  .fixed-header {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  .profile-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}
