/*
 * theme.css -- Dark theme foundation
 * Defines :root CSS custom property tokens and overrides Datta Able / Bootstrap
 * light-theme defaults. Loaded after style.css and prep.css in head.html.
 *
 * Sections:
 *   1  - :root token definitions
 *   2  - Body / Page background
 *   3  - Typography
 *   4  - Cards
 *   5  - Pre-loader dark treatment
 *   6  - Extracted template styles
 *   7  - Forms / Inputs
 *   8  - Buttons
 *   9  - Tables
 *   10 - Badges
 *   11 - Pagination
 *   12 - Alerts
 *   13 - Header (full dark restyle)
 *   14 - Scrollbar
 *   15 - Sidebar (full dark restyle with logo and active accent)
 *   16 - Auth pages
 *   17 - Bottom Tab Bar (mobile navigation)
 *   18 - Responsive Navigation (sidebar/tab bar switch at 992px)
 *   19 - Page fade-in animation
 *   20 - Glassmorphism components
 *   21 - Card hover micro-interactions
 *   22 - Neon glow enhancements
 *   23 - Status pulse animations
 *   24 - Score card accent treatment
 *   25 - Page-specific dark fixes
 *   26 - Dashboard components
 *   27 - Page exit transition
 *   28 - Scroll-reveal animation
 *   29 - Staggered card entrance
 *   30 - PDF viewer overlay
 *   31 - Reduced motion master override
 *   32 - PWA Install Banner
 *   33 - Django Admin dark overrides
 *   34 - Landing & Activities
 *
 * NOTE: Section 31 (reduced-motion) should precede non-animated sections.
 */

/* ==========================================================================
   Section 1: :root token definitions
   ========================================================================== */

:root {
  /* === Primitive palette === */
  --cf-gray-900: #111111;
  --cf-gray-800: #1a1a2e;
  --cf-gray-700: #1e1e30;
  --cf-gray-600: #2a2a3d;
  --cf-gray-500: #3a3a4d;
  --cf-gray-400: #6c757d;
  --cf-gray-300: #9e9e9e;
  --cf-gray-200: #bdbdbd;
  --cf-gray-100: #e0e0e0;
  --cf-white: #f5f5f5;

  --cf-green-500: #39ff14;       /* neon green (accent) */
  --cf-green-400: #00e676;       /* softer green */
  --cf-green-300: #69f0ae;       /* muted green */

  --cf-red-500: #ff5252;
  --cf-orange-500: #ffab40;
  --cf-blue-500: #448aff;
  --cf-cyan-500: #18ffff;

  /* === Semantic tokens (what components reference) === */
  --cf-bg: var(--cf-gray-900);
  --cf-surface: var(--cf-gray-700);
  --cf-surface-elevated: var(--cf-gray-600);
  --cf-border: var(--cf-gray-500);
  --cf-border-light: var(--cf-gray-600);

  --cf-text-primary: var(--cf-gray-100);    /* #e0e0e0 on #1e1e30 = 11.7:1 */
  --cf-text-secondary: var(--cf-gray-300);  /* #9e9e9e on #1e1e30 = 5.7:1 */
  --cf-text-muted: var(--cf-gray-400);      /* #6c757d on #1e1e30 = 3.7:1 -- use only for large text */
  --cf-text-on-gradient: var(--cf-white);

  --cf-accent: var(--cf-green-500);
  --cf-accent-rgb: 57, 255, 20;  /* RGB of --cf-green-500 (#39ff14) for rgba() usage */
  --cf-accent-soft: var(--cf-green-400);
  --cf-accent-muted: var(--cf-green-300);

  /* === Status colors (dark-safe) === */
  --cf-status-danger: #7f1d1d;
  --cf-status-warning: #78350f;
  --cf-status-success: #14532d;

  /* === Component tokens === */
  --cf-card-bg: var(--cf-surface);
  --cf-card-border: rgba(255, 255, 255, 0.06);
  --cf-input-bg: var(--cf-gray-800);
  --cf-input-border: var(--cf-gray-500);
  --cf-input-focus-shadow: 0 0 0 3px rgba(57, 255, 20, 0.25);

  /* === Spacing (for consistency) === */
  --cf-radius-sm: 6px;
  --cf-radius-md: 10px;
  --cf-radius-lg: 16px;

  /* === Transitions === */
  --cf-transition-fast: 150ms ease;
  --cf-transition-normal: 300ms ease;

  /* === Glass effect (for Phase 12 auth pages) === */
  --cf-glass-bg: rgba(30, 30, 48, 0.7);
  --cf-glass-border: rgba(255, 255, 255, 0.08);
  --cf-glass-blur: 12px;

  /* === Existing prep.css tokens that now get dark values === */
  --cf-icon-badge-bg: var(--cf-gray-600);
  --cf-gradient-start: #667eea;
  --cf-gradient-end: #764ba2;
  --cf-body-gradient-start: var(--cf-gray-800);
  --cf-body-gradient-end: var(--cf-gray-700);
  --cf-surface-muted: var(--cf-gray-600);
  --cf-code-bg: var(--cf-gray-800);
  --cf-success-bg: rgba(20, 83, 45, 0.3);
  --cf-success-title: var(--cf-green-300);
  --cf-success-text: var(--cf-green-300);
  --cf-warning-bg: rgba(120, 53, 15, 0.3);
  --cf-warning-border: var(--cf-orange-500);
  --cf-warning-title: var(--cf-orange-500);
  --cf-setup-bg-start: var(--cf-gray-800);
  --cf-setup-bg-end: var(--cf-gray-700);
  --cf-stat-1-start: #667eea;
  --cf-stat-1-end: #764ba2;
  --cf-stat-1-text: white;
  --cf-stat-2-start: #11998e;
  --cf-stat-2-end: #38ef7d;
  --cf-stat-2-text: white;
  --cf-stat-3-start: #ffecd2;
  --cf-stat-3-end: #fcb69f;
  --cf-stat-3-text: #333;
  --cf-stat-4-start: #ff9a9e;
  --cf-stat-4-end: #fecfef;
  --cf-stat-4-text: #333;
}

/* ==========================================================================
   Section 2: Body / Page background
   ========================================================================== */

body {
  background: var(--cf-bg);
  color: var(--cf-text-primary);
}

.pcoded-content {
  background: transparent;
}

.pcoded-main-container {
  background: transparent;
}

/* ==========================================================================
   Section 3: Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  color: var(--cf-text-primary);
}

p {
  color: var(--cf-text-primary);
}

label {
  color: var(--cf-text-primary);
}

/* Bootstrap .text-muted uses !important so we must override with !important.
   Use --cf-text-secondary (#9e9e9e, 5.7:1) NOT --cf-text-muted (#6c757d, 3.7:1)
   for WCAG AA compliance on normal-sized text. */
.text-muted {
  color: var(--cf-text-secondary) !important;
}

a {
  color: var(--cf-accent-soft);
}

a:hover {
  color: var(--cf-accent);
}

.lead {
  color: var(--cf-text-primary);
}

.breadcrumb {
  background-color: transparent;
}

.breadcrumb-item a {
  color: var(--cf-accent-soft);
}

.breadcrumb-item.active {
  color: var(--cf-text-secondary);
}

/* ==========================================================================
   Section 4: Cards
   ========================================================================== */

.card {
  background-color: var(--cf-card-bg);
  border: 1px solid var(--cf-card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card .card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--cf-card-border);
}

.card .card-header h5 {
  color: var(--cf-text-primary);
}

.card .card-header h5:after {
  background-color: var(--cf-accent);
}

.card .card-footer {
  background-color: transparent;
  border-top: 1px solid var(--cf-card-border);
}

.card .card-body,
.card .card-block {
  background-color: transparent;
  color: var(--cf-text-primary);
}

/* Bootstrap utility override (uses !important, so we must too) */
.bg-light {
  background-color: var(--cf-surface-elevated) !important;
}

/* Dropdown dark treatment */
.dropdown-menu {
  background-color: var(--cf-surface);
  border-color: var(--cf-border);
}

.dropdown-item {
  color: var(--cf-text-primary);
}

.dropdown-item:hover {
  background-color: var(--cf-surface-elevated);
  color: var(--cf-text-primary);
}

/* Modal dark treatment */
.modal-content {
  background-color: var(--cf-surface);
  border-color: var(--cf-border);
}

.modal-header {
  border-bottom-color: var(--cf-border);
}

.modal-footer {
  border-top-color: var(--cf-border);
}

/* ==========================================================================
   Section 5: Pre-loader dark treatment
   ========================================================================== */

.loader-bg {
  background: var(--cf-bg);
}

.loader-track {
  background: var(--cf-surface);
}

.loader-fill {
  background: var(--cf-accent);
}

/* ==========================================================================
   Section 6: Extracted template styles (migrated from embedded <style> blocks)
   ========================================================================== */

/* --- Animations (news.html, ingress_dashboard.html) --- */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* --- News card interactions (news.html) --- */
.news-card:hover {
  transform: translateY(-5px);
}

/* --- Date badges (ingresses.html, ingress_dashboard.html) --- */
.date-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--cf-surface-elevated);
  color: var(--cf-text-primary);
  border-radius: 15px;
  font-size: 0.875rem;
  font-weight: 500;
}

.date-badge.recent {
  background: var(--cf-accent-muted);
  color: #000;
}

/* --- Empty state (ingresses.html, ingress_dashboard.html) --- */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--cf-text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  opacity: 0.3;
  margin-bottom: 1rem;
}

/* --- Table layout (ingresses.html, ingress_dashboard.html) --- */
.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
}

/* --- News detail (news_detail.html) --- */
.news-content {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--cf-text-primary);
}

.comment-avatar, .reply-avatar {
  flex-shrink: 0;
}

.comment {
  border-left: 3px solid var(--cf-accent);
}

.reply {
  border-left: 2px solid var(--cf-text-secondary);
}

.reply-form {
  background-color: var(--cf-surface-elevated);
  border: 1px solid var(--cf-border);
  border-radius: 0.375rem;
  padding: 15px;
}

.replies {
  border-left: 2px solid var(--cf-border);
  padding-left: 15px;
}

.comment-actions .btn {
  font-size: 0.875rem;
}

.comment-text,
.reply-text {
  word-break: break-word;
  overflow-wrap: break-word;
}

.comment-toggle-btn {
  color: var(--cf-accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--cf-surface-elevated);
  border: 1px solid var(--cf-border);
  transition: all 0.2s ease;
}

.comment-toggle-btn:hover {
  background: var(--cf-accent);
  color: white;
  text-decoration: none;
}

/* --- News list (news_list.html) --- */
.like-btn {
  transition: all 0.3s ease;
}

.like-btn:hover {
  transform: scale(1.05);
}

.card-img-top {
  border-top-left-radius: calc(.375rem - 1px);
  border-top-right-radius: calc(.375rem - 1px);
}

/* --- Performance indicators (ingress_dashboard.html) --- */
.performance-excellent { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.performance-great { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.performance-good { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.performance-needs-improvement { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }

.performance-card {
  color: white;
  border-radius: 10px;
}

.performance-card h3, .performance-card h6 {
  color: white !important;
}

/* --- Stat card emoji animations (ingress_dashboard.html) --- */
.stat-emoji {
  font-size: 2rem;
  animation: pulse 2s infinite;
}

/* --- Progress bars (gift_detail.html, gift_results_admin.html) --- */
.progress {
  background-color: var(--cf-gray-800);
  height: 25px;
}

.progress-bar {
  font-weight: bold;
  line-height: 25px;
}

/* --- Utility (gift_list.html) --- */
.opacity-75 {
  opacity: 0.75;
}

.badge-pill {
  font-size: 0.9em;
}

.alert {
  margin-bottom: 0.5rem;
}

/* --- Gift admin (gift_results_admin.html) --- */
.badge {
  font-size: 0.8em;
}

.btn-group-vertical .btn {
  margin-bottom: 2px;
}

/* --- Shadow utility (gift_detail.html) --- */
.shadow-lg {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.list-unstyled li i {
  margin-right: 8px;
}

/* --- Responsive overrides (news_detail.html) --- */
@media (max-width: 768px) {
  /* Comment avatars - smaller on mobile */
  .comment-avatar {
    width: 32px !important;
    height: 32px !important;
  }
  .comment-avatar .cf-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px;
  }

  .reply-avatar {
    width: 24px !important;
    height: 24px !important;
  }
  .reply-avatar .cf-avatar-sm {
    width: 24px !important;
    height: 24px !important;
    font-size: 11px;
  }

  /* Reduce avatar margin on mobile */
  .comment-avatar.mr-3 {
    margin-right: 0.5rem !important;
  }

  .news-content {
    font-size: 1rem;
  }

  /* Comment card body - reduce padding on mobile */
  .comment .card-body {
    padding: 0.75rem;
  }

  /* Comment actions - stack buttons, bigger touch targets */
  .comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0.5rem;
  }

  .comment-actions .btn {
    font-size: 0.8rem;
    min-height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
  }

  /* Reply section - reduce left indent on mobile */
  .replies {
    margin-left: 0.5rem !important;
    padding-left: 10px;
  }

  .reply {
    padding: 0.5rem !important;
  }

  /* Reply form - smaller padding on mobile */
  .reply-form {
    padding: 10px;
  }

  .reply-form .btn {
    min-height: 38px;
    font-size: 0.85rem;
  }

  /* Comment header - stack name and date vertically on very small screens */
  .comment-header {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
  }

  .comment-header small {
    display: block;
    width: 100%;
    margin-left: 0 !important;
  }

  /* Comment text - ensure long words don't overflow */
  .comment-text,
  .reply-text {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Textarea - comfortable size on mobile */
  #comment-form textarea,
  .reply-form textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    min-height: 80px;
  }

  /* Submit button - full width on mobile for comment form */
  #comment-form .btn-primary {
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
  }

  /* Toggle link - full width on mobile */
  .comment-toggle-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    min-height: 44px;
  }
}

/* ==========================================================================
   Section 7: Forms / Inputs
   ========================================================================== */

.form-control,
.custom-select {
  background: var(--cf-input-bg);
  color: var(--cf-text-primary);
  border-color: var(--cf-input-border);
}

.form-control:focus,
.custom-select:focus {
  background: var(--cf-input-bg);
  color: var(--cf-text-primary);
  border-color: var(--cf-accent);
  box-shadow: var(--cf-input-focus-shadow);
}

.form-control::placeholder {
  color: var(--cf-gray-400);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--cf-gray-800);
  color: var(--cf-text-secondary);
  opacity: 0.7;
}

.input-group {
  background: transparent;
}

.input-group-text {
  background-color: var(--cf-surface-elevated);
  color: var(--cf-text-secondary);
  border-color: var(--cf-input-border);
}

.custom-file-label {
  background-color: var(--cf-input-bg);
  color: var(--cf-text-primary);
  border-color: var(--cf-input-border);
}

.custom-file-label::after {
  background-color: var(--cf-surface-elevated);
  color: var(--cf-text-primary);
}

/* Nav tabs (used in some form pages) */
.nav-tabs .nav-link.active {
  background-color: var(--cf-surface);
  color: var(--cf-text-primary);
  border-color: var(--cf-border) var(--cf-border) var(--cf-surface);
}

.nav-tabs .nav-link {
  color: var(--cf-text-secondary);
}

.nav-tabs .nav-link:hover {
  border-color: var(--cf-border);
}

/* ==========================================================================
   Section 8: Buttons
   ========================================================================== */

/* Primary: Neon green with glow */
.btn-primary {
  background-color: var(--cf-accent);
  border-color: var(--cf-accent);
  color: #000;
  font-weight: 600;
  transition: all var(--cf-transition-normal);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--cf-accent-soft);
  border-color: var(--cf-accent-soft);
  color: #000;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.4), 0 0 30px rgba(57, 255, 20, 0.2);
}

.btn-primary:active {
  background-color: var(--cf-accent-muted);
  border-color: var(--cf-accent-muted);
  color: #000;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
  background-color: var(--cf-accent-muted);
  border-color: var(--cf-accent-muted);
  color: #000;
}

/* Secondary: Dark variant */
.btn-secondary {
  background-color: var(--cf-gray-600);
  border-color: var(--cf-gray-500);
  color: var(--cf-text-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--cf-gray-500);
  border-color: var(--cf-gray-400);
  color: var(--cf-text-primary);
}

/* Success: Dark green */
.btn-success {
  background-color: var(--cf-green-400);
  border-color: var(--cf-green-400);
  color: #000;
}

.btn-success:hover,
.btn-success:focus {
  background-color: var(--cf-green-300);
  border-color: var(--cf-green-300);
  color: #000;
}

/* Danger: Bright red on dark */
.btn-danger {
  background-color: var(--cf-red-500);
  border-color: var(--cf-red-500);
  color: #fff;
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #ff7070;
  border-color: #ff7070;
  color: #fff;
}

/* Warning: Orange on dark */
.btn-warning {
  background-color: var(--cf-orange-500);
  border-color: var(--cf-orange-500);
  color: #000;
}

.btn-warning:hover,
.btn-warning:focus {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #000;
}

/* Info */
.btn-info {
  background-color: var(--cf-cyan-500);
  border-color: var(--cf-cyan-500);
  color: #000;
}

/* Outline variants */
.btn-outline-primary {
  color: var(--cf-accent);
  border-color: var(--cf-accent);
}

.btn-outline-primary:hover {
  background-color: var(--cf-accent);
  border-color: var(--cf-accent);
  color: #000;
}

.btn-outline-secondary {
  color: var(--cf-text-secondary);
  border-color: var(--cf-gray-500);
}

.btn-outline-secondary:hover {
  background-color: var(--cf-gray-600);
  border-color: var(--cf-gray-500);
  color: var(--cf-text-primary);
}

.btn-outline-danger {
  color: var(--cf-red-500);
  border-color: var(--cf-red-500);
}

.btn-outline-danger:hover {
  background-color: var(--cf-red-500);
  color: #fff;
}

/* Link button */
.btn-link {
  color: var(--cf-accent-soft);
}

.btn-link:hover {
  color: var(--cf-accent);
}

/* ==========================================================================
   Section 9: Tables
   ========================================================================== */

.table td,
.table th {
  border-top-color: var(--cf-card-border);
  color: var(--cf-text-primary);
}

.table thead th {
  border-bottom-color: var(--cf-card-border);
  color: var(--cf-text-secondary);
}

.table-striped tbody tr:nth-of-type(2n+1) {
  background-color: rgba(57, 255, 20, 0.03);
}

.table-hover tbody tr:hover {
  background-color: rgba(57, 255, 20, 0.05);
  color: var(--cf-text-primary);
}

.table-bordered {
  border-color: var(--cf-card-border);
}

.table-bordered td,
.table-bordered th {
  border-color: var(--cf-card-border);
}

/* ==========================================================================
   Section 10: Badges
   ========================================================================== */

.badge-primary {
  background-color: var(--cf-accent);
  color: #000;
}

.badge-secondary {
  background-color: var(--cf-gray-500);
  color: var(--cf-text-primary);
}

.badge-success {
  background-color: var(--cf-green-400);
  color: #000;
}

.badge-danger {
  background-color: var(--cf-red-500);
  color: #fff;
}

.badge-warning {
  background-color: var(--cf-orange-500);
  color: #000;
}

.badge-info {
  background-color: var(--cf-cyan-500);
  color: #000;
}

.badge-light {
  background-color: var(--cf-gray-600);
  color: var(--cf-text-primary);
}

.badge-dark {
  background-color: var(--cf-gray-800);
  color: var(--cf-text-primary);
}

/* ==========================================================================
   Section 11: Pagination
   ========================================================================== */

.page-link {
  background-color: var(--cf-surface);
  border-color: var(--cf-border);
  color: var(--cf-text-primary);
}

.page-link:hover {
  background-color: var(--cf-surface-elevated);
  border-color: var(--cf-border);
  color: var(--cf-accent);
}

.page-item.active .page-link {
  background-color: var(--cf-accent);
  border-color: var(--cf-accent);
  color: #000;
}

.page-item.disabled .page-link {
  background-color: var(--cf-gray-800);
  border-color: var(--cf-border);
  color: var(--cf-gray-500);
}

/* ==========================================================================
   Section 12: Alerts
   ========================================================================== */

.alert-primary {
  background-color: rgba(57, 255, 20, 0.1);
  border-color: rgba(57, 255, 20, 0.2);
  color: var(--cf-accent-muted);
}

.alert-secondary {
  background-color: rgba(58, 58, 77, 0.5);
  border-color: var(--cf-border);
  color: var(--cf-text-primary);
}

.alert-success {
  background-color: rgba(20, 83, 45, 0.3);
  border-color: rgba(0, 230, 118, 0.2);
  color: var(--cf-green-300);
}

.alert-info {
  background-color: rgba(24, 255, 255, 0.1);
  border-color: rgba(24, 255, 255, 0.2);
  color: var(--cf-cyan-500);
}

.alert-warning {
  background-color: rgba(120, 53, 15, 0.3);
  border-color: rgba(255, 171, 64, 0.2);
  color: var(--cf-orange-500);
}

.alert-danger {
  background-color: rgba(127, 29, 29, 0.3);
  border-color: rgba(255, 82, 82, 0.2);
  color: var(--cf-red-500);
}

.alert a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

/* ==========================================================================
   Section 13: Header (full dark restyle)
   ========================================================================== */

.pcoded-header {
  background: var(--cf-surface);
  box-shadow: 0 1px 0 var(--cf-border);
}

.pcoded-header > .collapse:not(.show) {
  background: var(--cf-surface);
}

/* Header logo image */
.cf-header-logo {
  height: 32px;
  width: auto;
  vertical-align: middle;
}

.pcoded-header .m-header .mobile-menu span,
.pcoded-header .m-header .mobile-menu span:after,
.pcoded-header .m-header .mobile-menu span:before {
  background: var(--cf-text-secondary);
}

.pcoded-header .dropdown-menu {
  background: var(--cf-surface);
  border: 1px solid var(--cf-border);
}

.pcoded-header .dropdown-menu .dropdown-item {
  color: var(--cf-text-primary);
}

.pcoded-header .dropdown-menu .dropdown-item:hover {
  background: var(--cf-gray-700);
}

.pcoded-header .pro-head {
  background: var(--cf-gray-800);
  color: var(--cf-text-primary);
}

/* Settings dropdown: raise above sidebar (z-index 1029) when open */
.pcoded-header .dropdown.drp-user.show {
  z-index: 1030;
}

.pcoded-header .dropdown.drp-user .dropdown-menu.profile-notification {
  z-index: 1031;
  min-width: 260px;
  max-width: 300px;
}

/* Mobile header hamburger in .m-header -- position correctly */
.pcoded-header .m-header {
  position: relative;
}

.pcoded-header .m-header .mobile-menu {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

@media only screen and (max-width: 991px) {
  /* Hide sidebar entirely on mobile */
  .pcoded-navbar {
    display: none !important;
  }
  .pcoded-navbar.mob-open {
    display: none !important;
  }

  /* No margin since sidebar is hidden */
  .pcoded-navbar ~ .pcoded-header,
  .pcoded-navbar ~ .pcoded-main-container {
    margin-left: 0 !important;
  }

  /* Header: single row — brand left, settings right */
  .pcoded-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    background: var(--cf-surface) !important;
    color: var(--cf-text-primary) !important;
    z-index: 1030;
    padding: 0 !important;
  }

  /* Brand area: left side */
  .pcoded-header .m-header {
    display: flex !important;
    align-items: center;
    height: 56px;
    flex-shrink: 0;
    width: auto !important;
  }
  .pcoded-header .m-header .b-brand {
    margin-left: 16px;
  }

  /* Hide hamburger (no sidebar) and three-dots toggle */
  .pcoded-header .m-header .mobile-menu,
  .pcoded-header #mobile-header {
    display: none !important;
  }

  /* Collapse area: always visible, pushed to the right */
  .pcoded-header > .collapse:not(.show),
  .pcoded-header > .collapse.show {
    display: flex !important;
    flex-grow: 1;
    justify-content: flex-end;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Settings gear nav list */
  .pcoded-header .navbar-nav.ml-auto {
    display: flex !important;
    align-items: center;
    margin-left: auto;
    flex-direction: row !important;
  }
  .pcoded-header .navbar-nav > li:last-child {
    padding-right: 16px;
  }

  /* Dark text for mobile header links */
  .pcoded-header a,
  .pcoded-header .input-group-text {
    color: var(--cf-text-secondary) !important;
  }

  /* Settings gear dropdown */
  .pcoded-header .dropdown.drp-user {
    position: relative !important;
  }
  .pcoded-header .dropdown.drp-user.show {
    position: relative !important;
    z-index: 1031;
  }
  .pcoded-header .dropdown.drp-user .dropdown-menu.profile-notification {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 1031;
    max-width: 300px;
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
  }
}

/* Extra-small screens */
@media only screen and (max-width: 575px) {
  .pcoded-header .dropdown.show {
    position: relative !important;
  }
  .pcoded-header .dropdown.drp-user .dropdown-menu.profile-notification {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    width: calc(100vw - 30px);
    max-width: 300px;
    min-width: 240px;
  }
}

/* ==========================================================================
   Section 14: Scrollbar
   ========================================================================== */

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

::-webkit-scrollbar-track {
  background: var(--cf-gray-900);
}

::-webkit-scrollbar-thumb {
  background: var(--cf-gray-500);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cf-gray-400);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--cf-gray-500) var(--cf-gray-900);
}

/* ==========================================================================
   Section 15: Sidebar (full dark restyle with logo and active accent)
   ========================================================================== */

.pcoded-navbar {
  background: var(--cf-gray-800);
  color: var(--cf-text-secondary);
}

.pcoded-navbar .header-logo {
  background: var(--cf-gray-800);
}

.pcoded-navbar .navbar-content {
  background: var(--cf-gray-800);
  overflow-y: auto;  /* replaces slimScroll from pcoded.min.js */
}

/* Sidebar logo */
.cf-sidebar-logo {
  height: 36px;
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

.navbar-collapsed .cf-sidebar-logo {
  height: 30px;
  margin-right: 0;
}

.navbar-collapsed .b-title {
  display: none;
}

/* Brand title */
.pcoded-navbar .b-brand .b-title {
  color: var(--cf-accent);
  font-weight: 700;
}

/* Nav items */
.pcoded-navbar .pcoded-inner-navbar > li > a {
  color: var(--cf-text-secondary);
}

.pcoded-navbar .pcoded-inner-navbar > li > a:hover {
  color: var(--cf-text-primary);
}

/* Active item with green accent */
.pcoded-navbar .pcoded-inner-navbar > li.active > a,
.pcoded-navbar .pcoded-inner-navbar > li:focus > a {
  color: var(--cf-accent);
  background: rgba(57, 255, 20, 0.05);
}

.pcoded-navbar .pcoded-inner-navbar > li.active > a .pcoded-micon,
.pcoded-navbar .pcoded-inner-navbar > li:focus > a .pcoded-micon {
  color: var(--cf-accent);
}

/* Active item left accent bar */
.pcoded-navbar .pcoded-inner-navbar > li.active {
  position: relative;
}

.pcoded-navbar .pcoded-inner-navbar > li.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 3px;
  height: calc(100% - 10px);
  background: var(--cf-accent);
  border-radius: 0 2px 2px 0;
}

/* Icon colors */
.pcoded-navbar .pcoded-inner-navbar > li .pcoded-micon {
  color: var(--cf-text-secondary);
}

.pcoded-navbar .pcoded-inner-navbar > li:hover > a .pcoded-micon {
  color: var(--cf-text-primary);
}

/* Menu caption */
.pcoded-navbar .pcoded-menu-caption label {
  color: var(--cf-text-muted);
}

/* Submenu (admin) */
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu {
  display: block;
  background: var(--cf-gray-900);
  max-height: 0;
  padding: 0;
  overflow: hidden;
  transition: max-height var(--cf-transition-normal), padding var(--cf-transition-normal);
}

.pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu.pcoded-trigger > .pcoded-submenu {
  display: block;
  max-height: 500px;
  padding: 15px 0;
}

.pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu a {
  color: var(--cf-text-secondary);
}

.pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu a:hover {
  color: var(--cf-accent);
}

.pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li.active > a {
  color: var(--cf-accent);
}

/* Mobile menu hamburger */
.pcoded-navbar .mobile-menu span,
.pcoded-navbar .mobile-menu span:after,
.pcoded-navbar .mobile-menu span:before {
  background: var(--cf-text-secondary);
}

/* ==========================================================================
   Section 16: Auth pages (gym photo background + dark card)
   ========================================================================== */

.body-style {
  background: url('../images/gym-bg.jpg') no-repeat center center fixed;
  background-size: cover;
}

/* Dark overlay to ensure text readability over photo */
.body-style .auth-wrapper::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.auth-wrapper .auth-content {
  z-index: 5;
}

/* Dark card on auth pages */
.auth-wrapper .card {
  background-color: rgba(30, 30, 48, 0.85);
  backdrop-filter: blur(var(--cf-glass-blur));
  -webkit-backdrop-filter: blur(var(--cf-glass-blur));
  border: 1px solid var(--cf-glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Solid fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  .auth-wrapper .card {
    background-color: var(--cf-surface);
  }
}

.auth-wrapper .card h3 {
  color: var(--cf-text-primary);
}

.auth-wrapper a,
.auth-wrapper p > a {
  color: var(--cf-accent-soft);
  font-weight: 600;
}

.auth-wrapper a:hover,
.auth-wrapper p > a:hover {
  color: var(--cf-accent);
}

.auth-wrapper hr {
  border-top-color: var(--cf-border);
}

/* Logo positioning and sizing */
.cf-auth-logo {
  position: relative;
  z-index: 5;
}

.cf-auth-logo-img {
  height: 140px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

/* Auth input-group icon prefix styling */
.auth-wrapper .input-group-text {
  background-color: var(--cf-input-bg);
  border-color: var(--cf-input-border);
  color: var(--cf-text-secondary);
  transition: border-color var(--cf-transition-fast), color var(--cf-transition-fast);
}

.auth-wrapper .input-group:focus-within .input-group-text {
  border-color: var(--cf-accent);
  color: var(--cf-accent);
}

.auth-wrapper .input-group .form-control {
  background-color: var(--cf-input-bg);
  border-color: var(--cf-input-border);
  color: var(--cf-text-primary);
}

.auth-wrapper .input-group .form-control:focus {
  border-color: var(--cf-accent);
  box-shadow: var(--cf-input-focus-shadow);
}

/* Override Datta Able auth-icon gradient */
.auth-wrapper .auth-icon:before {
  background: var(--cf-accent);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Auth message text styling */
.auth-wrapper .cf-auth-message {
  color: var(--cf-text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

/* ==========================================================================
   Section 17: Bottom Tab Bar (mobile navigation)
   ========================================================================== */

.cf-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--cf-gray-800);
  border-top: 1px solid var(--cf-border);
  z-index: 1030;
  justify-content: space-around;
  align-items: center;
}

.cf-tab-bar__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 6px 0;
  color: var(--cf-text-secondary);
  text-decoration: none;
  font-size: 0.625rem;
  transition: color var(--cf-transition-fast);
}

.cf-tab-bar__tab i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.cf-tab-bar__tab--active {
  color: var(--cf-accent);
}

.cf-tab-bar__tab:hover {
  color: var(--cf-text-primary);
  text-decoration: none;
}

/* ==========================================================================
   Section 18: Responsive Navigation (sidebar/tab bar switch at 992px)
   ========================================================================== */

/* Mobile: hide sidebar, show tab bar, adjust main container */
@media (max-width: 991px) {
  .cf-tab-bar {
    display: flex;
  }

  .pcoded-main-container {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .cf-header-logo {
    height: 40px;
  }
}

/* ==========================================================================
   Section 19: Page fade-in animation
   ========================================================================== */

@keyframes cf-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-wrapper {
  animation: cf-fade-in 0.4s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .page-wrapper {
    animation: none;
  }
}

/* ==========================================================================
   Section 20: Glassmorphism components
   ========================================================================== */

.cf-glass-card {
  background: var(--cf-glass-bg);
  backdrop-filter: blur(var(--cf-glass-blur));
  -webkit-backdrop-filter: blur(var(--cf-glass-blur));
  border: 1px solid var(--cf-glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: var(--cf-radius-md);
}

@supports not (backdrop-filter: blur(1px)) {
  .cf-glass-card {
    background-color: var(--cf-surface);
  }
}

/* ==========================================================================
   Section 21: Card hover micro-interactions
   ========================================================================== */

/* Generic clickable card lift. Do NOT add to elements that already have
   hover transforms (e.g. .news-card:hover in Section 6 has translateY(-5px)). */
.cf-card-clickable {
  transition: transform var(--cf-transition-fast), box-shadow var(--cf-transition-fast);
  cursor: pointer;
}

.cf-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .cf-card-clickable:hover {
    transform: none;
  }
}

/* ==========================================================================
   Section 22: Neon glow enhancements
   ========================================================================== */

/* Active sidebar item glow (extends existing accent bar from Section 15) */
.pcoded-navbar .pcoded-inner-navbar > li.active > a {
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

/* Tab bar active glow */
.cf-tab-bar__tab--active {
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
}

/* Outline button glow on hover (secondary, info, outline variants) */
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.3);
}

/* ==========================================================================
   Section 23: Status pulse animations
   ========================================================================== */

@keyframes cf-pulse-success {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 83, 45, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(20, 83, 45, 0); }
}

@keyframes cf-pulse-warning {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 171, 64, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(255, 171, 64, 0); }
}

@keyframes cf-pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(255, 82, 82, 0); }
}

.cf-status-success {
  animation: cf-pulse-success 3s ease-in-out infinite;
}

.cf-status-warning {
  animation: cf-pulse-warning 2s ease-in-out infinite;
}

.cf-status-danger {
  animation: cf-pulse-danger 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cf-status-success,
  .cf-status-warning,
  .cf-status-danger {
    animation: none;
  }
}

/* ==========================================================================
   Section 24: Score card accent treatment
   ========================================================================== */

/* Glassmorphism + neon green border for the dashboard score card.
   Replaces cf-gradient-block on the score card for a distinct hero treatment. */
.cf-score-card {
  background: var(--cf-glass-bg);
  backdrop-filter: blur(var(--cf-glass-blur));
  -webkit-backdrop-filter: blur(var(--cf-glass-blur));
  border: 1px solid var(--cf-accent);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.15), 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: var(--cf-radius-md);
}

@supports not (backdrop-filter: blur(1px)) {
  .cf-score-card {
    background: linear-gradient(135deg, var(--cf-gradient-start) 0%, var(--cf-gradient-end) 100%);
  }
}

/* ==========================================================================
   Section 25: Page-specific dark fixes
   ========================================================================== */

/* --- .btn-light override (reservation create/detail cancel buttons) ---
   Datta Able .btn-light is #f8f9fa which is near-white on dark backgrounds.
   Override to a dark-surface variant matching .btn-secondary palette. */
.btn-light {
  background-color: var(--cf-gray-600);
  border-color: var(--cf-gray-500);
  color: var(--cf-text-primary);
}

.btn-light:hover,
.btn-light:focus {
  background-color: var(--cf-gray-500);
  border-color: var(--cf-gray-400);
  color: var(--cf-text-primary);
}

.btn-light:not(:disabled):not(.disabled):active,
.btn-light:not(:disabled):not(.disabled).active {
  background-color: var(--cf-gray-500);
  border-color: var(--cf-gray-400);
  color: var(--cf-text-primary);
}

/* --- <mark> tag override (reservation.html search highlight) ---
   Browser default <mark> is yellow bg + black text. Replace with
   semi-transparent accent green for dark theme consistency. */
mark {
  background-color: rgba(57, 255, 20, 0.15);
  color: var(--cf-text-primary);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* --- Datta Able .text-c-green override ---
   Datta Able sets color: #1de9b6 (teal). Override to match our
   accent-soft green for brand consistency across ingress pages. */
.text-c-green {
  color: var(--cf-accent-soft) !important;
}

/* --- Nav tab dark treatment (dashboard subscription tabs) ---
   Ensure nav-tabs blend with the dark theme. */
.nav-tabs {
  border-bottom-color: var(--cf-border);
}

.nav-tabs .nav-link {
  color: var(--cf-text-secondary);
}

.nav-tabs .nav-link:hover {
  border-color: var(--cf-border) var(--cf-border) transparent;
  color: var(--cf-text-primary);
}

.nav-tabs .nav-link.active {
  background-color: var(--cf-card-bg);
  border-color: var(--cf-border) var(--cf-border) var(--cf-card-bg);
  color: var(--cf-accent);
}

/* --- Tab content background (dashboard subscription detail panes) --- */
.tab-content {
  background-color: var(--cf-card-bg);
  border: 1px solid var(--cf-border);
  border-top: none;
  border-radius: 0 0 var(--cf-radius-sm) var(--cf-radius-sm);
  padding: 1rem;
}

/* ==========================================================================
   Section 26: Dashboard components
   ========================================================================== */

/* Status badge (DASH-02) */
.cf-status-badge {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.cf-status-badge--healthy {
  background: var(--cf-status-success);
  color: #6ee7b7;
}

.cf-status-badge--expiring {
  background: var(--cf-status-warning);
  color: #fbbf24;
}

.cf-status-badge--expired {
  background: var(--cf-status-danger);
  color: #fca5a5;
}

/* Dashboard stat card (DASH-01) */
.cf-dash-stat {
  text-align: center;
  padding: 1rem 0.75rem;
}

.cf-dash-stat .cf-dash-stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cf-text-primary);
  line-height: 1.2;
}

.cf-dash-stat .cf-dash-stat__label {
  font-size: 0.75rem;
  color: var(--cf-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Subscription switcher (QUICK-29) */
.cf-sub-switcher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cf-sub-switcher__label {
  color: var(--cf-text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.cf-sub-switcher__pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cf-sub-pill {
  background: var(--cf-card-bg, rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--cf-text-secondary);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cf-sub-pill:hover {
  background: rgba(255,255,255,0.1);
  color: var(--cf-text-primary, #fff);
}

.cf-sub-pill--active {
  background: var(--cf-accent);
  border-color: var(--cf-accent);
  color: #fff;
}

.cf-sub-pill--active:hover {
  background: var(--cf-accent);
  color: #fff;
}

/* Quick-action card (DASH-04) */
.cf-quick-action {
  text-align: center;
  padding: 1rem;
  border-radius: var(--cf-radius-md);
}

.cf-quick-action i {
  color: var(--cf-accent);
  margin-bottom: 0.5rem;
  display: block;
  font-size: 1.5rem;
}

.cf-quick-action h6 {
  color: var(--cf-text-primary);
  margin-bottom: 0;
}

/* Next reservation card (DASH-03) */
.cf-next-reservation {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.cf-next-reservation i {
  color: var(--cf-accent);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cf-next-reservation__info h6 {
  margin-bottom: 0.25rem;
  color: var(--cf-text-primary);
}

.cf-next-reservation__info small {
  color: var(--cf-text-secondary);
}

/* Ingress stats compact card (DASH-05) */
.cf-ingress-stats {
  padding: 1rem;
}

.cf-ingress-stats__metric {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.cf-ingress-stats__metric span:first-child {
  color: var(--cf-text-secondary);
}

.cf-ingress-stats__metric span:last-child {
  color: var(--cf-text-primary);
  font-weight: 600;
}

/* Timeline (DASH-06) */
.cf-timeline {
  position: relative;
  padding-left: 2rem;
}

.cf-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--cf-border);
}

.cf-timeline-item {
  position: relative;
  padding-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.cf-timeline-item:last-child {
  padding-bottom: 0;
}

.cf-timeline-item__icon {
  position: absolute;
  left: -2rem;
  top: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--cf-surface);
  border: 2px solid var(--cf-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-timeline-item__icon i {
  font-size: 0.6rem;
  color: var(--cf-accent);
}

.cf-timeline-item__content {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.cf-timeline-item__title {
  color: var(--cf-text-primary);
  font-size: 0.875rem;
}

.cf-timeline-item__time {
  color: var(--cf-text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Type-specific dot colors */
.cf-timeline-item--reservation .cf-timeline-item__icon {
  border-color: var(--cf-accent);
}

.cf-timeline-item--ingress .cf-timeline-item__icon {
  border-color: #60a5fa;
}

.cf-timeline-item--gift .cf-timeline-item__icon {
  border-color: #f472b6;
}

.cf-timeline-item--reservation .cf-timeline-item__icon i { color: var(--cf-accent); }
.cf-timeline-item--ingress .cf-timeline-item__icon i { color: #60a5fa; }
.cf-timeline-item--gift .cf-timeline-item__icon i { color: #f472b6; }

/* Staggered entrance animation (DASH-08) */
.cf-dash-card {
  opacity: 0;
  animation: cf-fade-in 0.5s ease-out forwards;
}

.cf-dash-card:nth-child(1) { animation-delay: 0.05s; }
.cf-dash-card:nth-child(2) { animation-delay: 0.1s; }
.cf-dash-card:nth-child(3) { animation-delay: 0.15s; }
.cf-dash-card:nth-child(4) { animation-delay: 0.2s; }
.cf-dash-card:nth-child(5) { animation-delay: 0.25s; }
.cf-dash-card:nth-child(6) { animation-delay: 0.3s; }
.cf-dash-card:nth-child(7) { animation-delay: 0.35s; }
.cf-dash-card:nth-child(8) { animation-delay: 0.4s; }

/* Counter elements start at 0, JS fills in */
.cf-counter {
  display: inline-block;
  min-width: 1ch;
}

/* ==========================================================================
   Section 26b: News Carousel (QUICK-12)
   ========================================================================== */

/* === QUICK-12: News Carousel === */
.cf-news-carousel {
  border-radius: 12px;
  overflow: hidden;
  background: var(--cf-surface, #1e1e1e);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.cf-news-carousel .carousel-indicators {
  position: relative;
  bottom: auto;
  margin: 0.5rem 0;
  left: 0;
  z-index: 2;
}

.cf-news-carousel .carousel-indicators li {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  border: none;
  margin: 0 4px;
}

.cf-news-carousel .carousel-indicators li.active {
  background-color: var(--cf-accent, #4CAF50);
}

.cf-news-slide {
  color: inherit;
  padding: 1.25rem;
}

.cf-news-slide__img-wrap {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.cf-news-slide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cf-news-slide__img-wrap--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 2rem;
  color: var(--cf-accent-muted, #999);
}

.cf-news-slide__body {
  text-align: left;
}

.cf-news-slide__title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  color: #fff;
}

.cf-news-slide__excerpt {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.35rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cf-news-slide__meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.cf-news-carousel__link {
  display: block;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--cf-accent, #4CAF50);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cf-news-carousel__link:hover {
  color: var(--cf-accent-soft, #66BB6A);
  text-decoration: none;
  background: rgba(var(--cf-accent-rgb, 76, 175, 80), 0.05);
}

@media (min-width: 768px) {
  .cf-news-slide__img-wrap {
    height: 200px;
  }
}

/* ==========================================================================
   Section 27: Page exit transition (TRNS-01)
   ========================================================================== */

body {
  transition: opacity 0.2s ease-out;
}

body.cf-page-exit {
  opacity: 0;
  pointer-events: none; /* Prevent interaction during fade-out */
}

/* ==========================================================================
   Section 28: Scroll-reveal animation (TRNS-02)
   ========================================================================== */

.cf-scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.cf-scroll-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Section 29: Staggered card entrance (TRNS-03)
   ========================================================================== */

.cf-stagger-item {
  opacity: 0;
  transform: translateY(20px);
}

.cf-stagger-container--visible .cf-stagger-item {
  animation: cf-fade-in 0.5s ease-out forwards;
}

.cf-stagger-container--visible .cf-stagger-item:nth-child(1)  { animation-delay: 0.05s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(2)  { animation-delay: 0.1s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(3)  { animation-delay: 0.15s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(4)  { animation-delay: 0.2s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(5)  { animation-delay: 0.25s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(6)  { animation-delay: 0.3s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(7)  { animation-delay: 0.35s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(8)  { animation-delay: 0.4s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(9)  { animation-delay: 0.45s; }
.cf-stagger-container--visible .cf-stagger-item:nth-child(10) { animation-delay: 0.5s; }

/* ==========================================================================
   Section 30: PDF viewer overlay (PDF-01, PDF-02, PDF-03)
   ========================================================================== */

.cf-pdf-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;  /* Above tab bar (1030) and sidebar */
  background: var(--cf-gray-900);
  display: flex;
  flex-direction: column;
}

.cf-pdf-viewer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--cf-gray-800);
  border-bottom: 1px solid var(--cf-gray-600);
  flex-shrink: 0;
}

.cf-pdf-viewer__btn {
  background: transparent;
  border: 1px solid var(--cf-gray-500);
  color: var(--cf-gray-100);
  border-radius: 4px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.cf-pdf-viewer__btn:hover {
  background: var(--cf-gray-600);
  border-color: var(--cf-gray-400);
}

.cf-pdf-viewer__btn:active {
  background: var(--cf-gray-500);
}

.cf-pdf-viewer__nav,
.cf-pdf-viewer__zoom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-pdf-viewer__page-info {
  color: var(--cf-gray-200);
  font-size: 0.85rem;
  min-width: 100px;
  text-align: center;
  white-space: nowrap;
}

.cf-pdf-viewer__canvas-container {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.cf-pdf-viewer__canvas-container canvas {
  max-width: none;  /* Allow canvas to exceed container for zoom */
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.cf-pdf-viewer__loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ==========================================================================
   Section 31: Reduced motion -- master override (TRNS-04)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  body.cf-page-exit {
    transition: none;
    opacity: 1;
  }

  .cf-scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cf-stagger-item {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .cf-pdf-viewer__btn {
    transition: none;
  }

  /* Dashboard entrance stagger (DASH-08) -- consolidated from Section 26 */
  .cf-dash-card {
    opacity: 1;
    animation: none;
  }
}

/* ===================================================
   Section 32: PWA Install Banner
   =================================================== */
#pwa-install-banner {
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 0 12px 12px;
  transition: bottom 0.3s ease;
}

#pwa-install-banner.pwa-install-visible {
  bottom: 0;
}

/* Offset above tab bar on mobile */
@media (max-width: 991px) {
  #pwa-install-banner {
    bottom: -100px;
  }
  #pwa-install-banner.pwa-install-visible {
    bottom: 60px;
  }

  body.pwa-banner-visible .pcoded-main-container {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    /* 60px tab bar + ~60px PWA banner */
  }
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cf-card-bg, #1e1e1e);
  border: 1px solid var(--cf-border, #2d2d2d);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.4);
  max-width: 480px;
  margin: 0 auto;
}

.pwa-install-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-install-text strong {
  display: block;
  color: var(--cf-text, #e0e0e0);
  font-size: 0.95rem;
}

.pwa-install-text span {
  display: block;
  color: var(--cf-text-muted, #999);
  font-size: 0.8rem;
  margin-top: 2px;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-accept {
  background: var(--cf-accent, #00e676);
  color: #121212;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.pwa-install-dismiss {
  background: transparent;
  border: none;
  color: var(--cf-text-muted, #999);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* ==========================================================================
   Section 33: Django Admin dark overrides
   --------------------------------------------------------------------------
   Overrides hardcoded light colors from Django's admin base.css, forms.css,
   and widgets.css. Loaded via admin/base_site.html extrastyle block so it
   cascades after Django's own stylesheets.
   ========================================================================== */

/*
 * 33-A: Override Django admin CSS custom properties
 * -------------------------------------------------
 * Django 4.1+ defines its own --body-bg, --body-fg, --hairline-color, etc.
 * Reassigning them at :root gives us dark values across the entire admin
 * without fighting individual selectors.
 */
:root {
  --body-fg: var(--cf-text-primary);
  --body-bg: var(--cf-bg);
  --body-quiet-color: var(--cf-text-secondary);
  --body-loud-color: var(--cf-white);

  --header-color: var(--cf-accent);
  --header-branding-color: var(--cf-accent);
  --header-bg: var(--cf-gray-800);
  --header-link-color: var(--cf-text-primary);

  --breadcrumbs-fg: var(--cf-text-secondary);
  --breadcrumbs-link-fg: var(--cf-text-primary);
  --breadcrumbs-bg: var(--cf-gray-800);

  --link-fg: var(--cf-accent-soft);
  --link-hover-color: var(--cf-accent);
  --link-selected-fg: var(--cf-accent-soft);

  --hairline-color: var(--cf-border);
  --border-color: var(--cf-border);

  --error-fg: var(--cf-red-500);

  --message-success-bg: var(--cf-status-success);
  --message-warning-bg: var(--cf-status-warning);
  --message-error-bg: var(--cf-status-danger);

  --darkened-bg: var(--cf-surface-elevated);
  --selected-bg: var(--cf-gray-600);
  --selected-row: var(--cf-gray-600);

  --button-fg: var(--cf-white);
  --button-bg: var(--cf-gray-600);
  --button-hover-bg: var(--cf-gray-500);
  --default-button-bg: var(--cf-accent-soft);
  --default-button-hover-bg: var(--cf-accent);
  --close-button-bg: var(--cf-gray-500);
  --close-button-hover-bg: var(--cf-gray-400);
  --delete-button-bg: #ba2121;
  --delete-button-hover-bg: #a41515;

  --object-tools-fg: var(--cf-white);
  --object-tools-bg: var(--cf-gray-500);
  --object-tools-hover-bg: var(--cf-gray-400);

  --primary: var(--cf-accent-soft);
  --secondary: var(--cf-gray-600);
  --accent: var(--cf-accent);
}

/*
 * 33-B: Form labels and text
 */
#container label {
  color: var(--cf-text-secondary);
}

#container .required label,
#container label.required {
  color: var(--cf-text-primary);
}

#container .help,
#container p.help,
#container div.help {
  color: var(--cf-text-muted);
}

/*
 * 33-C: Form rows and structure
 */
#container .form-row {
  border-bottom-color: var(--cf-border);
}

#container .aligned label {
  color: var(--cf-text-secondary);
}

/*
 * 33-D: Admin-specific input overrides
 * (forms.css targets bare type selectors, not .form-control)
 */
#container input[type="text"],
#container input[type="email"],
#container input[type="password"],
#container input[type="number"],
#container input[type="url"],
#container input[type="tel"],
#container select,
#container textarea {
  color: var(--cf-text-primary);
  background-color: var(--cf-input-bg);
  border: 1px solid var(--cf-input-border);
}

#container input[type="text"]:focus,
#container input[type="email"]:focus,
#container input[type="password"]:focus,
#container input[type="number"]:focus,
#container input[type="url"]:focus,
#container input[type="tel"]:focus,
#container select:focus,
#container textarea:focus {
  border-color: var(--cf-accent);
  box-shadow: var(--cf-input-focus-shadow);
  outline: none;
}

/*
 * 33-E: Submit row
 */
#container .submit-row {
  background: var(--cf-surface-elevated);
  border-color: var(--cf-border);
}

#container .submit-row input {
  color: var(--cf-white);
}

#container .submit-row a.deletelink {
  background: #ba2121;
  color: var(--cf-white);
}

#container .submit-row a.deletelink:hover {
  background: #a41515;
}

#container .submit-row a.closelink {
  background: var(--cf-gray-500);
  color: var(--cf-white);
}

#container .submit-row a.closelink:hover {
  background: var(--cf-gray-400);
}

/*
 * 33-F: Collapsed fieldsets
 */
#container fieldset.collapsed {
  border-color: var(--cf-border);
}

#container fieldset.collapsed h2 {
  background: var(--cf-surface-elevated);
  color: var(--cf-text-primary);
}

/*
 * 33-G: Inline groups
 */
#container .inline-group div.add-row,
#container .inline-group .tabular tr.add-row td {
  color: var(--cf-text-secondary);
  background: var(--cf-surface-elevated);
  border-bottom-color: var(--cf-border);
}

#container .inline-related h3 {
  color: var(--cf-text-secondary);
  background: var(--cf-surface-elevated);
  border-top-color: var(--cf-border);
  border-bottom-color: var(--cf-border);
}

#container .inline-related fieldset {
  background: var(--cf-bg);
}

#container .inline-related fieldset.module h3 {
  background: var(--cf-gray-600);
  color: var(--cf-text-primary);
}

/*
 * 33-H: Selector / filter widgets (widgets.css overrides)
 */
#container .selector select {
  background-color: var(--cf-input-bg) !important;
  color: var(--cf-text-primary);
}

#container .selector-available h2,
#container .selector-chosen h2 {
  border-color: var(--cf-border);
}

#container .selector .selector-available h2 {
  background: var(--cf-surface-elevated);
  color: var(--cf-text-secondary);
}

#container .selector-chosen h2 {
  background: var(--cf-gray-600);
  color: var(--cf-text-primary);
}

#container .selector .selector-filter {
  background: var(--cf-surface);
  border-color: var(--cf-border);
  color: var(--cf-text-secondary);
}

#container .selector .selector-filter input {
  background-color: var(--cf-input-bg);
  color: var(--cf-text-primary);
  border: 1px solid var(--cf-input-border);
}

#container .selector ul.selector-chooser {
  background-color: var(--cf-gray-600);
}

#container .stacked ul.selector-chooser {
  background-color: var(--cf-gray-600);
}

#container .selector-chosen .list-footer-display {
  background: var(--cf-accent-soft);
  color: var(--cf-gray-900);
  border-color: var(--cf-border);
}

#container a.selector-chooseall,
#container a.selector-clearall {
  color: var(--cf-text-secondary);
}

#container a.active.selector-chooseall:focus,
#container a.active.selector-clearall:focus,
#container a.active.selector-chooseall:hover,
#container a.active.selector-clearall:hover {
  color: var(--cf-accent-soft);
}

/*
 * 33-I: Date/time shortcuts and calendar widgets
 */
#container .datetimeshortcuts a {
  color: var(--cf-accent-soft);
}

#container .datetimeshortcuts a:hover {
  color: var(--cf-accent);
}

#container .calendarbox,
#container .clockbox {
  background: var(--cf-surface);
  color: var(--cf-text-primary);
  border-color: var(--cf-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

#container .calendar table {
  background: var(--cf-surface);
}

#container .calendar caption,
#container .calendarbox h2 {
  color: var(--cf-gray-900);
  background: var(--cf-accent);
}

#container .calendar th {
  background: var(--cf-surface-elevated);
  border-bottom-color: var(--cf-border);
  color: var(--cf-text-secondary);
}

#container .calendar td {
  border-top-color: var(--cf-border);
}

#container .calendar td a,
#container .timelist a {
  color: var(--cf-text-secondary);
}

#container .calendar td a:hover,
#container .timelist a:hover {
  background: var(--cf-accent-soft);
  color: var(--cf-gray-900);
}

#container .calendar td a:active,
#container .timelist a:active {
  background: var(--cf-accent);
  color: var(--cf-gray-900);
}

#container .calendar td.selected a {
  background: var(--cf-accent-soft);
  color: var(--cf-gray-900);
}

#container .calendar td.nonday {
  background: var(--cf-surface-elevated);
}

#container .calendar-shortcuts {
  background: var(--cf-surface);
  color: var(--cf-text-secondary);
  border-top-color: var(--cf-border);
}

#container .calendar-cancel {
  background: var(--cf-gray-500);
  border-top-color: var(--cf-border);
  color: var(--cf-white);
}

#container .calendar-cancel:hover {
  background: var(--cf-gray-400);
}

#container .calendarnav {
  color: var(--cf-text-muted);
}

/*
 * 33-J: Django admin changelist CSS overrides
 */
#container #changelist-filter {
  background: var(--cf-surface);
  color: var(--cf-text-primary);
}

#container #changelist-filter h2 {
  color: var(--cf-text-primary);
}

#container #changelist-filter h3 {
  color: var(--cf-text-secondary);
  border-bottom-color: var(--cf-border);
}

#container #changelist-filter li.selected a {
  color: var(--cf-accent);
}

#container .paginator {
  color: var(--cf-text-secondary);
  background: var(--cf-surface-elevated);
  border-top-color: var(--cf-border);
}

#container #changelist table thead th {
  background: var(--cf-surface-elevated);
  color: var(--cf-text-primary);
  border-bottom-color: var(--cf-border);
}

#container #changelist table thead th a {
  color: var(--cf-text-primary);
}

#container #changelist .results table tbody tr:hover {
  background: var(--cf-gray-600);
}

/*
 * 33-K: Object tools (History, View on site buttons)
 */
#container .object-tools a {
  background: var(--cf-gray-500);
  color: var(--cf-white);
}

#container .object-tools a:hover {
  background: var(--cf-gray-400);
}

/*
 * 33-L: Error styling in forms
 */
#container .errorlist li {
  color: var(--cf-red-500);
}

#container .errornote {
  background: var(--cf-status-danger);
  color: var(--cf-red-500);
  border-color: var(--cf-red-500);
}

#container ul.errorlist {
  color: var(--cf-red-500);
}

/*
 * 33-M: Readonly fields
 */
#container .readonly,
#container div.readonly {
  color: var(--cf-text-primary);
}

/*
 * 33-N: Admin action bar (change list)
 */
#container .actions select {
  background-color: var(--cf-input-bg);
  color: var(--cf-text-primary);
  border-color: var(--cf-input-border);
}

#container .actions label {
  color: var(--cf-text-secondary);
}

#container .actions .button {
  background: var(--cf-gray-500);
  color: var(--cf-white);
  border: none;
}

#container .actions .button:hover {
  background: var(--cf-gray-400);
}

/*
 * 33-O: Related widget wrapper (add/edit popups)
 */
#container .related-widget-wrapper a {
  color: var(--cf-accent-soft);
}

#container .related-widget-wrapper a:hover {
  color: var(--cf-accent);
}

/*
 * 33-P: Admin nav sidebar
 */
#container #nav-sidebar {
  background: var(--cf-surface);
}

#container #nav-sidebar .module caption {
  background: var(--cf-surface-elevated);
  color: var(--cf-text-primary);
}

#container #nav-sidebar .module th {
  background: var(--cf-surface);
}

#container #nav-sidebar .module th a {
  color: var(--cf-text-primary);
}

#container #nav-sidebar .current-app th a {
  color: var(--cf-accent);
}

#container #nav-filter {
  background: var(--cf-input-bg);
  color: var(--cf-text-primary);
  border-color: var(--cf-input-border);
}

/*
 * 33-Q: Module headers (admin index and inline section headers)
 */
#container .module > h2,
#container .module caption {
  background: var(--cf-surface-elevated);
  color: var(--cf-text-primary);
}

#container .module > table > thead th {
  background: var(--cf-surface-elevated);
  color: var(--cf-text-secondary);
}

/*
 * 33-R: Admin messages
 */
#container .messagelist li.success {
  background: var(--cf-status-success);
  color: var(--cf-green-300);
}

#container .messagelist li.warning {
  background: var(--cf-status-warning);
  color: var(--cf-orange-500);
}

#container .messagelist li.error {
  background: var(--cf-status-danger);
  color: var(--cf-red-500);
}

/*
 * 33-S: Skip-to-content and footer
 */
#container #footer {
  color: var(--cf-text-muted);
}

/*
 * 33-T: Dark mode override -- disable Django's built-in dark mode toggle
 * since we are always dark.
 */
#container .theme-toggle {
  display: none;
}

/* ==========================================================================
   Section 34: Landing & Activities
   --------------------------------------------------------------------------
   Styles for the public landing page and activity cards used on both the
   landing page and the dashboard (non-configured user view).
   Uses glassmorphism approach from Section 16 (auth) and Section 20 (glass).
   ========================================================================== */

/* --- Landing page layout --- */
.cf-landing {
  position: relative;
  z-index: 1;
  color: var(--cf-text-primary);
}

/* --- Hero section --- */
.cf-landing-hero {
  text-align: center;
  padding: 2rem 1.5rem 2rem;
}

.cf-landing-hero__logo {
  max-width: 120px;
  margin-bottom: 1rem;
  border-radius: var(--cf-radius-md);
}

.cf-landing-hero__title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--cf-text-primary);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.cf-landing-hero__tagline {
  color: var(--cf-text-secondary);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.cf-landing-hero__cta {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* --- Landing sections --- */
.cf-landing-section {
  padding: 2rem 0;
}

.cf-landing-section__title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cf-text-primary);
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  width: 100%;
}

.cf-landing-section__title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--cf-accent);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* --- Activity cards (shared between landing and dashboard) --- */
.cf-activity-card {
  background: var(--cf-glass-bg);
  backdrop-filter: blur(var(--cf-glass-blur));
  -webkit-backdrop-filter: blur(var(--cf-glass-blur));
  border: 1px solid var(--cf-glass-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border-radius: var(--cf-radius-md);
  padding: 1.5rem;
  text-align: center;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cf-activity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(57, 255, 20, 0.1);
}

@supports not (backdrop-filter: blur(1px)) {
  .cf-activity-card {
    background-color: var(--cf-surface);
  }
}

.cf-activity-card__icon {
  font-size: 2rem;
  color: var(--cf-accent);
  margin-bottom: 0.75rem;
}

.cf-activity-card__name {
  font-weight: 600;
  color: var(--cf-text-primary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.cf-activity-card__desc {
  font-size: 0.875rem;
  color: var(--cf-text-secondary);
  margin-bottom: 0;
}

/* --- Highlights row (landing page) --- */
.cf-highlights {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.cf-highlight-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 140px;
  max-width: 280px;
  background: var(--cf-glass-bg);
  backdrop-filter: blur(var(--cf-glass-blur));
  -webkit-backdrop-filter: blur(var(--cf-glass-blur));
  border: 1px solid var(--cf-glass-border);
  border-radius: var(--cf-radius-md);
  padding: 1.25rem 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

@supports not (backdrop-filter: blur(1px)) {
  .cf-highlight-item {
    background-color: var(--cf-surface);
  }
}

.cf-highlight-item__icon {
  color: var(--cf-accent-soft);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.cf-highlight-item__name {
  font-weight: 600;
  color: var(--cf-text-primary);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.cf-highlight-item__desc {
  font-size: 0.85rem;
  color: var(--cf-text-secondary);
  margin-bottom: 0;
}

/* --- Info banner (dashboard non-configured user) --- */
.cf-info-banner {
  background: var(--cf-surface-elevated);
  border-left: 4px solid var(--cf-accent);
  padding: 1rem;
  border-radius: var(--cf-radius-md);
  margin-bottom: 1.5rem;
  color: var(--cf-text-primary);
  display: flex;
  align-items: center;
}

/* --- Landing footer --- */
.cf-landing-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--cf-glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--cf-text-muted);
  font-size: 0.85rem;
}

.cf-landing-footer a {
  color: var(--cf-accent-soft);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.cf-landing-footer a:hover {
  color: var(--cf-accent);
}

.cf-landing-footer p {
  margin-bottom: 0;
}

/* --- Reduced motion: disable activity card hover lift --- */
@media (prefers-reduced-motion: reduce) {
  .cf-activity-card {
    transition: none;
  }
  .cf-activity-card:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ==========================================================================
   Section 35: Social Notifications (heart icon dropdown)
   ========================================================================== */

/* --- Override Datta Able header dropdown defaults for notif icon --- */
/* Kill the feather-icon caret arrow on all header dropdowns */
.pcoded-header .dropdown .dropdown-toggle:after {
  display: none !important;
}
#cf-notif-dropdown .dropdown-toggle {
  position: relative;
  padding-right: 0;
}

/* Heart icon in navbar — match feather icon sizing from settings cog */
.cf-notif-heart {
  font-size: 18px;            /* match feather icon-settings size */
  color: var(--cf-text-secondary);
  transition: color .2s ease;
  vertical-align: middle;
}
.cf-notif-heart--active {
  color: var(--cf-red-500, #ff5252);
  animation: cf-heart-pulse 1.5s ease-in-out infinite;
}
@keyframes cf-heart-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .cf-notif-heart--active { animation: none; }
}

/* Badge counter — anchored to the dropdown-toggle (position:relative) */
.cf-notif-badge {
  position: absolute;
  top: 22px;
  right: -8px;
  font-size: .6rem;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  pointer-events: none;
}

/* Dropdown menu */
.cf-notif-menu {
  width: 340px;
  max-height: 440px;
  overflow: hidden;
  padding: 0;
  margin-top: 0;
  background: var(--cf-card-bg, #1e1e2f);
  border: 1px solid var(--cf-border, #2d2d44);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* Dropdown header */
.cf-notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cf-border, #2d2d44);
}
.cf-notif-head h6 {
  color: var(--cf-text-primary);
  margin: 0;
}
.cf-notif-mark-all {
  color: var(--cf-accent);
  font-size: .8rem;
  text-decoration: none;
}

/* Notification list */
.cf-notif-body {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

/* Single notification item */
.cf-notif-item {
  border-bottom: 1px solid var(--cf-border, #2d2d44);
}
.cf-notif-item--unread {
  background: rgba(var(--cf-accent-rgb, 0,200,150), .06);
}

/* Button-as-link for notification click */
.cf-notif-link-form {
  margin: 0;
}
.cf-notif-link-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  gap: 10px;
}
.cf-notif-link-btn:hover {
  background: rgba(255,255,255,.04);
}

/* Avatar circle */
.cf-notif-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--cf-accent, #00c896);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
}

/* Notification text */
.cf-notif-content {
  flex: 1;
  min-width: 0;
}
.cf-notif-text {
  margin: 0;
  font-size: .85rem;
  color: var(--cf-text-primary);
  line-height: 1.3;
}
.cf-notif-time {
  color: var(--cf-text-muted, #888);
  font-size: .75rem;
}

/* Empty state */
.cf-notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--cf-text-muted, #888);
  font-size: .85rem;
}

/* Footer */
.cf-notif-footer {
  padding: 10px 16px;
  text-align: center;
  border-top: 1px solid var(--cf-border, #2d2d44);
}
.cf-notif-footer a {
  color: var(--cf-accent);
  font-size: .85rem;
  text-decoration: none;
}
.cf-notif-footer a:hover {
  text-decoration: underline;
}

/* Full-page notification card */
.cf-notif-card {
  transition: border-left .2s ease;
  border-left: 3px solid transparent;
}
.cf-notif-card--unread {
  border-left-color: var(--cf-accent, #00c896);
  background: rgba(var(--cf-accent-rgb, 0,200,150), .04);
}

/* Mobile: use fixed positioning to avoid any parent overflow issues */
@media only screen and (max-width: 991px) {
  .pcoded-header #cf-notif-dropdown.dropdown.show {
    position: static !important;
  }
  .pcoded-header #cf-notif-dropdown .cf-notif-menu {
    position: fixed !important;
    top: 70px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: 340px !important;
    margin: 0 !important;
    z-index: 1050;
  }
}
