/* Site Password Gate Styles - Glowing Star Animation */

/* Gate Overlay */
.site-password-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-dark);
  opacity: 1;
  transition: opacity 0.5s ease;
}

.site-password-gate.fade-out {
  opacity: 0;
}

.gate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(116, 208, 198, 0.1) 0%, rgba(13, 15, 24, 0.95) 70%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Gate Container */
.gate-container {
  position: relative;
  background: linear-gradient(135deg, rgba(25, 27, 42, 0.95) 0%, rgba(13, 15, 24, 0.98) 100%);
  border: 1px solid rgba(116, 208, 198, 0.3);
  border-radius: 20px;
  padding: var(--space-xxl);
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7),
              0 0 40px rgba(116, 208, 198, 0.2);
  z-index: 100000;
  animation: gateFadeIn 0.6s ease-out;
}

@keyframes gateFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.gate-container.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.gate-content {
  position: relative;
  text-align: center;
}

/* Glowing Star Container */
.glowing-star-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Glowing Star */
.glowing-star {
  position: relative;
  width: 120px;
  height: 120px;
  transform-style: preserve-3d;
  animation: starRotate 4s ease-in-out infinite, starPulse 2s ease-in-out infinite;
}

@keyframes starRotate {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) scale(1.1);
  }
  50% {
    transform: rotate(180deg) scale(1);
  }
  75% {
    transform: rotate(270deg) scale(1.1);
  }
}

@keyframes starPulse {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(116, 208, 198, 0.8))
            drop-shadow(0 0 40px rgba(116, 208, 198, 0.6))
            drop-shadow(0 0 60px rgba(116, 208, 198, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(116, 208, 198, 1))
            drop-shadow(0 0 60px rgba(116, 208, 198, 0.8))
            drop-shadow(0 0 90px rgba(116, 208, 198, 0.6));
  }
}

/* Star Core */
.star-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, var(--color-teal-light) 0%, var(--color-teal) 100%);
  border-radius: 50%;
  box-shadow: 0 0 30px var(--color-teal),
              0 0 60px var(--color-teal),
              inset 0 0 20px rgba(255, 255, 255, 0.3);
  animation: corePulse 1.5s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.9;
  }
}

/* Star Points */
.star-point {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-origin: center;
}

.star-point-1 {
  transform: translate(-50%, -50%) translateY(-60px);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-1::after {
  content: '';
  position: absolute;
  top: 20px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-2 {
  transform: translate(-50%, -50%) rotate(72deg) translateY(-60px);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-2::after {
  content: '';
  position: absolute;
  top: 20px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-3 {
  transform: translate(-50%, -50%) rotate(144deg) translateY(-60px);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-3::after {
  content: '';
  position: absolute;
  top: 20px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-4 {
  transform: translate(-50%, -50%) rotate(216deg) translateY(-60px);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-4::after {
  content: '';
  position: absolute;
  top: 20px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-5 {
  transform: translate(-50%, -50%) rotate(288deg) translateY(-60px);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

.star-point-5::after {
  content: '';
  position: absolute;
  top: 20px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 20px solid var(--color-teal);
  filter: drop-shadow(0 0 10px var(--color-teal));
}

/* Star Glow Effect */
.star-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(116, 208, 198, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes glowPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.3;
  }
}

/* Star Particles */
.star-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-teal);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-teal);
  animation: particleFloat 3s ease-in-out infinite;
}

.particle:nth-child(1) {
  top: 10%;
  left: 20%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  top: 20%;
  right: 15%;
  animation-delay: 0.5s;
}

.particle:nth-child(3) {
  bottom: 25%;
  right: 20%;
  animation-delay: 1s;
}

.particle:nth-child(4) {
  bottom: 15%;
  left: 25%;
  animation-delay: 1.5s;
}

.particle:nth-child(5) {
  top: 50%;
  left: 5%;
  animation-delay: 2s;
}

.particle:nth-child(6) {
  top: 60%;
  right: 10%;
  animation-delay: 2.5s;
}

@keyframes particleFloat {
  0%, 100% {
    opacity: 0.3;
    transform: translate(0, 0) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translate(20px, -20px) scale(1.2);
  }
}

/* Gate Title and Description */
.gate-title {
  color: var(--color-white);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-md);
  text-shadow: 0 0 20px rgba(116, 208, 198, 0.5);
}

.gate-description {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
  font-size: 1.1rem;
}

/* Password Form */
.password-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.password-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background-color: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(116, 208, 198, 0.3);
  border-radius: 8px;
  color: var(--color-white);
  font-size: 1rem;
  font-family: var(--font-primary);
  transition: all var(--transition-base);
  min-height: 44px;
}

.password-input:focus {
  outline: none;
  border-color: var(--color-teal);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(116, 208, 198, 0.2),
              0 0 20px rgba(116, 208, 198, 0.3);
}

.password-input.error {
  border-color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.1);
}

.hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: calc(var(--space-xs) * -1);
  text-align: left;
}

.error-message {
  font-size: 0.85rem;
  color: #ff6b6b;
  margin-top: calc(var(--space-xs) * -1);
  min-height: 1.2em;
  text-align: left;
}

.form-actions {
  margin-top: var(--space-md);
  display: flex;
  justify-content: center;
}

.btn-primary {
  background-color: var(--color-teal);
  color: var(--color-dark);
  padding: var(--space-sm) var(--space-xl);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  min-width: 200px;
  min-height: 44px;
  box-shadow: 0 4px 15px rgba(116, 208, 198, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-teal-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(116, 208, 198, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:focus {
  outline: 2px solid var(--color-teal-light);
  outline-offset: 2px;
}

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

.form-status {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  min-height: 1.5em;
}

.form-status.success {
  background-color: rgba(116, 208, 198, 0.2);
  color: var(--color-teal-light);
  border: 1px solid var(--color-teal);
}

/* Success Animation */
.success-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  pointer-events: none;
  animation: successFadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes successFadeIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) translateY(50px);
  }
  60% {
    transform: translate(-50%, -50%) scale(1.1) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
  }
}

.success-star {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: var(--space-lg);
  animation: successStarRotate 1s ease-in-out;
}

@keyframes successStarRotate {
  0% {
    transform: rotate(0deg) scale(0);
  }
  50% {
    transform: rotate(180deg) scale(1.2);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.success-star-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, var(--color-teal-light) 0%, var(--color-teal) 100%);
  border-radius: 50%;
  box-shadow: 0 0 30px var(--color-teal),
              0 0 60px var(--color-teal);
}

.success-sparkles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.success-sparkles .sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--color-teal);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-teal);
}

.success-sparkles .sparkle:nth-child(1) {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: sparkleBurst1 1s ease-out forwards;
  animation-delay: 0.1s;
}

.success-sparkles .sparkle:nth-child(2) {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  animation: sparkleBurst2 1s ease-out forwards;
  animation-delay: 0.2s;
}

.success-sparkles .sparkle:nth-child(3) {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: sparkleBurst3 1s ease-out forwards;
  animation-delay: 0.3s;
}

.success-sparkles .sparkle:nth-child(4) {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  animation: sparkleBurst4 1s ease-out forwards;
  animation-delay: 0.4s;
}

@keyframes sparkleBurst1 {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(30px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(50px) scale(0.5);
  }
}

@keyframes sparkleBurst2 {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(0) scale(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) translateX(-30px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) translateX(-50px) scale(0.5);
  }
}

@keyframes sparkleBurst3 {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-30px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-50px) scale(0.5);
  }
}

@keyframes sparkleBurst4 {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(0) scale(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) translateX(30px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) translateX(50px) scale(0.5);
  }
}

.success-message {
  text-align: center;
  margin-top: var(--space-lg);
  animation: messageFadeIn 0.6s ease-out 0.4s both;
}

@keyframes messageFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-text {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-teal);
  margin: 0;
  text-shadow: 0 0 20px rgba(116, 208, 198, 0.5);
  animation: textPulse 2s ease-in-out infinite;
}

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

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

/* Responsive Design */
@media screen and (max-width: 768px) {
  .gate-container {
    padding: var(--space-xl) var(--space-lg);
    width: 95%;
  }

  .gate-title {
    font-size: 1.75rem;
  }

  .glowing-star-container {
    width: 150px;
    height: 150px;
  }

  .glowing-star {
    width: 90px;
    height: 90px;
  }

  .star-core {
    width: 30px;
    height: 30px;
  }

  .star-point-1,
  .star-point-2,
  .star-point-3,
  .star-point-4,
  .star-point-5 {
    border-left-width: 6px;
    border-right-width: 6px;
    border-bottom-width: 15px;
    transform-origin: center;
  }

  .star-point-1::after,
  .star-point-2::after,
  .star-point-3::after,
  .star-point-4::after,
  .star-point-5::after {
    left: -6px;
    top: 15px;
    border-left-width: 6px;
    border-right-width: 6px;
    border-top-width: 15px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .glowing-star,
  .star-core,
  .star-glow,
  .particle,
  .success-star,
  .success-sparkles .sparkle,
  .success-text {
    animation: none;
  }
  
  .glowing-star {
    transform: rotate(45deg);
  }
  
  .star-core {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .particle {
    opacity: 0.6;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .gate-container {
    border: 2px solid var(--color-white);
  }

  .password-input {
    border: 2px solid var(--color-white);
  }

  .password-input:focus {
    border: 3px solid var(--color-teal);
  }
}

