/* LOADING SCREEN STYLES */

.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f4c2e 0%, #1c6b3e 50%, #1f7a44 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
  animation: fadeOutLoading 0.5s ease-in-out 2.5s forwards;
}

@keyframes fadeOutLoading {
  from {
    opacity: 1;
    visibility: visible;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.loading-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.loading-text {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 3px;
  font-family: 'Poppins', sans-serif;
  margin: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.loading-char {
  display: inline-block;
  animation: waveBubble 1.2s ease-in-out infinite;
  transform-origin: center bottom;
  margin: 0 2px;
}

/* Stagger animation untuk setiap huruf */
.loading-char:nth-child(1) { animation-delay: 0s; }
.loading-char:nth-child(2) { animation-delay: 0.1s; }
.loading-char:nth-child(3) { animation-delay: 0.2s; }
.loading-char:nth-child(4) { animation-delay: 0.3s; }
.loading-char:nth-child(5) { animation-delay: 0.4s; }
.loading-char:nth-child(6) { animation-delay: 0.5s; }
.loading-char:nth-child(7) { animation-delay: 0.6s; }
.loading-char:nth-child(8) { animation-delay: 0.7s; }
.loading-char:nth-child(9) { animation-delay: 0.8s; }
.loading-char:nth-child(10) { animation-delay: 0.9s; }
.loading-char:nth-child(11) { animation-delay: 1s; }
.loading-char:nth-child(12) { animation-delay: 1.1s; }
.loading-char:nth-child(13) { animation-delay: 1.2s; }
.loading-char:nth-child(14) { animation-delay: 1.3s; }
.loading-char:nth-child(15) { animation-delay: 1.4s; }
.loading-char:nth-child(16) { animation-delay: 1.5s; }
.loading-char:nth-child(17) { animation-delay: 1.6s; }
.loading-char:nth-child(18) { animation-delay: 1.7s; }
.loading-char:nth-child(19) { animation-delay: 1.8s; }
.loading-char:nth-child(20) { animation-delay: 1.9s; }
.loading-char:nth-child(21) { animation-delay: 2s; }
.loading-char:nth-child(22) { animation-delay: 2.1s; }
.loading-char:nth-child(23) { animation-delay: 2.2s; }
.loading-char:nth-child(24) { animation-delay: 2.3s; }
.loading-char:nth-child(25) { animation-delay: 2.4s; }

/* Wave bubble animation */
@keyframes waveBubble {
  0% {
    transform: translateY(0px) scale(1);
    opacity: 0.6;
  }
  25% {
    transform: translateY(-15px) scale(1.1);
    opacity: 1;
  }
  50% {
    transform: translateY(0px) scale(1);
    opacity: 1;
  }
  75% {
    transform: translateY(-8px) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translateY(0px) scale(1);
    opacity: 0.6;
  }
}

/* Background animated elements */
.loading-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  overflow: hidden;
}

.bubble {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  animation: float 6s infinite ease-in-out;
}

.bubble:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.bubble:nth-child(2) {
  width: 120px;
  height: 120px;
  top: 60%;
  right: 10%;
  animation-delay: 2s;
}

.bubble:nth-child(3) {
  width: 60px;
  height: 60px;
  bottom: 20%;
  left: 50%;
  animation-delay: 4s;
}

.bubble:nth-child(4) {
  width: 100px;
  height: 100px;
  top: 30%;
  right: 20%;
  animation-delay: 1s;
}

.bubble:nth-child(5) {
  width: 70px;
  height: 70px;
  bottom: 10%;
  right: 30%;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
  }
  25% {
    transform: translateY(-30px) translateX(20px);
  }
  50% {
    transform: translateY(-50px) translateX(-20px);
  }
  75% {
    transform: translateY(-20px) translateX(30px);
  }
}

/* Loading tagline */
.loading-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 24px;
  letter-spacing: 1px;
  animation: fadeInUp 1s ease-out 0.5s forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading dots */
.loading-dots {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  animation: pulse 1.4s infinite;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .loading-text {
    font-size: 36px;
    height: 50px;
  }

  .loading-tagline {
    font-size: 12px;
  }

  .loading-char {
    margin: 0 1px;
  }

  .bubble {
    opacity: 0.03;
  }
}

@media (max-width: 480px) {
  .loading-text {
    font-size: 24px;
    height: 40px;
    letter-spacing: 2px;
  }

  .loading-tagline {
    font-size: 11px;
  }

  .loading-dots {
    margin-top: 24px;
  }
}
/* ==========================================
   MOBILE RESPONSIVE FIX
   TANPA MENGUBAH CLASS / STRUKTUR HTML
========================================== */

/* Tablet */
@media (max-width:768px){

  .loading-container{
    padding:20px;
    min-height:100vh;
    overflow:hidden;
  }

  .loading-content{
    width:100%;
    max-width:420px;
    margin:auto;
  }

  .loading-text{
    width:100%;
    font-size:34px;
    line-height:1.2;
    height:auto;
    letter-spacing:2px;
    flex-wrap:wrap;
    text-align:center;
    overflow-wrap:break-word;
    word-break:break-word;
  }

  .loading-char{
    margin:0 1px;
  }

  .loading-tagline{
    margin-top:18px;
    font-size:13px;
    padding:0 10px;
    line-height:1.5;
  }

  .loading-dots{
    margin-top:24px;
  }

  .bubble{
    transform:scale(.75);
    opacity:.03;
  }

}

/* Mobile */
@media (max-width:480px){

  .loading-container{
    padding:16px;
  }

  .loading-content{
    width:100%;
    max-width:100%;
  }

  .loading-text{
    font-size:24px;
    letter-spacing:1px;
    height:auto;
    min-height:40px;
    flex-wrap:wrap;
    justify-content:center;
  }

  .loading-tagline{
    font-size:11px;
    line-height:1.5;
    margin-top:16px;
    padding:0 8px;
  }

  .loading-dots{
    gap:6px;
    margin-top:20px;
  }

  .dot{
    width:8px;
    height:8px;
  }

  .bubble{
    transform:scale(.55);
    opacity:.02;
  }

}

/* HP sangat kecil */
@media (max-width:360px){

  .loading-text{
    font-size:20px;
    letter-spacing:.5px;
  }

  .loading-tagline{
    font-size:10px;
  }

  .loading-dots{
    margin-top:18px;
  }

}