/* /kernel/app/components/loading-layer/loadingLayer.css */

#itui-loading-layer.itui-loading {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(4px);
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity .25s ease;
    opacity: 0;
    pointer-events: none;
}

#itui-loading-layer.visible {
    opacity: 1;
    pointer-events: all;
}

#itui-loading-layer.hidden {
    display: none;
}

.itui-loading-content {
    text-align: center;
    color: #fff;
    font-family: var(--itui-font-primary);
    position: relative;
}

/* Spinner */
.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px auto;
}

@keyframes spin {
    from { transform: rotate(0deg);}
    to { transform: rotate(360deg);}
}

/* Result icons */
.loading-result {
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) scale(0);
    transition: 0.25s ease;
    opacity: 0;
}

.itui-loading.success .success {
    color: #00ff99;
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.itui-loading.error .error {
    color: #ff4d4d;
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

@import url("https://kernel.itui.app/css/global/toast.css");

#itui-app {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;

  display: flex;
  overflow-y: auto;

  opacity: 0;
  transform: scale(1);
  pointer-events: none;

  transition: opacity 280ms ease, transform 280ms ease;
}

#itui-app.visible {
  opacity: 1;
  pointer-events: auto;
}

#itui-app.visible.itui-toast-active {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
}

.itui-loader-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 90%;
}

html.dark-mode .itui-loading-screen {
  background: #282828;
}

.itui-loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f5f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
  pointer-events: all;
}

.itui-loader {
  font-size: 55px;
  font-weight: bold;
  font-family: 'Inter', sans-serif;
  color: rgb(17, 17, 17);
  display: flex;
  gap: 12px;
  align-content: center;
  text-align: center;
  display: flex;
  position: relative;
  vertical-align: middle;
}

html.dark-mode .itui-loader {
  color: rgb(255, 255, 255);
}


@keyframes pulseBG {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.2; }
}

.itui-loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 2.5s ease;
}

.itui-loader span {
  animation: glowFade 1.2s ease-in-out infinite;
  opacity: 0.3;
}

.itui-loader span:nth-child(1) { animation-delay: 0s; }
.itui-loader span:nth-child(2) { animation-delay: 0.2s; }
.itui-loader span:nth-child(3) { animation-delay: 0.4s; }
.itui-loader span:nth-child(4) { animation-delay: 0.6s; }

@keyframes glowFade {
  0%, 100% { opacity: 0.3; text-shadow: 0 0 0px transparent; }
  50% { opacity: 1; text-shadow: 0 0 10px #ffffff; }
}

#itui-error-message {
  opacity: 0;
  animation: fadeInError 1.6s ease 0.4s forwards;
  color: #343434;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  white-space: pre-wrap;
  text-align: center;
  align-items: center;
  max-width: 420px;
  min-height: 111px;
  line-height: 1.6;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

html.dark-mode #itui-error-message {
  color: #ffffff;
}

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

html.dark-mode #itui-transition-layer {
  background: rgba(0,0,0,1); /* or transparent black */
}

#itui-transition-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: rgb(255, 255, 255); /* or transparent black */
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms linear;
}


#itui-transition-layer.active {
  opacity: 1;
}

html.dark-mode,
html.dark-mode body {
  margin: 0;
  padding: 0;
  background: #02010d;
}

html, body {
  background: #ffffff; /* dark-mode safe default */
}

/* Default: nothing flashes */
[data-itui-structure],
[data-itui-component] {
  opacity: 0;
}