/**
 * ============================================================================
 * Copyright (c) 2026 BAWASLU-M FH ULM. All Rights Reserved.
 * Badan Pengawas Pemilihan Umum Mahasiswa
 * Fakultas Hukum, Universitas Lambung Mangkurat
 *
 * PROPRIETARY & CONFIDENTIAL SOURCE CODE
 * ----------------------------------------------------------------------------
 * This software, web application, source code, scripts, styles, architecture,
 * and associated assets are the exclusive intellectual property of BAWASLU-M FH ULM.
 *
 * Any unauthorized copying, reproduction, distribution, scraping, decompilation,
 * reverse engineering, modification, or appropriation of this source code,
 * in whole or in part, is strictly prohibited and deemed highly unethical under
 * institutional, academic, and applicable intellectual property legal frameworks.
 * ============================================================================
 */

.cinematic-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #050805;
  background-image:
    radial-gradient(ellipse 650px 480px at 50% 46%, rgba(35, 48, 35, 0.38) 0%, rgba(7, 10, 7, 0.9) 65%, #030503 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.012) 0%, transparent 45%, rgba(0, 0, 0, 0.5) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
  user-select: none;
  cursor: default;
  opacity: 1;
  transform: scale(1);
  will-change: opacity, transform;
  transition: opacity 1.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 1.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cinematic-preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.96);
  pointer-events: none;
}

.preloader-center-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  text-align: center;
  max-width: 480px;
}

.preloader-logo-wrap {
  position: relative;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-logo {
  width: 125px;
  height: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 25px rgba(107, 128, 104, 0.3));
  animation:
    dramaticLogoReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards,
    dramaticLogoPulse 4s 1.2s ease-in-out infinite alternate;
}

@keyframes dramaticLogoReveal {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
    filter: brightness(0.2) drop-shadow(0 0 0px rgba(0, 0, 0, 0));
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: brightness(1) drop-shadow(0 15px 35px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 25px rgba(107, 128, 104, 0.3));
  }
}

@keyframes dramaticLogoPulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 20px rgba(107, 128, 104, 0.25));
  }
  100% {
    transform: scale(1.03);
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.98)) drop-shadow(0 0 38px rgba(143, 163, 140, 0.5));
  }
}

.preloader-slogan-wrap {
  margin-bottom: 2.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.preloader-slogan {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: lowercase;
  color: #DDE9DC;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  line-height: 1.25em;
  padding: 0.12em 0;
  text-shadow: 0 0 14px rgba(162, 196, 159, 0.5), 0 0 35px rgba(107, 128, 104, 0.25);
  animation: sloganAuraGlow 3.5s ease-in-out infinite alternate;
  user-select: none;
  cursor: default;
}

.preloader-slogan.rolling-letters-slot .char {
  display: inline-block;
  will-change: transform;
}

@keyframes sloganAuraGlow {
  0% {
    opacity: 0.85;
    text-shadow: 0 0 10px rgba(162, 196, 159, 0.35);
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 22px rgba(162, 196, 159, 0.75), 0 0 45px rgba(107, 128, 104, 0.45);
  }
}

@keyframes eyeBlinkSlow {
  0%, 94%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

.preloader-progress-wrap {
  width: 190px;
  opacity: 0;
  animation: beamFadeIn 0.8s 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.preloader-progress-track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8);
}

.preloader-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(107, 128, 104, 0.2) 0%, #8FA38C 50%, #FFFFFF 100%);
  box-shadow: 0 0 10px rgba(162, 196, 159, 0.9), 0 0 20px rgba(107, 128, 104, 0.6);
  border-radius: 99px;
  transition: width 0.12s ease-out;
}

@keyframes beamFadeIn {
  from {
    opacity: 0;
    transform: scaleX(0.7);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.preloader-skip-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: rgba(143, 163, 140, 0.45);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  z-index: 20;
  transition: all var(--transition-fast);
}

.preloader-skip-btn:hover {
  color: #A2C49F;
  letter-spacing: 0.22em;
}

.cinematic-preloader.is-dismissed {
  opacity: 0 !important;
  transform: scale(1.025) !important;
  pointer-events: none !important;
}

.cinematic-preloader.is-dismissed .preloader-center-stage {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
  .preloader-logo {
    width: 105px;
  }
  .preloader-slogan {
    font-size: 0.95rem;
    letter-spacing: 0.22em;
  }
  .preloader-progress-wrap {
    width: 160px;
  }
}

@media (max-width: 360px) {
  .preloader-slogan {
    font-size: 0.82rem;
    letter-spacing: 0.16em;
  }
}
