html {
  font-size: 13px;
  font-weight: 400;
  font-family: Inter,Helvetica,sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.page-loading {
  margin: 0;
  height: 100%;
  overflow: hidden;
  transition: none !important;
}

.splash-screen {
  display: none;
}

.page-loading .splash-screen {
  position: fixed;
  z-index: 99999;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: 'vazir', Inter, Helvetica, 'sans-serif';
  background: linear-gradient(135deg, #0a1628 0%, #0d2137 50%, #0f2847 100%);
  position: relative;
  overflow: hidden;
}

/* Animated background orbs */
.page-loading .splash-screen::before,
.page-loading .splash-screen::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 8s ease-in-out infinite;
  z-index: 0;
}

.page-loading .splash-screen::before {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #f5a623 0%, #f7c948 100%);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.page-loading .splash-screen::after {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, #1e88e5 0%, #42a5f5 100%);
  bottom: -80px;
  left: -80px;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -30px) scale(1.1);
  }
}

html[data-bs-theme='dark'] .page-loading .splash-screen {
  background: linear-gradient(135deg, #0a1628 0%, #0d2137 50%, #0f2847 100%);
  color: #ffffff;
}

html[data-bs-theme='light'] .page-loading .splash-screen {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
}

html[data-bs-theme='light'] .page-loading .splash-screen::before {
  background: linear-gradient(135deg, #ffc107 0%, #ffd54f 100%);
}

html[data-bs-theme='light'] .page-loading .splash-screen::after {
  background: linear-gradient(135deg, #2196f3 0%, #64b5f6 100%);
}

/* Logo container with glassmorphism */
.splash-screen .logo-container {
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

html[data-bs-theme='light'] .splash-screen .logo-container {
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  }
}

.splash-screen img {
  position: relative;
  z-index: 2;
  height: 120px;
  width: auto;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-screen .dark-logo {
  display: none;
}

.splash-screen .light-logo {
  display: block;
}

html[data-bs-theme='dark'] .splash-screen .light-logo {
  display: none;
}

html[data-bs-theme='dark'] .splash-screen .dark-logo {
  display: block;
}

/* Modern loader wrapper */
.loader-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.6s ease-out 0.3s both;
}

html[data-bs-theme='light'] .loader-wrapper {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-loading .splash-screen .loading-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: 'vazir', inherit;
}

html[data-bs-theme='light'] .page-loading .splash-screen .loading-text {
  color: rgba(0, 0, 0, 0.85);
}

/* Modern loader spinner */
.loader {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid transparent;
  border-top-color: #f5a623;
  border-right-color: #1e88e5;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 0.8s linear infinite;
  position: relative;
}

.loader::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5a623 0%, #1e88e5 100%);
  animation: pulseDot 1.5s ease-in-out infinite;
}

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

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

html[data-bs-theme='light'] .loader {
  border-top-color: #ffc107;
  border-right-color: #2196f3;
}

html[data-bs-theme='light'] .loader::before {
  background: linear-gradient(135deg, #ffc107 0%, #2196f3 100%);
}
