/* ══════════════════════════════════════════════════════════════════════════
   ⚡ TAPTALK AAC SOVEREIGN UNIVERSAL NAVIGATION & DESIGN SYSTEM
   Consistent Buttons, Responsive Layouts, Undo/Redo Controls, and Theme Sync
   ══════════════════════════════════════════════════════════════════════════ */

.bg-slate-900 {
  background-color: #0f172a !important;
}
.max-w-7xl {
  max-width: 80rem !important;
}

/* MAXIMUM POSSIBLE Z-INDEX: ENSURE MENU IS ALWAYS ABOVE EVERYTHING ON SCREEN */
#tt-yellow-menu-container {
  z-index: 2147483646 !important;
  position: relative !important;
}
#tt-yellow-dropdown {
  position: fixed !important;
  z-index: 2147483647 !important;
  width: 440px !important;
  max-width: 95vw !important;
  background: #070b14 !important;
  border: 2px solid #facc15 !important;
  border-radius: 18px !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95), 0 0 40px rgba(250, 204, 21, 0.45) !important;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════════════════
   💚 NORMAL CARDIAC SPEED BEATING HEART SECURITY KEYFRAMES (0.85s, ~72 BPM)
   ══════════════════════════════════════════════════════════════════════════ */

  14% { transform: scale(1.35); filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.9)); }
  28% { transform: scale(1.1); filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.6)); }
  42% { transform: scale(1.45); filter: drop-shadow(0 0 12px rgba(16, 185, 129, 1)); }
  65% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.6)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.6)); }
}

@keyframes cardiacDotNormal {
  0%, 100% { transform: scale(1); opacity: 0.85; box-shadow: 0 0 6px #10b981; background: #10b981; }
  14% { transform: scale(1.45); opacity: 1; box-shadow: 0 0 14px #38bdf8; background: #38bdf8; }
  28% { transform: scale(1.15); opacity: 0.9; box-shadow: 0 0 8px #10b981; background: #10b981; }
  42% { transform: scale(1.6); opacity: 1; box-shadow: 0 0 18px #10b981; background: #10b981; }
  65% { transform: scale(1); opacity: 0.85; box-shadow: 0 0 6px #10b981; background: #10b981; }
}

/* ══════════════════════════════════════════════════════════════════════════
   🌟 UNIFIED SOVEREIGN BUTTON THEME ACROSS EVERY SINGLE PORTAL & PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.tt-back-btn,
a.tt-back-btn,
button.tt-back-btn,
.btn-back-portal,
.back-to-portal,
a[href*="parents_portal.html"].btn,
a[href*="portal"].btn-back {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.98)) !important;
  color: #facc15 !important; /* TapTalk Sovereign Gold / Amber */
  border: 1.5px solid rgba(250, 204, 21, 0.45) !important;
  border-radius: 12px !important;
  padding: 6px 14px !important;
  font-family: var(--font-body, 'Lexend', 'OpenDyslexic', 'Atkinson Hyperlegible', sans-serif) !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(250, 204, 21, 0.25) !important;
}

.tt-back-btn:hover,
a.tt-back-btn:hover,
button.tt-back-btn:hover,
.btn-back-portal:hover {
  background: #facc15 !important;
  color: #070b14 !important;
  border-color: #facc15 !important;
  transform: translateY(-1.5px) scale(1.02) !important;
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.45), 0 0 15px rgba(250, 204, 21, 0.3) !important;
  text-decoration: none !important;
}

.tt-back-btn:active,
a.tt-back-btn:active {
  transform: translateY(1px) scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
}

.tt-back-btn i,
a.tt-back-btn i {
  font-size: 0.95rem !important;
  transition: transform 0.2s ease !important;
}

.tt-back-btn:hover i,
a.tt-back-btn:hover i {
  transform: translateX(-3px) !important;
}

/* UNDO / REDO ACTION BUTTONS IN HEADER */
#btn-studio-undo,
#btn-studio-redo,
.btn-undo-action,
.btn-redo-action {
  background: #0f172a !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  color: #f8fafc !important;
  border-radius: 10px !important;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  transition: all 0.18s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#btn-studio-undo:not(:disabled):hover,
#btn-studio-redo:not(:disabled):hover,
.btn-undo-action:not(:disabled):hover,
.btn-redo-action:not(:disabled):hover {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4) !important;
  transform: translateY(-1px) !important;
}

#btn-studio-undo:disabled,
#btn-studio-redo:disabled,
.btn-undo-action:disabled,
.btn-redo-action:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   📱 UNIVERSAL MOBILE RESPONSIVENESS & TOUCH TARGETS
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  header.sticky-top {
    padding: 10px 14px !important;
    gap: 10px !important;
  }
  
  #board-preset-switcher {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .editor-canvas-card {
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .studio-cell-card {
    min-height: 105px !important;
    padding: 8px 4px !important;
  }

  /* Responsive Copilot Drawer */
  #tt-universal-copilot-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }

  /* Table Horizontal Scrolling on Mobile */
  .table-responsive,
  .crm-table-container,
  #native-crm-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }
}

@media (max-width: 576px) {
  .tt-back-btn, a.tt-back-btn {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
  }

  #editor-page-title {
    font-size: 1rem !important;
  }

  #editor-board-meta {
    font-size: 0.68rem !important;
  }

  .btn-group-sm > .btn, .btn-sm {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
  }
}
