/* ============================================
   PREMIUM ENTRANCE PORTAL DESIGN - EXPERT LEVEL
   ============================================ */

.entrance-portal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #1a0509 0%, #000000 100%);
  animation: portalFadeIn 1.2s ease-out;
}

/* Add a subtle nebula glow */
.entrance-portal::before {
  content: "";
  position: absolute;
  width: 150%;
  height: 150%;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 77, 109, 0.05),
      transparent 40%
    ),
    radial-gradient(circle at 70% 70%, rgba(164, 19, 60, 0.05), transparent 40%);
  animation: nebulaMove 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes nebulaMove {
  from {
    transform: translate(-10%, -10%) rotate(0deg);
  }
  to {
    transform: translate(10%, 10%) rotate(5deg);
  }
}

@keyframes portalFadeIn {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* Portal Background with Layered Rotating Rings */
.portal-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  opacity: 0.2;
  box-shadow: 0 0 20px transparent;
  transition: all 0.5s ease;
}

.portal-ring-1 {
  width: 280px;
  height: 280px;
  border-color: rgba(255, 77, 109, 0.6);
  border-width: 2px;
  border-style: dashed;
  animation: ringRotate1 15s linear infinite;
  box-shadow: 0 0 30px rgba(255, 77, 109, 0.2);
}

.portal-ring-2 {
  width: 420px;
  height: 420px;
  border-color: rgba(164, 19, 60, 0.4);
  animation: ringRotate2 12s linear infinite reverse;
}

.portal-ring-3 {
  width: 580px;
  height: 580px;
  border-color: rgba(240, 147, 251, 0.3);
  border-style: double;
  animation: ringRotate3 30s linear infinite;
}

@keyframes ringRotate1 {
  from {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.05);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes ringRotate2 {
  from {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(-180deg) scale(0.95);
  }
  to {
    transform: rotate(-360deg) scale(1);
  }
}

@keyframes ringRotate3 {
  from {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.02);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

.portal-glow {
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(
    circle,
    rgba(255, 77, 109, 0.25),
    transparent 70%
  );
  border-radius: 50%;
  filter: blur(20px);
  animation: glowPulse 5s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.4;
    filter: blur(20px);
  }
  50% {
    transform: scale(1.4);
    opacity: 0.7;
    filter: blur(40px);
  }
}

/* Advanced Particle System (CSS only Drift) */
.portal-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.portal-particle {
  position: absolute;
  bottom: -20px;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.8),
    0 0 15px rgba(240, 147, 251, 0.4);
  animation: particleFloat 7s ease-in infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0) scale(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(-110vh) translateX(calc(var(--random-x, 0) * 150px))
      scale(1.5);
    opacity: 0;
  }
}

/* Floating Orbs */
.portal-orbs {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portal-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  mix-blend-mode: screen;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 77, 109, 0.6), transparent);
  top: 10%;
  left: -5%;
  animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(164, 19, 60, 0.5), transparent);
  top: 50%;
  right: -5%;
  animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(240, 147, 251, 0.4), transparent);
  bottom: 0%;
  left: 30%;
  animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(100px, 100px) scale(1.2);
  }
}

@keyframes orbFloat2 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-80px, -100px) scale(1.1);
  }
}

@keyframes orbFloat3 {
  0%,
  100% {
    transform: translate(0, 0) scale(1.1);
  }
  50% {
    transform: translate(50px, -150px) scale(0.9);
  }
}

/* Welcome Card Container */
.welcome-card-container {
  position: relative;
  z-index: 100;
  perspective: 2000px;
  animation: cardEntrance 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes cardEntrance {
  0% {
    transform: scale(0.8) translateY(100px) rotateX(-20deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0) rotateX(0);
    opacity: 1;
  }
}

.welcome-card {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 40px 32px;
  max-width: 420px;
  text-align: center;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 30px rgba(255, 255, 255, 0.03);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-card:hover {
  transform: translateY(-8px) rotateY(3deg);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Card Icon Section */
.card-icon-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 25px;
}

.card-icon-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  border: 1px solid rgba(255, 77, 109, 0.3);
  border-radius: 50%;
  animation: portalRingPulse 4s ease-in-out infinite;
}

@keyframes portalRingPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.6;
  }
}

.card-icon {
  position: relative;
  font-size: 4rem;
  z-index: 2;
  filter: drop-shadow(0 0 15px rgba(255, 77, 109, 0.5));
  animation: coreHeartFloat 3s ease-in-out infinite;
}

@keyframes coreHeartFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.05);
  }
}

/* Typography Refinement */
.welcome-title {
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 5px;
  animation: trackingIn 1s ease-out;
}

@keyframes trackingIn {
  from {
    letter-spacing: -2px;
    opacity: 0;
  }
  to {
    letter-spacing: 6px;
    opacity: 1;
  }
}

.welcome-subtitle {
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(to bottom, #fff 30%, #ff8fab 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 10px rgba(255, 77, 109, 0.3));
}

.welcome-description {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin-bottom: 45px;
  font-weight: 300;
}

/* Premium Enter Button */
.btn-enter-portal {
  position: relative;
  padding: 18px 45px;
  background: linear-gradient(
    135deg,
    rgba(240, 58, 95, 0.8) 0%,
    rgba(164, 19, 60, 0.8) 100%
  );
  border: none;
  border-radius: 100px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 25px rgba(240, 58, 95, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.btn-enter-portal::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: 0.6s;
}

.btn-enter-portal:hover {
  transform: translateY(-8px) rotate(1deg);
  box-shadow: 0 20px 50px rgba(240, 58, 95, 0.6);
  background: linear-gradient(135deg, #f03a5f 0%, #a4133c 100%);
}

.btn-enter-portal:hover::before {
  left: 100%;
}

.btn-enter-icon {
  font-size: 1.6rem;
  animation: sparkleRotate 2s linear infinite;
}

@keyframes sparkleRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.3);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.portal-info-integrated {
  margin: 20px 0 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portal-time {
  font-family: "Montserrat", sans-serif;
  font-size: 2.2rem;
  font-weight: 200;
  color: #fff;
  letter-spacing: 6px;
  margin-bottom: 3px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 600;
}

/* Morphing Exit Animation on Portal Click */
.entrance-portal.portal-morphing {
  pointer-events: none;
}

.entrance-portal.portal-morphing .welcome-card {
  transform: scale(3) rotate(10deg);
  opacity: 0;
  filter: blur(20px);
}

.entrance-portal.portal-morphing .portal-bg {
  transform: scale(5);
  opacity: 0;
  filter: brightness(2);
}

/* Expert Responsive Tuning */
@media (max-width: 768px) {
  .welcome-card {
    margin: 0 20px;
    padding: 45px 30px;
  }

  .welcome-subtitle {
    font-size: 2.5rem;
  }

  .portal-time {
    font-size: 2rem;
  }

  .portal-ring-1 {
    width: 220px;
    height: 220px;
  }
  .portal-ring-2 {
    width: 340px;
    height: 340px;
  }
  .portal-ring-3 {
    width: 480px;
    height: 480px;
  }
}

/* Desktop Specific Enhancements - PREMIUM LEVEL */
@media (min-width: 1024px) {
  .welcome-card-container {
    transform: rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
    transition: transform 0.1s ease-out;
  }

  .welcome-card {
    max-width: 440px;
    padding: 50px 40px;
    border-width: 1.5px;
  }

  .welcome-subtitle {
    font-size: 3.5rem;
    margin-bottom: 25px;
  }

  .welcome-title {
    font-size: 1.1rem;
    letter-spacing: 8px;
  }

  .welcome-description {
    font-size: 1.1rem;
  }

  .btn-enter-portal {
    max-width: 320px;
    margin: 0 auto;
    font-size: 1.2rem;
    padding: 20px 50px;
  }

  /* Extra decorative elements for desktop */
  .portal-particles {
    perspective: 1000px;
  }

  .portal-particle {
    width: 4px;
    height: 4px;
  }

  .portal-time {
    font-size: 2.8rem;
    letter-spacing: 10px;
  }

  .portal-date {
    font-size: 0.85rem;
    letter-spacing: 6px;
  }

  /* Subtle Scanline Effect */
  .entrance-portal::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      to bottom,
      transparent 50%,
      rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.1;
  }
}

/* 3D Parallax Layers */
.portal-bg {
  transform: translateZ(calc(var(--move-y, 0) * -1px))
    rotateX(calc(var(--move-y, 0) * 0.02deg))
    rotateY(calc(var(--move-x, 0) * 0.02deg));
  transition: transform 0.2s ease-out;
}
