/**
 * Blue Beach God Mode — Premium Glassmorphic Enhancement Layer
 * Loaded after design-system.css on all app pages.
 * Enhances existing elements with glassmorphism, animations, and premium feel.
 * Does NOT override functional styles — purely visual enhancement.
 */

/* ══════════════════════════════════════════════
   ── GLASSMORPHIC UTILITIES ──
   ══════════════════════════════════════════════ */

.glass {
  background: rgba(15,20,35,.55);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
}
.glass-subtle {
  background: rgba(15,20,35,.35);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
}
.glass-card {
  background: rgba(15,20,35,.45);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
}

/* ══════════════════════════════════════════════
   ── AMBIENT BACKGROUND ──
   ══════════════════════════════════════════════ */

body::before {
  content: '';
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(59,130,246,.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 70%, rgba(129,140,248,.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(16,185,129,.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Ensure main content is above ambient */
#app-view, .main-wrap, .app-body, .email-layout, .hub-content {
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════
   ── KEYFRAME ANIMATIONS ──
   ══════════════════════════════════════════════ */

@keyframes gm-fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gm-fadeSlideRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes gm-scaleIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes gm-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes gm-pulseGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(59,130,246,.2); }
  50%      { box-shadow: 0 0 16px rgba(59,130,246,.4); }
}
@keyframes gm-gradientMove {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ══════════════════════════════════════════════
   ── ENHANCED SCROLLBAR ──
   ══════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.16); }

/* ══════════════════════════════════════════════
   ── ENHANCED SIDEBAR / NAV ──
   ══════════════════════════════════════════════ */

.sidebar, .nav-sidebar, .side-nav {
  background: rgba(11,16,25,.75) !important;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-right: 1px solid rgba(255,255,255,.05) !important;
}

/* ══════════════════════════════════════════════
   ── ENHANCED CARDS ──
   ══════════════════════════════════════════════ */

.card, .stat-card, .project-card, .task-card {
  background: rgba(17,24,39,.6) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.06) !important;
  transition: all .25s cubic-bezier(.4,0,.2,1) !important;
}
.card:hover, .stat-card:hover, .project-card:hover, .task-card:hover {
  border-color: rgba(255,255,255,.12) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.3), 0 0 0 1px rgba(59,130,246,.08);
}

/* ── Stagger animation for cards ── */
.cards-grid > *:nth-child(1) { animation: gm-fadeSlideUp .4s ease both; animation-delay: .05s; }
.cards-grid > *:nth-child(2) { animation: gm-fadeSlideUp .4s ease both; animation-delay: .1s; }
.cards-grid > *:nth-child(3) { animation: gm-fadeSlideUp .4s ease both; animation-delay: .15s; }
.cards-grid > *:nth-child(4) { animation: gm-fadeSlideUp .4s ease both; animation-delay: .2s; }
.cards-grid > *:nth-child(5) { animation: gm-fadeSlideUp .4s ease both; animation-delay: .25s; }
.cards-grid > *:nth-child(6) { animation: gm-fadeSlideUp .4s ease both; animation-delay: .3s; }
.cards-grid > *:nth-child(n+7) { animation: gm-fadeSlideUp .4s ease both; animation-delay: .35s; }

/* ══════════════════════════════════════════════
   ── ENHANCED BUTTONS ──
   ══════════════════════════════════════════════ */

.btn-primary, .login-btn {
  background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
  box-shadow: 0 2px 12px rgba(59,130,246,.25);
  transition: all .2s ease !important;
}
.btn-primary:hover, .login-btn:hover {
  box-shadow: 0 4px 20px rgba(59,130,246,.4);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════
   ── ENHANCED MODALS ──
   ══════════════════════════════════════════════ */

.modal-body, .modal-content, .modal-card {
  background: rgba(15,20,35,.85) !important;
  backdrop-filter: blur(32px) saturate(1.5);
  -webkit-backdrop-filter: blur(32px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.08) !important;
  animation: gm-scaleIn .25s ease;
}
.modal-overlay, .modal-backdrop {
  background: rgba(0,0,0,.6) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════════
   ── ENHANCED TABLES ──
   ══════════════════════════════════════════════ */

table, .data-table {
  background: rgba(15,20,35,.3);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
thead th, .table-header {
  background: rgba(15,20,35,.5) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
}
tbody tr {
  transition: background .15s ease;
}
tbody tr:hover {
  background: rgba(59,130,246,.04) !important;
}

/* ══════════════════════════════════════════════
   ── ENHANCED BADGES ──
   ══════════════════════════════════════════════ */

.badge {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .15s ease;
}
.badge:hover {
  transform: scale(1.05);
}

/* ══════════════════════════════════════════════
   ── ENHANCED INPUTS ──
   ══════════════════════════════════════════════ */

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.toolbar-search:focus,
.search-wrap input:focus {
  border-color: rgba(59,130,246,.5) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.1), 0 0 12px rgba(59,130,246,.08);
}

/* ══════════════════════════════════════════════
   ── ENHANCED TABS ──
   ══════════════════════════════════════════════ */

.hub-tabs, .page-tabs, .tab-bar {
  background: rgba(11,16,25,.5) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hub-tab.active, .page-tab.active, .tab-btn.active {
  position: relative;
}
.hub-tab.active::after, .tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
}

/* ══════════════════════════════════════════════
   ── ENHANCED PROGRESS BARS ──
   ══════════════════════════════════════════════ */

.progress-fill {
  background: linear-gradient(90deg, var(--green), #34d399) !important;
  box-shadow: 0 0 8px rgba(16,185,129,.3);
}

/* ══════════════════════════════════════════════
   ── ENHANCED NOTIFICATIONS / TOASTS ──
   ══════════════════════════════════════════════ */

.toast, .notification, .alert {
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.08);
  animation: gm-fadeSlideRight .3s ease;
}

/* ══════════════════════════════════════════════
   ── PREMIUM LOGIN CARD ──
   ══════════════════════════════════════════════ */

.login-card {
  background: rgba(17,24,39,.7) !important;
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(59,130,246,.05) !important;
  animation: gm-scaleIn .4s ease;
}

/* ══════════════════════════════════════════════
   ── ENHANCED TOPBAR ──
   ══════════════════════════════════════════════ */

.topbar, .app-topbar, .header-bar {
  background: rgba(11,16,25,.65) !important;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(255,255,255,.05) !important;
}

/* ══════════════════════════════════════════════
   ── FOLDER PANEL (EMAIL) ──
   ══════════════════════════════════════════════ */

.folder-panel {
  background: rgba(11,16,25,.7) !important;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-right: 1px solid rgba(255,255,255,.05) !important;
}
.folder-item.active {
  background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(99,102,241,.1)) !important;
}

/* ══════════════════════════════════════════════
   ── COMPOSE BUTTON GLOW ──
   ══════════════════════════════════════════════ */

.compose-btn {
  background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(99,102,241,.12)) !important;
  border: 1px solid rgba(59,130,246,.2) !important;
  transition: all .25s ease !important;
}
.compose-btn:hover {
  background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(99,102,241,.2)) !important;
  box-shadow: 0 4px 20px rgba(59,130,246,.2), 0 0 0 1px rgba(59,130,246,.15);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════
   ── STAT CARDS WITH GRADIENT BORDERS ──
   ══════════════════════════════════════════════ */

.stat-card::before, .card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,.3), transparent);
  opacity: 0;
  transition: opacity .3s ease;
}
.stat-card:hover::before, .card:hover::before {
  opacity: 1;
}
.stat-card, .card {
  position: relative;
  overflow: hidden;
}

/* ══════════════════════════════════════════════
   ── TAB PANELS ANIMATION ──
   ══════════════════════════════════════════════ */

.tab-panel.active {
  animation: gm-fadeSlideUp .3s ease;
}

/* ══════════════════════════════════════════════
   ── EMPTY STATE ──
   ══════════════════════════════════════════════ */

.empty-state, .no-data {
  padding: 60px 20px;
  text-align: center;
  color: var(--text3);
  animation: gm-fadeSlideUp .4s ease;
}

/* ══════════════════════════════════════════════
   ── MESSAGE LIST (EMAIL) ──
   ══════════════════════════════════════════════ */

.msg-row:hover {
  background: rgba(59,130,246,.04) !important;
}
.msg-row.active, .msg-row.selected {
  background: rgba(59,130,246,.08) !important;
  border-left: 3px solid var(--accent);
}

/* ══════════════════════════════════════════════
   ── READING PANE (EMAIL) ──
   ══════════════════════════════════════════════ */

.read-panel, .reading-pane {
  background: rgba(11,16,25,.5) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ══════════════════════════════════════════════
   ── CALENDAR ENHANCEMENTS ──
   ══════════════════════════════════════════════ */

.cal-day.today {
  background: rgba(59,130,246,.1) !important;
  box-shadow: inset 0 0 0 2px rgba(59,130,246,.3);
}
.cal-event {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 3px solid var(--accent);
}

/* ══════════════════════════════════════════════
   ── FILE CARDS ──
   ══════════════════════════════════════════════ */

.file-card, .file-item {
  background: rgba(17,24,39,.5) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.05) !important;
  transition: all .2s ease !important;
}
.file-card:hover, .file-item:hover {
  border-color: rgba(255,255,255,.1) !important;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════
   ── RESPONSIVE ──
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {
  body::before {
    background:
      radial-gradient(ellipse 100% 60% at 50% 30%, rgba(59,130,246,.04) 0%, transparent 60%);
  }
  .card:hover, .stat-card:hover {
    transform: none;
  }
}

/* ============================================================== */
/* HIDE GOD-MODE FAB (per Adam directive 2026-05-22)              */
/* Reason: Blue Code widget (op-sonar-panel) supersedes the       */
/* god-mode floating action button. Two robots fighting for the   */
/* bottom-right corner. Blue Code wins.                           */
/* Rollback: delete this block OR restore from .bak-pre-hide-fab- */
/* 2026-05-22. Reference: [[bluebeach-os-production-protection]]. */
/* ============================================================== */
#gm-fab {
  display: none !important;
}
