/* Modern, sleek loader animation styles */

.app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #000000;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.app-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Circular loader animation */
.loader-circle {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 30px;
}

.loader-circle-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #293441;
  position: absolute;
}

.loader-circle-fill {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: #2dd4bf;
  border-left-color: #2dd4bf;
  position: absolute;
  animation: loader-spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

@keyframes loader-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Name display */
.loader-name {
  font-size: 28px;
  font-weight: 600;
  color: #2dd4bf;
  margin-bottom: 15px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.02em;
}

/* Progress bar */
.loader-progress-bar {
  width: 240px;
  height: 4px;
  background: linear-gradient(90deg, #2dd4bf 0%, #3b82f6 100%);
  border-radius: 2px;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
}

.loader-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  animation: loader-shimmer 1.8s infinite;
}

@keyframes loader-shimmer {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(200%);
  }
}

/* Video Frame Loader */
.video-frame-loader {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.video-frame-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.video-frame-loader .loader-circle {
  width: 30px;
  height: 30px;
  margin-bottom: 0;
}

.video-frame-loader .loader-circle-ring {
  border-width: 2px;
}

.video-frame-loader .loader-circle-fill {
  border-width: 2px;
}

/* Loading text */
.loader-text {
  font-size: 16px;
  color: #8e9bae;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
}

/* Dots container for the animation */
.dots-container {
  display: inline-block;
  position: relative;
  margin-left: 4px;
  width: 24px;
  height: 16px;
  overflow: hidden;
  text-align: left;
  direction: ltr !important;
  unicode-bidi: isolate;
}

/* Remove RTL-specific alignment for dots container */
html.rtl .dots-container {
  text-align: left;
  margin-left: 4px;
  margin-right: 0;
  direction: ltr !important;
  unicode-bidi: isolate;
}

/* Individual dots that will be animated */
.dot {
  position: absolute;
  opacity: 0;
  font-size: 20px;
  line-height: 10px;
  animation: dot-appear 2s infinite;
}

/* Position each dot (Default LTR) */
.dot:nth-child(1) { left: 0; animation-delay: 0s; }
.dot:nth-child(2) { left: 8px; animation-delay: 0.3s; }
.dot:nth-child(3) { left: 16px; animation-delay: 0.6s; }

/* RTL specific positioning for dots */
/* REMOVE these rules to prevent any RTL flipping of dot order */

@keyframes dot-appear {
  0%, 10% { opacity: 0; transform: translateY(5px); }
  30%, 70% { opacity: 1; transform: translateY(0); }
  90%, 100% { opacity: 0; transform: translateY(5px); }
}
