/* =====================================================
   SHORTCUTS MODAL
   ===================================================== */

/* ── Backdrop ────────────────────────────────────── */
#shortcuts-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999997;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: flex-end;        /* sheet slides up from bottom on mobile */
  justify-content: center;
  padding: 0;

  /* Fade in */
  opacity: 0;
  transition: opacity 0.3s ease;
}

#shortcuts-overlay.sc-visible {
  opacity: 1;
}

/* ── Card ────────────────────────────────────────── */
.sc-card {
  background: #0d1530;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 32px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  /* Slide up from below */
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Drag handle hint */
  position: relative;
}

/* Drag handle */
.sc-card::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 20px;
}

#shortcuts-overlay.sc-visible .sc-card {
  transform: translateY(0);
}

/* ── Header ──────────────────────────────────────── */
.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sc-title {
  color: var(--accent, #00e5ff);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sc-title i {
  font-size: 1rem;
}

.sc-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sc-close:hover,
.sc-close:active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent, #00e5ff);
  color: var(--accent, #00e5ff);
  transform: scale(1.1);
}

/* ── Rows ────────────────────────────────────────── */
.sc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.sc-row:hover,
.sc-row:active {
  background: rgba(0, 229, 255, 0.06);
}

.sc-desc {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(234, 242, 255, 0.8);
  font-size: 0.88rem;
  font-weight: 500;
}

.sc-icon {
  color: var(--accent, #00e5ff);
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.sc-kbd {
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-bottom-width: 2px;
  border-radius: 7px;
  padding: 4px 10px;
  color: var(--accent, #00e5ff);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

/* ── Hint footer ─────────────────────────────────── */
.sc-hint {
  margin-top: 18px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.28);
  text-align: center;
  line-height: 1.6;
}

.sc-hint kbd {
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent, #00e5ff);
  font-size: 0.72rem;
}

.sc-hint i {
  color: var(--accent, #00e5ff);
}

/* ── Scrollbar ───────────────────────────────────── */
.sc-card::-webkit-scrollbar { width: 4px; }
.sc-card::-webkit-scrollbar-track { background: transparent; }
.sc-card::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 4px;
}

/* ── Desktop — centre the card instead of bottom sheet ── */
@media (min-width: 601px) {
  #shortcuts-overlay {
    align-items: center;
    padding: 20px;
  }

  .sc-card {
    border-radius: 20px;
    max-width: 440px;
    max-height: 80vh;
    /* Slide up from slightly below centre */
    transform: translateY(40px) scale(0.96);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity  0.3s ease;
    opacity: 0;
  }

  .sc-card::before {
    display: none;   /* no drag handle on desktop */
  }

  #shortcuts-overlay.sc-visible .sc-card {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ── Mobile improvements ── */
@media (max-width: 600px) {
  #shortcuts-overlay {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }

  .sc-card {
    max-width: calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right)));
    max-height: calc(85vh - env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    padding: 28px max(24px, env(safe-area-inset-left)) 32px max(24px, env(safe-area-inset-right));
  }

  .sc-close {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  .sc-row {
    min-height: 44px;
    padding: 12px 14px;
  }
}

/* ── Light mode ──────────────────────────────────── */
body.light-mode .sc-card {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 20px 60px rgba(37, 99, 235, 0.15);
}

body.light-mode .sc-card::before {
  background: rgba(0, 0, 0, 0.15);
}

body.light-mode .sc-title {
  color: var(--accent, #2563eb);
}

body.light-mode .sc-desc {
  color: rgba(15, 23, 42, 0.8);
}

body.light-mode .sc-icon {
  color: var(--accent, #2563eb);
}

body.light-mode .sc-kbd {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--accent, #2563eb);
}

body.light-mode .sc-close {
  color: rgba(15, 23, 42, 0.5);
  border-color: rgba(15, 23, 42, 0.15);
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode .sc-close:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}

body.light-mode .sc-hint {
  color: rgba(15, 23, 42, 0.35);
}

body.light-mode .sc-hint kbd {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--accent, #2563eb);
}

body.light-mode .sc-hint i {
  color: var(--accent, #2563eb);
}

body.light-mode .sc-row:hover {
  background: rgba(37, 99, 235, 0.05);
}
