/* App overrides on top of Modernize theme
   The Modernize theme (mtheme/assets/css/styles.css) provides:
   - Bootstrap 5, Plus Jakarta Sans, color themes, dark mode,
   - cards, buttons, dropdowns, forms, alerts, navbar, footer, etc. */

/* ── CSS Variable Aliases ─────────────────────────────────── */
:root {
  --app-bg:            #f9fafb;
  --app-bg-surface:    #ffffff;
  --app-bg-inset:      #f3f4f6;
  --app-text:          #111827;
  --app-text-heading:  #111827;
  --app-text-muted:    #4b5563;
  --app-text-faint:    #6b7280;
  --app-border:        #e5e7eb;
  --app-border-subtle: #f3f4f6;

  --app-green:   #10b981;
  --app-red:     #ef4444;
  --app-orange:  #f59e0b;
  --app-yellow:  #eab308;
  --app-teal:    #14b8a6;
  --app-purple:  #8b5cf6;

  --app-font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas,
                  'Liberation Mono', Menlo, monospace;

  --app-radius:    0.75rem;
  --app-radius-sm: 0.375rem;

  --app-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --app-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ── Dark mode overrides ──────────────────────────────────── */
[data-bs-theme="dark"] {
  --app-bg:            #1a1d23;
  --app-bg-surface:    #22262e;
  --app-bg-inset:      #2a2e36;
  --app-text:          #e5e7eb;
  --app-text-heading:  #f3f4f6;
  --app-text-muted:    #9ca3af;
  --app-text-faint:    #6b7280;
  --app-border:        #374151;
  --app-border-subtle: #2a2e36;
}

/* ── Fix Modernize fw-bold override (Modernize sets it to 500) ── */
.fw-bold { font-weight: 700 !important; }
.fw-bolder { font-weight: 800 !important; }
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 600;
}

/* ── Landing page typography (matching BWS app family) ────── */
.lp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-primary);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .lp-hero-badge {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
}

.lp-hero-title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--app-text-heading);
}

.lp-hero-sub {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--app-text-muted);
}

.lp-section-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--app-text-heading);
  margin-bottom: 0.5rem;
}

.lp-section-sub {
  font-size: 1.05rem;
  color: var(--app-text-muted);
}

.lp-step-card {
  background: var(--app-bg-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

.lp-step-card:hover {
  box-shadow: var(--app-shadow-md);
  transform: translateY(-2px);
}

.lp-step-num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.lp-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--app-text-heading);
  margin-bottom: 0.5rem;
}

.lp-step-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--app-text-muted);
  margin: 0;
}

.lp-feature-card {
  background: var(--app-bg-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 1.75rem 1.5rem;
  height: 100%;
  transition: box-shadow 0.2s, transform 0.2s;
}

.lp-feature-card:hover {
  box-shadow: var(--app-shadow-md);
  transform: translateY(-2px);
}

.lp-feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--app-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.lp-feature-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text-heading);
  margin-bottom: 0.4rem;
}

.lp-feature-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--app-text-muted);
  margin: 0;
}

.lp-price-card {
  background: var(--app-bg-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
}

.lp-price-card:hover {
  box-shadow: var(--app-shadow-md);
  transform: translateY(-2px);
}

.lp-price-featured {
  border-color: var(--bs-primary);
  border-width: 2px;
}

.lp-price-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--app-text-heading);
  margin-bottom: 0.5rem;
}

.lp-price-dollar {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--app-text-heading);
}

.lp-price-period {
  font-size: 0.9rem;
  color: var(--app-text-muted);
}

.lp-price-desc {
  font-size: 0.85rem;
  color: var(--app-text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.lp-price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex: 1;
}

.lp-price-features li {
  font-size: 0.85rem;
  color: var(--app-text);
  padding: 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lp-price-features li i.ti-check { color: var(--app-green); font-size: 1rem; }
.lp-price-features li i.ti-x { color: var(--app-text-faint); font-size: 1rem; }

.lp-cta-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--app-text-heading);
  margin-bottom: 0.5rem;
}

.lp-cta-sub {
  font-size: 1.05rem;
  color: var(--app-text-muted);
  margin-bottom: 1.5rem;
}

/* ── Logo light/dark switching ────────────────────────────── */
.light-logo { display: none; }
[data-bs-theme="dark"] .dark-logo { display: none !important; }
[data-bs-theme="dark"] .light-logo { display: inline !important; }

/* ── Top navbar (slightly darker in light mode) ──────────────── */
.header-fp .navbar.bg-primary-subtle {
  background-color: #e2d9f3 !important;
}

[data-bs-theme="dark"] .header-fp .navbar.bg-primary-subtle {
  background-color: var(--bs-primary-bg-subtle) !important;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  border-color: var(--app-border);
  background: var(--app-bg-surface);
}

.card-header {
  background: var(--app-bg-surface);
  border-color: var(--app-border);
  font-weight: 600;
}

/* ── Nav tabs ──────────────────────────────────────────────── */
.nav-tabs .nav-link {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--app-text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--app-text);
  border-bottom-color: var(--app-border);
}

.nav-tabs .nav-link.active {
  background: var(--app-bg-surface);
  color: var(--bs-primary);
  font-weight: 700;
  border: none;
  border-bottom: 3px solid var(--bs-primary);
}

.nav-tabs {
  border-bottom: 2px solid var(--app-border);
}

/* ── App Detail Sidebar Nav ─────────────────────────────────── */
.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--app-radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--app-text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.app-nav-link:hover {
  background: var(--app-bg-inset);
  color: var(--app-text);
  text-decoration: none;
}

.app-nav-link.active {
  background: rgba(var(--bs-primary-rgb, 105, 63, 211), 0.08);
  color: var(--bs-primary);
  font-weight: 600;
}

.app-nav-link-danger {
  color: var(--bs-danger) !important;
}

.app-nav-link-danger:hover {
  background: rgba(var(--bs-danger-rgb, 239, 68, 68), 0.08);
  color: var(--bs-danger) !important;
}

.app-nav-link-danger.active {
  background: rgba(var(--bs-danger-rgb, 239, 68, 68), 0.12);
  color: var(--bs-danger) !important;
}

/* Desktop sidebar: sticky positioning */
.app-sidebar-desktop {
  position: sticky;
  top: 1rem;
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 2rem 0;
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  padding: 1.25rem;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* ── Table header styling ───────────────────────────────────── */
.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ── Avatar dropdown (no caret, circle-only trigger) ─────────── */
.dropdown-toggle-no-caret::after {
  display: none;
}

/* ── Utilities ──────────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Team avatar helpers ────────────────────────────────────── */
.team-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-avatar-md {
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
}

.team-avatar-initial {
  font-size: 1rem;
}

/* ── Privacy Pill (card overlay, non-interactive) ────────────── */
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.privacy-pill-wrapper {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
}

.privacy-pill-clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}

.privacy-pill-clickable:hover {
  opacity: 0.8;
}

.privacy-pill-public {
  background: #fff;
  color: #059669;
  border: 1px solid #a7f3d0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.privacy-pill-private {
  background: #fff;
  color: #4b5563;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

[data-bs-theme="dark"] .privacy-pill-public {
  background: #1a2e23;
  color: #34d399;
  border-color: #065f46;
}

[data-bs-theme="dark"] .privacy-pill-private {
  background: #1f2937;
  color: #9ca3af;
  border-color: #4b5563;
}

/* ── Privacy Pill Button (detail page, clickable) ────────────── */
.privacy-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.privacy-pill-btn:hover {
  opacity: 0.8;
}

.privacy-pill-btn-public {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.privacy-pill-btn-private {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

[data-bs-theme="dark"] .privacy-pill-btn-public {
  background: #1a2e23;
  color: #34d399;
  border-color: #065f46;
}

[data-bs-theme="dark"] .privacy-pill-btn-private {
  background: #1f2937;
  color: #9ca3af;
  border-color: #4b5563;
}

/* ── Stat Bar (horizontal stats strip) ───────────────────────── */
.stat-bar .stat-bar-item {
  border-right: 1px solid var(--app-border);
}

/* ── Action Bar ──────────────────────────────────────────────── */
.action-bar .btn {
  white-space: nowrap;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stat-card .stat-value {
    font-size: 1.4rem;
  }
  .main-content {
    padding: 1rem 0;
  }
  .lp-hero-title {
    font-size: 2.5rem;
  }
  .lp-hero-sub {
    font-size: 1rem;
  }
  .lp-section-title {
    font-size: 1.65rem;
  }
  .lp-cta-title {
    font-size: 1.65rem;
  }
  /* Stats bar: 2x2 grid on mobile */
  .stat-bar .card-body > .d-flex {
    flex-wrap: wrap;
  }
  .stat-bar .stat-bar-item,
  .stat-bar .flex-fill {
    flex: 0 0 50% !important;
    max-width: 50%;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .stat-bar .stat-bar-item:nth-child(2) {
    border-right: none;
  }
  .stat-bar .stat-bar-item:nth-child(1),
  .stat-bar .stat-bar-item:nth-child(2) {
    border-bottom: 1px solid var(--app-border);
  }
  /* Screenshot height on mobile */
  .card a[style*="height: 280px"] {
    height: 180px !important;
  }
  /* Action bar stacking on mobile */
  .action-bar {
    flex-direction: column;
    align-items: stretch !important;
  }
  .action-bar .ms-auto {
    margin-left: 0 !important;
  }
}

/* ── Kept Badge (small, top-left of card image) ── */
.kept-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  pointer-events: none;
  background: rgba(16,185,129,0.9);
  color: #fff;
}

/* ── Credit badges (card view, bottom-left of screenshot) ── */
.credit-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  pointer-events: none;
}
.credit-badge-danger {
  background: rgba(220,38,38,0.9);
  color: #fff;
}
.credit-badge-attention {
  background: rgba(100,116,139,0.9);
  color: #fff;
}
.credit-badge-warning {
  background: rgba(245,158,11,0.9);
  color: #fff;
}

/* ── Keep CTA Overlay (centered on card image) ── */
.keep-cta-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(1px);
}
.keep-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.keep-cta-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.keep-cta-timer {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.9;
  margin-left: 0.4rem;
  padding-left: 0.4rem;
  border-left: 1px solid rgba(255,255,255,0.4);
}

/* Keep CTA color escalation (reuses expiry-badge-* classes) */
.keep-cta-btn.expiry-badge-calm {
  background: rgba(16,185,129,0.95);
}
.keep-cta-btn.expiry-badge-warn {
  background: rgba(245,158,11,0.95);
}
.keep-cta-btn.expiry-badge-urgent {
  background: rgba(220,38,38,0.95);
}
.keep-cta-btn.expiry-badge-critical {
  background: rgba(220,38,38,0.98);
  animation: keep-pulse 1.5s ease-in-out infinite;
}
@keyframes keep-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(220,38,38,0.3); }
  50% { box-shadow: 0 0 0 10px rgba(220,38,38,0), 0 2px 12px rgba(220,38,38,0.3); }
}

/* List view keep button color escalation */
.keep-list-btn.expiry-badge-calm { background-color: #10b981; border-color: #10b981; }
.keep-list-btn.expiry-badge-warn { background-color: #f59e0b; border-color: #f59e0b; }
.keep-list-btn.expiry-badge-urgent { background-color: #dc2626; border-color: #dc2626; }
.keep-list-btn.expiry-badge-critical { background-color: #dc2626; border-color: #dc2626; animation: keep-pulse 1.5s ease-in-out infinite; }

[data-bs-theme="dark"] .keep-cta-btn.expiry-badge-calm {
  background: rgba(16,185,129,0.9);
}
