/* Loading Overlay */

/* Loading backdrop to hide everything */
.loading-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s ease-out;
}

.loading-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Main loading container */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  margin: 0;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  transform: translate3d(0,0,0);
  -webkit-transform: translate3d(0,0,0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

html.loading,
body.loading {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

.loading-container.active {
  display: flex;
}

.loading-icon {
  perspective: 1000px;
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-icon img {
  width: 80px;
  height: auto;
  z-index: 2;
  position: absolute;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-icon img.active {
  transform: rotateY(0deg);
}

.loading-circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, #b71111 35%, #b71111 65%, transparent 100%);
  animation: spin 2s linear infinite;
}

.loading-circle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--bg-color);
  border-radius: 50%;
}

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

@keyframes pulse-love {
  0% { transform: scale(1); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.pulse-love {
  animation: pulse-love 1.3s infinite cubic-bezier(0.4,0,0.2,1);
}
