/* ============================================
   APP LAYOUT — Liquid Glass Shell & Background
   Shared across all authenticated pages
   ============================================ */

/* ============================================
   BODY — App Layout Base
   ============================================ */

body.app-layout {
  font-family: var(--font-heading);
  background: #08080d;
  color: #ffffff;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Kill the design system's body pseudo-element orbs */
body.app-layout::before,
body.app-layout::after {
  display: none;
}

/* ============================================
   BACKGROUND ORBS — Deep Blue Center + Silver Corners
   ============================================ */

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Blue center orb — the hero glow */
.bg-orbs__blue {
  position: absolute;
  width: 700px;
  height: 420px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
      rgba(0, 35, 160, 0.35) 0%,
      rgba(0, 25, 120, 0.20) 35%,
      rgba(0, 18, 80, 0.08) 60%,
      transparent 80%);
  filter: blur(50px);
  border-radius: 50%;
}

/* Silver corner — top-left */
.bg-orbs__silver-tl {
  position: absolute;
  width: 400px;
  height: 400px;
  top: -80px;
  left: -80px;
  background: radial-gradient(circle at center,
      rgba(160, 165, 175, 0.30) 0%,
      rgba(140, 145, 155, 0.12) 40%,
      transparent 70%);
  filter: blur(40px);
  border-radius: 50%;
}

/* Silver corner — bottom-right */
.bg-orbs__silver-br {
  position: absolute;
  width: 400px;
  height: 400px;
  bottom: -80px;
  right: -80px;
  background: radial-gradient(circle at center,
      rgba(160, 165, 175, 0.30) 0%,
      rgba(140, 145, 155, 0.12) 40%,
      transparent 70%);
  filter: blur(40px);
  border-radius: 50%;
}

/* Blue orb slow float animation */
/* ============================================
   LIQUID GLASS SHELL — Apple Liquid Glass
   Ultra-wide, barely-there frosted container
   ============================================ */

.liquid-glass-shell {
  position: relative;
  margin: -0.5rem -1.5rem 0;
  padding: 2.5rem 2rem 3rem;
  border-radius: 32px;

  /* Translucent frosted glass */
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);

  /* Glass edge — brighter top/left, subtler bottom */
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top-color: rgba(255, 255, 255, 0.20);
  border-left-color: rgba(255, 255, 255, 0.10);

  /* Depth */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 16px 64px -12px rgba(0, 0, 0, 0.45),
    0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Top-edge specular line — the Apple glass signature */
.liquid-glass-shell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 4%;
  right: 4%;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.30) 25%,
      rgba(255, 255, 255, 0.50) 50%,
      rgba(255, 255, 255, 0.30) 75%,
      transparent);
  pointer-events: none;
  z-index: 3;
}

/* Inner light wash — soft radial glow from top-left */
.liquid-glass-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background:
    radial-gradient(ellipse 60% 40% at 15% 5%,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 60%),
    radial-gradient(ellipse 40% 30% at 85% 95%,
      rgba(59, 130, 246, 0.03) 0%,
      transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Content above decorative layers */
.liquid-glass-shell > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   FLASH MESSAGE STACK
   ============================================ */

.admin-view-banner {
  align-items: center;
  background: rgba(var(--da-gold-rgb), 0.12);
  border: 1px solid var(--color-border-brand);
  border-radius: 12px;
  color: var(--color-text-primary);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  position: relative;
  z-index: 10;
}

.admin-view-banner__content {
  display: grid;
  gap: 0.15rem;
}

.admin-view-banner__content span {
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
}

.admin-view-banner__form {
  flex: 0 0 auto;
  margin: 0;
}

@media (max-width: 720px) {
  .admin-view-banner {
    align-items: stretch;
    flex-direction: column;
  }
}

.flash-stack {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flash {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  color: rgba(255, 255, 255, 0.9);
  font-weight: var(--fw-medium);
}

.flash--success,
.flash-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

/* Celebration — glass success banner with stronger glow.
   Use flash category 'celebration'; optionally embed the
   .milestone__badge check (rendered inline at 32px). */
.flash--celebration,
.flash-celebration {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0.06) 100%);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-color: rgba(34, 197, 94, 0.45);
  border-top-color: rgba(34, 197, 94, 0.6);
  color: #4ade80;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 28px rgba(34, 197, 94, 0.22);
}

.flash--celebration a,
.flash-celebration a {
  color: inherit;
  text-decoration: underline;
}

.flash--celebration .milestone__badge,
.flash-celebration .milestone__badge {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.3);
}

.flash--celebration .milestone__badge svg,
.flash-celebration .milestone__badge svg {
  width: 16px;
  height: 16px;
}

.flash--error,
.flash--danger,
.flash-error,
.flash-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.flash--warning,
.flash-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.flash--info,
.flash-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.1);
  color: #60a5fa;
}

/* ============================================
   NO-SIDEBAR VARIANT
   ============================================ */

body.app-layout.no-sidebar .app-main {
  margin-left: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .liquid-glass-shell {
    margin: 0 -1rem;
    padding: 1.5rem 1rem 2rem;
    border-radius: 24px;
  }
}

@media (max-width: 480px) {
  .liquid-glass-shell {
    margin: 0 -0.5rem;
    padding: 1rem 0.75rem 1.5rem;
    border-radius: 20px;
  }
}

/* ============================================
   SCROLLBAR — Consistent glass theme
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(var(--da-royal-rgb), 0.6), rgba(var(--da-royal-rgb), 0.6));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(var(--da-royal-rgb), 0.8), rgba(var(--da-royal-rgb), 0.8));
}

/* Flash messages stack */
.flash-stack {
  padding: 1rem 2rem 0;
}
