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

.splash-screen {
  display: none;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease-out;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

.page-loading .splash-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: Inter, Helvetica, 'sans-serif';
  background: linear-gradient(135deg, #f9f9f9 0%, #e8f4f8 100%);
  color: #5e6278;
  line-height: 1;
  font-size: 10px;
  font-weight: 400;
  opacity: 1;
  transform: scale(1);
  animation: splashFadeIn 0.5s ease-out;
}

@keyframes splashFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splashFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}

.splash-screen.fade-out {
  animation: splashFadeOut 0.3s ease-in forwards;
}

/* Loading Container */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

/* Loading Dots Animation */
.loading-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #5e6278;
  animation: dotPulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) {
  animation-delay: -0.32s;
}

.dot:nth-child(2) {
  animation-delay: -0.16s;
}

.dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dotPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Loading Text */
.loading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.loading-message {
  color: #5e6278;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  animation: textFade 2s ease-in-out infinite;
}

.loading-subtitle {
  color: #8b949e;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  animation: textFade 2s ease-in-out infinite 0.5s;
}

@keyframes textFade {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.page-loading .splash-screen img {
  margin-left: calc(100vw - 100%);
  margin-bottom: 30px;
  height: 180px !important;
  width: auto;
  max-width: 300px;
  object-fit: contain;
  opacity: 1;
  transition: all 0.3s ease;
  animation: logoFloat 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.page-loading .splash-screen img:not([src]) {
  opacity: 0;
}

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

html[data-bs-theme='dark'] .page-loading .splash-screen span {
  color: #ffffff;
}

html[data-bs-theme='dark'] .page-loading .splash-screen img {
  filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.1));
}

/* Dark Theme Loading Styles */
html[data-bs-theme='dark'] .dot {
  background-color: #ffffff;
}

html[data-bs-theme='dark'] .loading-message {
  color: #ffffff;
}

html[data-bs-theme='dark'] .loading-subtitle {
  color: #b3b3b3;
}


.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;
}

/* Ensure splash screen is hidden when not loading */
body:not(.page-loading) .splash-screen {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Force splash screen to be on top of everything */
#splash-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 99999 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Welcome Screen */
.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: Inter, Helvetica, 'sans-serif';
  background: linear-gradient(135deg, #f9f9f9 0%, #e8f4f8 100%);
  color: #5e6278;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Welcome Fade Overlay */
.welcome-fade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  transition: opacity 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1;
}

.welcome-screen.show .welcome-fade-overlay {
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.welcome-screen.show.content-visible .welcome-fade-overlay {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.welcome-screen.show.fade-out .welcome-fade-overlay {
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.welcome-container {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
}

.welcome-screen.content-visible .welcome-container {
  opacity: 1;
}

/* Fade Out Effect */
.welcome-screen.fade-out .welcome-fade-overlay {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

.welcome-screen.fade-out .welcome-container {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.welcome-screen.show {
  display: flex;
  opacity: 1;
}


.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 600px;
  padding: 40px;
}

.welcome-logo {
  height: 120px !important;
  width: auto;
  max-width: 250px;
  object-fit: contain;
  margin-bottom: 40px;
  animation: welcomeLogoFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

@keyframes welcomeLogoFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.welcome-content {
  margin-bottom: 40px;
}

.welcome-title {
  font-size: 48px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 16px 0;
  animation: welcomeTitleSlide 0.8s ease-out 0.3s both;
}

.welcome-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: #7f8c8d;
  margin: 0;
  animation: welcomeSubtitleSlide 0.8s ease-out 0.6s both;
}

@keyframes welcomeTitleSlide {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcomeSubtitleSlide {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-dots {
  display: flex;
  gap: 12px;
}

.welcome-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #5e6278;
  animation: welcomeDotPulse 1.6s ease-in-out infinite both;
}

.welcome-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.welcome-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.welcome-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes welcomeDotPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Dark Theme Welcome Screen */
html[data-bs-theme='dark'] .welcome-screen {
  background: linear-gradient(135deg, #151521 0%, #1a1a2e 100%);
  color: #ffffff;
}

html[data-bs-theme='dark'] .welcome-fade-overlay {
  background: #151521;
}

html[data-bs-theme='dark'] .welcome-title {
  color: #ffffff;
}

html[data-bs-theme='dark'] .welcome-subtitle {
  color: #b3b3b3;
}

html[data-bs-theme='dark'] .welcome-dot {
  background-color: #ffffff;
}

html[data-bs-theme='dark'] .welcome-logo {
  filter: drop-shadow(0 6px 12px rgba(255, 255, 255, 0.1));
}

/* Signout Screen */
.signout-screen {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: Inter, Helvetica, 'sans-serif';
  background: linear-gradient(135deg, #f9f9f9 0%, #e8f4f8 100%);
  color: #5e6278;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.signout-screen.show {
  display: flex;
  opacity: 1;
}

/* Signout Fade Overlay */
.signout-fade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 1;
}

.signout-screen.show .signout-fade-overlay {
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.signout-screen.show.content-visible .signout-fade-overlay {
  opacity: 0;
  transition: opacity 1.0s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.signout-screen.show.fade-out .signout-fade-overlay {
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.signout-container {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0.0, 0.2, 1) 0.1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.signout-screen.content-visible .signout-container {
  opacity: 1;
}

.signout-content {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.signout-title {
  font-size: 48px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 16px 0;
  animation: signoutTitleSlide 0.8s ease-out 0.3s both;
}

.signout-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: #7f8c8d;
  margin: 0;
  animation: signoutSubtitleSlide 0.8s ease-out 0.6s both;
}

@keyframes signoutTitleSlide {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes signoutSubtitleSlide {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.signout-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.signout-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #5e6278;
  animation: signoutDotPulse 1.6s ease-in-out infinite both;
}

.signout-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.signout-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.signout-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes signoutDotPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.signout-screen.show.fade-out .signout-container {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Dark Theme Signout Screen */
html[data-bs-theme='dark'] .signout-screen {
  background: linear-gradient(135deg, #151521 0%, #1a1a2e 100%);
  color: #ffffff;
}

html[data-bs-theme='dark'] .signout-fade-overlay {
  background: #151521;
}

html[data-bs-theme='dark'] .signout-title {
  color: #ffffff;
}

html[data-bs-theme='dark'] .signout-subtitle {
  color: #b3b3b3;
}

html[data-bs-theme='dark'] .signout-dot {
  background-color: #ffffff;
}
