/* =============================================================
   ETAPA VISUAL 11 — PWA & APP EXPERIENCE
   AuroraTechno Academy / Dev Invisível™
   ============================================================= */

/* ── SAFE AREA ── */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  overscroll-behavior-y: none; /* Previne pull-to-refresh em mobile */
}

/* ── SPLASH SCREEN PREMIUM ── */
#app-splash {
  position: fixed;
  inset: 0;
  background: #02030a;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

#app-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  animation: splashIn 0.8s ease-out;
}

@keyframes splashIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.splash-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.4));
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.4)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 35px rgba(0, 217, 255, 0.6)); }
}

.splash-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.splash-loader {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1px;
  overflow: hidden;
  margin: 20px auto 0;
}

.splash-loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 10px var(--cyan);
  animation: loaderFill 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes loaderFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ── TRANSIÇÕES DE PÁGINA ── */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: #02030a;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.page-transition-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ── FEEDBACK DE CONEXÃO ── */
#conn-status {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  z-index: 9000;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#conn-status.visible {
  transform: translateX(-50%) translateY(0);
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.conn-online .conn-dot { background: #00ff88; box-shadow: 0 0 8px #00ff88; }
.conn-offline .conn-dot { background: #ff3366; box-shadow: 0 0 8px #ff3366; }
.conn-reconnecting .conn-dot { background: #ffcc00; box-shadow: 0 0 8px #ffcc00; animation: pulse 1s infinite; }

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* ── SKELETON LOADING ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
  to { background-position: -200% 0; }
}

/* ── MELHORIAS MOBILE ── */
@media (max-width: 768px) {
  .dashboard-sidebar {
    padding-top: calc(24px + var(--safe-top));
  }
  
  .dashboard-logout {
    padding-bottom: calc(24px + var(--safe-bottom));
  }
}
