/* ============================================================
   components.css — BeSecureWise
   All UI components. Depends on main.css for design tokens.

   Includes legacy variable aliases so every component works
   without touching any HTML or JS files.
   ============================================================ */


/* ============================================================
   LEGACY TOKEN ALIASES
   Maps old variable names → new design token system
   ============================================================ */

:root {
  /* Surfaces */
  --accent-bg: var(--bg-accent);
  --primary-bg: var(--bg-base);
  --secondary-bg: var(--navy-800);
  --bg-soft: rgba(15, 23, 42, 0.40);

  /* Borders */
  --border-color: var(--border-subtle);

  /* Spacing legacy names */
  --spacing-xs: var(--space-1);
  --spacing-sm: var(--space-2);
  --spacing-md: var(--space-4);
  --spacing-lg: var(--space-5);
  --spacing-xl: var(--space-6);
  --spacing-2xl: var(--space-8);

  /* Gradient aliases */
  --gradient-secondary: var(--gradient-success);

  /* Short accent alias */
  --accent: var(--sky-400);
}

/* Dynamic background color support */
.bg-dynamic {
  background: var(--dynamic-bg, rgba(255, 255, 255, 0.05));
}

.content-image.bg-dynamic {
  background: var(--dynamic-bg) !important;
}


/* ============================================================
   1. CONTENT CARDS
   ============================================================ */

/* ===============================
   CONTENT CARD IMAGE
================================ */

.content-image {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-4);
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.content-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* fallback (icon style) */
.content-image.placeholder {
  font-size: 2rem;
  color: var(--text-muted);
}

.content-image-fallback {
  position: relative;
}

.content-image-icon {
  font-size: 2.5rem;
  opacity: 0.9;
}

.content-card {
  background: var(--bg-accent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.content-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--sky-400));
  z-index: 2;
  /* 🔥 ADD THIS */
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.content-card:hover::before {
  transform: scaleX(1);
}

.content-card:hover {
  transform: var(--lift-card);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-2xl);
}

.content-card.article {
  --card-accent: var(--gradient-accent);
}

.content-card.blog-post {
  --card-accent: var(--gradient-success);
}

.content-card.journal {
  --card-accent: linear-gradient(135deg, var(--amber-400), #d97706);
}

.content-card.whitepaper {
  --card-accent: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.content-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.content-type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.content-type.article {
  background: rgba(59, 130, 246, 0.20);
  color: var(--blue-400);
}

.content-type.blog-post {
  background: rgba(16, 185, 129, 0.20);
  color: #34d399;
}

.content-type.journal {
  background: rgba(245, 158, 11, 0.20);
  color: #fbbf24;
}

.content-type.whitepaper {
  background: rgba(139, 92, 246, 0.20);
  color: #a78bfa;
}

.content-date {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.content-actions {
  display: flex;
  gap: var(--space-2);
}

.action-btn {
  padding: 6px;
  background: rgba(148, 163, 184, 0.10);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
}

.action-btn:hover {
  background: rgba(59, 130, 246, 0.20);
  color: var(--blue-400);
}

.content-card h3 {
  color: var(--text-primary);
  font-size: var(--text-lg);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.content-excerpt {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.6;
  font-size: var(--text-sm);
  max-height: 4.8em;
  overflow: hidden;
}

.content-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.content-stats {
  display: flex;
  gap: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.content-stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.read-more {
  color: var(--text-accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  transition: gap var(--transition-base);
}

.read-more:hover {
  gap: 0.75rem;
}


/* ============================================================
   2. SIDEBAR
   ============================================================ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.widget {
  background: var(--bg-accent);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.widget h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.categories-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.category-item {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-item.active {
  background: rgba(59, 130, 246, 0.20);
  color: var(--blue-400);
}

.category-item:hover {
  background: rgba(59, 130, 246, 0.10);
  color: var(--blue-400);
}

/* Sidebar category count badge */
.widget .category-count {
  background: rgba(148, 163, 184, 0.20);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

.manage-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.stats-panel,
.activity-panel {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.stat-card div {
  font-size: 1.75rem;
  font-weight: 700;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.activity-changes {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .5rem 0;
}

.activity-badge {
  padding: .25rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  background: rgba(88, 166, 255, .15);
  border: 1px solid rgba(88, 166, 255, .25);
  color: #58a6ff;
}

.stat-item {
  text-align: center;
  padding: var(--space-4);
  background: var(--bg-soft);
  border-radius: var(--radius-md);
}

.stat-number {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-heading);
  color: var(--text-accent);
  display: block;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.recent-posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.recent-post {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.recent-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-post h4 {
  color: var(--text-primary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
  line-height: 1.4;
}

.recent-post-date {
  color: var(--text-muted);
  font-size: var(--text-xs);
}


/* ============================================================
   3. FORMS
   ============================================================ */

.form-section {
  background: var(--bg-accent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}

.form-section h2 {
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  font-weight: 500;
}

.form-group label::after {
  content: ' *';
  color: var(--brand-danger);
}

.form-group label.optional::after {
  content: '';
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: rgba(15, 23, 42, 0.60);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: flex-end;
  margin-top: var(--space-6);
}

.help-text {
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.textarea-lg {
  min-height: 300px;
}

.input-hidden {
  display: none;
}


/* ============================================================
   4. FILE UPLOAD
   ============================================================ */

.file-upload {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: rgba(15, 23, 42, 0.20);
}

.file-upload:hover {
  border-color: var(--brand-primary);
  background: rgba(59, 130, 246, 0.05);
}

.file-upload.drag-over {
  border-color: var(--brand-primary);
  background: rgba(59, 130, 246, 0.10);
}

.file-upload-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.file-upload h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.file-upload p {
  color: var(--text-muted);
  margin: 0;
}

.uploaded-files {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.uploaded-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: rgba(15, 23, 42, 0.40);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.uploaded-file-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.file-icon {
  font-size: var(--text-xl);
}

.file-details h4 {
  color: var(--text-primary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.file-details p {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin: 0;
}

.file-actions {
  display: flex;
  gap: var(--space-2);
}


/* ============================================================
   5. MANAGEMENT CARDS
   ============================================================ */

.management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.management-card {
  background: var(--bg-accent);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--transition-base);
}

.management-card:hover {
  transform: var(--lift-card);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.management-card h3 {
  color: var(--text-primary);
  font-size: var(--text-md);
  margin-bottom: var(--space-4);
}

.management-card p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
  line-height: 1.5;
}


/* ============================================================
   6. TAGS
   ============================================================ */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.tag {
  background: rgba(148, 163, 184, 0.10);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all var(--transition-base);
}

.tag:hover {
  background: rgba(59, 130, 246, 0.20);
  color: var(--blue-400);
}

.article-tags {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}


/* ============================================================
   7. RATING & PROGRESS BAR
   ============================================================ */

.rating {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

.rating-stars {
  color: #fbbf24;
}

.rating-value {
  color: var(--text-muted);
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.20);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
}


/* ============================================================
   8. TOAST NOTIFICATIONS
   ============================================================ */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-accent);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  z-index: 1001;
  animation: slideInRight 0.3s ease-out;
  min-width: 260px;
}

.toast.success {
  border-left: 4px solid var(--brand-success);
}

.toast.error {
  border-left: 4px solid var(--brand-danger);
}

.toast.warning {
  border-left: 4px solid var(--brand-warning);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}


/* ============================================================
   9. TOOLTIP
   ============================================================ */

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.90);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 1000;
  pointer-events: none;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}


/* ============================================================
   10. MODAL
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.80);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--navy-800);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  width: min(94vw, 1200px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
}

/* ============================================================
   ARTICLE READING MODAL
   Larger modal specifically for reading articles/documents
   ============================================================ */

.modal.article-modal .modal-content {
  width: min(96vw, 1400px);
  padding: 2.2rem 2.6rem;
}

.modal.article-modal .modal-body {
  display: block;
}

/* Width variants */
.modal-sm,
.modal .modal-sm {
  max-width: 480px;
}

.modal-md,
.modal .modal-md {
  max-width: 520px;
}

.modal-lg,
.modal-large,
.modal .modal-lg {
  max-width: 900px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-xl);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-base), background var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.10);
}

.modal .modal-body {
  display: grid;
  gap: var(--space-6);
}

.modal-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.modal .actions {
  display: flex;
  gap: var(--space-4);
  justify-content: flex-end;
  margin-top: var(--space-5);
}

/* FULLSCREEN MODE */
/* ============================================================
   NATIVE FULLSCREEN — modal-content as the fullscreen element
   The browser's Fullscreen API puts .modal-content into true
   OS-level fullscreen. These rules style it correctly in that state.
   ============================================================ */

/* When modal-content IS the fullscreen element */
.modal-content:fullscreen,
.modal-content:-webkit-full-screen,
.modal-content:-moz-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  margin: 0;
  padding: 2rem 2.5rem;
  background: var(--navy-800);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Header: never shrinks */
.modal-content:fullscreen .modal-header,
.modal-content:-webkit-full-screen .modal-header,
.modal-content:-moz-full-screen .modal-header {
  flex-shrink: 0;
}

/* Body: fills remaining space, scrollable for articles */
.modal-content:fullscreen .modal-body,
.modal-content:-webkit-full-screen .modal-body,
.modal-content:-moz-full-screen .modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Doc viewer: fills body, no extra padding */
.modal-content:fullscreen .doc-viewer,
.modal-content:-webkit-full-screen .doc-viewer,
.modal-content:-moz-full-screen .doc-viewer {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: none;
  padding: 0;
  overflow: hidden;
}

/* iframe: fills viewer completely — !important beats the inline height style */
.modal-content:fullscreen .doc-frame,
.modal-content:-webkit-full-screen .doc-frame,
.modal-content:-moz-full-screen .doc-frame {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}

/* Stop body from scrolling behind fullscreen */
.modal-content:fullscreen .modal-body:has(.doc-viewer),
.modal-content:-webkit-full-screen .modal-body:has(.doc-viewer) {
  overflow: hidden;
}

/* All inputs inside modals */
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="email"],
.modal input[type="password"],
.modal input[type="file"],
.modal input[type="date"],
.modal select,
.modal textarea,
.modal .input {
  width: 100%;
  padding: 12px;
  background: rgba(15, 23, 42, 0.60);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}

/* Analytics stat grid inside modal */
.analytics-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: var(--space-6);
}

.analytics-stats .stat-item {
  background: rgba(15, 23, 42, 0.40);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
}

.analytics-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
}

.analytics-filters input[type="date"] {
  width: 170px;
}

/* Key-value row list */
.list-rows>div {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Toggle/checkbox row */
.setting-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Section divider inside modals */
.section-divider {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-6);
  margin-top: var(--space-2);
}


/* ============================================================
   11. USER CHIP & NAV DROPDOWN
   ============================================================ */

.nav-user {
  position: relative;
  display: flex;
  align-items: center;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-accent);
  color: var(--text-primary);
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.user-chip:hover {
  background: var(--navy-900);
  border-color: var(--border-hover);
}

.user-chip:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 2px;
}

.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px var(--border-subtle);
}

.user-chip .chev {
  font-size: var(--text-xs);
  opacity: 0.8;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--brand-success);
  box-shadow: 0 0 0 2px var(--bg-accent);
  flex-shrink: 0;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 220px;
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: #0b1220;
  box-shadow: var(--shadow-xl);
  display: none;
  z-index: 200;
}

.nav-user.open .user-dropdown {
  display: block;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: background var(--transition-fast);
}

.user-dropdown a:hover {
  background: var(--bg-accent);
}

.user-dropdown hr {
  height: 1px;
  border: none;
  background: var(--border-subtle);
  margin: 0.35rem 0.25rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .user-chip span#navName {
    display: none;
  }
}


/* ============================================================
   12. NAVBAR POLISH
   ============================================================ */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.nav-links li {
  display: flex;
  align-items: center;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.25rem;
}

.nav-links>li:last-child {
  margin-right: 0.2rem;
}

.nav-links li.has-submenu {
  display: inline-flex;
  align-items: center;
}

.nav-links li.has-submenu>a {
  padding-right: 0.1rem;
}

.nav-links li.has-submenu .submenu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
}

.nav-links li.has-submenu>a::after {
  margin-left: 0.25rem;
}


/* ============================================================
   13. CMS TABLE
   ============================================================ */

.cms-table {
  width: 100%;
  border-collapse: collapse;
}

.cms-table th,
.cms-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.cms-table th {
  background: rgba(15, 23, 42, 0.40);
  font-weight: 600;
  color: var(--text-primary);
}

.cms-table tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

.status-pill {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: capitalize;
  display: inline-block;
}

.status-published {
  background: #1f7a1f;
  color: #ffffff;
}

.status-draft,
.status-pending {
  background: #444444;
  color: #ffffff;
}


/* ============================================================
   14. AUTH MODALS (Login / Register)
   ============================================================ */

.auth-modal-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-title);
  margin-bottom: var(--space-5);
  color: var(--text-primary);
}

.auth-switch {
  margin-top: var(--space-5);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.auth-switch a {
  margin-left: 0.35rem;
  color: var(--brand-primary);
  font-weight: 500;
  transition: text-decoration var(--transition-fast);
}

.auth-switch a:hover {
  text-decoration: underline;
}

.article-meta {
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  font-size: var(--text-sm);
}

.article-excerpt {
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-style: italic;
}

.article-divider {
  border-color: var(--border-subtle);
  margin: var(--space-4) 0 var(--space-5);
}




/* ============================================================
   16. DOC VIEWER
   ============================================================ */

.doc-viewer {
  width: 100%;
  height: auto;
  max-height: 75vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: var(--navy-950);
  margin-top: var(--space-4);
  padding: var(--space-5);
}

.doc-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

#docPreview {
  max-width: 900px;
  margin: auto;
  line-height: 1.6;
  padding-bottom: var(--space-6);
}

.doc-subsection {
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
}

.doc-paragraph {
  margin-bottom: 1.1rem;
  color: var(--text-secondary);
}

.doc-link {
  margin: 0.7rem 0;
}

.doc-link a {
  color: var(--sky-400);
  text-decoration: underline;
}


/* ============================================================
   17. CALLOUT BLOCKS
   ============================================================ */

.callout {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
}

.callout.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
}

.callout.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
}


/* ============================================================
   18. READING PROGRESS BAR
   ============================================================ */

.reading-progress {
  position: sticky;
  top: 0;
  height: 3px;
  width: 100%;
  background: rgba(148, 163, 184, 0.10);
  margin-bottom: 0.8rem;
  z-index: 5;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-primary), var(--blue-400));
  transition: width 0.12s linear;
}

.reading-meta {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-bottom: var(--space-4);
  opacity: 0.85;
}

/* Tip content type badge */

.content-type.tip,
.type-tip {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1f2937;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
}


.card-media {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
 *  FEATURED ARTICLES — redesign v1
 * ============================================================ */

/* Section container */
.featured-section {
  padding: 5rem 0 4rem;
  background: var(--surface-elevated, #111827);
  border-top: 3px solid var(--brand, #00BFA5);
}

/* ── Section header ── */
.featured-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.featured-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.featured-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand, #00BFA5);
  margin: 0;
}

.featured-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary, #E8F0FE);
  margin: 0;
  line-height: 1.15;
}

.featured-view-all {
  font-size: 0.9rem;
  color: var(--brand, #00BFA5);
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.featured-view-all:hover {
  border-bottom-color: var(--brand, #00BFA5);
}

/* ── Hero article ── */
.featured-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 360px;
  max-height: 520px;
  /* prevents 16/9 from becoming 800px+ on wide screens */
  border-radius: 2rem;
  /* full bleed — no side radius */
  overflow: hidden;
  margin-bottom: 2rem;
  cursor: pointer;
  background-size: cover;
  background-position: center;
}

.featured-hero-img-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.featured-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-hero:hover .featured-hero-img {
  transform: scale(1.03);
}

.featured-hero-icon-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8%;
}

.featured-hero-icon-bg span {
  font-size: 7rem;
  opacity: 0.15;
  user-select: none;
  pointer-events: none;
}

.featured-hero-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  padding: 3rem;

  z-index: 2;
}

.featured-hero-top {
  display: flex;
  justify-content: flex-start;
}

.featured-hero-bottom {
  max-width: 700px;
}

.featured-hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand, #00BFA5);
  margin: 0;
}

.featured-hero-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  color: #fff;
}

.featured-hero-excerpt {
  color: rgba(255, 255, 255, .85);
  margin-bottom: 1.5rem;
}

.featured-hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.featured-hero-cta {
  background: var(--brand, #00BFA5);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.featured-hero-cta:hover {
  background: var(--brand-dark, #007C6E);
  transform: translateY(-1px);
}

.featured-hero-date {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.featured-hero.bg-dynamic {
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
}

.featured-hero.bg-dynamic.featured-bg-color {
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--dynamic-bg) 85%, #000),
      color-mix(in srgb, var(--dynamic-bg) 55%, #000));
}


/* ── Category badge (shared: hero + grid cards) ── */
.featured-category-badge {
  position: relative;
  display: inline-flex;
  align-items: center;

  /* Strong readable base */
  background: rgba(8, 12, 20, 0.75);
  color: #ffffff;

  /* Accent */
  border: 1px solid rgba(255, 255, 255, 0.12);

  /* Premium glass */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Depth */
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);

  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  /* pill = more modern */

  white-space: nowrap;
}

.featured-hero::after {
  content: '';
  position: absolute;
  inset: 0;

  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.15) 0%,
      rgba(0, 0, 0, 0.55) 60%,
      rgba(0, 0, 0, 0.75) 100%);

  z-index: 1;
}


.featured-category-badge.bg-light {
  background: rgba(0, 0, 0, 0.75);
}

.featured-category-badge.bg-dark {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.category-card {
  position: relative;
  overflow: hidden;

  /* Base glass */
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);

  transition: all 0.35s ease;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(circle at top left,
      color-mix(in srgb, var(--dynamic-bg) 35%, transparent),
      transparent 60%);

  opacity: 0.7;
  z-index: 0;
}


.category-card.bg-dynamic {
  position: relative;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.category-card.bg-dynamic::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--dynamic-bg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.category-card.bg-dynamic:hover {
  border-color: var(--dynamic-bg);
  box-shadow: 0 0 0 1px var(--dynamic-bg),
    0 8px 30px -8px var(--dynamic-bg);
}

.category-card.bg-dynamic:hover::before {
  transform: scaleX(1);
}

.category-card.bg-dynamic:hover {
  background: color-mix(in srgb, var(--dynamic-bg) 8%, var(--bg-accent));
}

.category-card.bg-dynamic:hover .category-icon {
  color: var(--dynamic-bg);
  text-shadow: 0 0 12px var(--dynamic-bg);
}

/* ── Featured grid ── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.featured-card {
  background: var(--surface, #1A2740);
  --card-accent: var(--dynamic-bg, var(--brand));
  border: 1px solid var(--border, #1E3A5F);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.featured-card {
  position: relative;
  --card-accent: var(--dynamic-bg, var(--brand));
}

.featured-card:hover {
  transform: translateY(-6px);

  border-color: var(--card-accent);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    0 0 0 1px var(--card-accent),
    0 0 20px color-mix(in srgb, var(--card-accent) 40%, transparent);
}

.featured-card .featured-category-badge {
  background: color-mix(in srgb, var(--card-accent) 18%, rgba(10, 15, 25, 0.85));
  border: 1px solid color-mix(in srgb, var(--card-accent) 60%, transparent);
  color: #fff;

  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.4),
    0 0 8px color-mix(in srgb, var(--card-accent) 50%, transparent);
}

/* Size hierarchy: first card gets taller image */
.featured-card:first-child .featured-card-image {
  aspect-ratio: 16 / 10;
}

.featured-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 240px;
  /* caps image when card spans full container width */
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-card:hover .featured-card-img {
  transform: scale(1.03);
}

.featured-card-icon {
  font-size: 2.5rem;
  opacity: 0.5;
  user-select: none;
  pointer-events: none;
}

.featured-card-badge {
  position: absolute;
  bottom: 0.6rem;
  left: 0.75rem;
  z-index: 2;
}

.featured-card-body {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  justify-content: space-between;
}

.featured-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #E8F0FE);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #8899AA);
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.featured-card .featured-category-badge {
  background: color-mix(in srgb, var(--card-accent) 20%, rgba(10, 15, 25, 0.9));
  border: 1px solid color-mix(in srgb, var(--card-accent) 60%, transparent);

  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.4),
    0 0 10px color-mix(in srgb, var(--card-accent) 50%, transparent);
}

/* ── Responsive ── */
@media (max-width: 1023px) {
  .featured-hero {
    aspect-ratio: 16 / 9;
  }

  .featured-hero-title {
    font-size: 1.9rem;
  }

  .featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 767px) {
  .featured-section {
    padding: 3rem 0 2.5rem;
  }

  .featured-hero {
    aspect-ratio: 4 / 3;
    border-radius: 0;
    margin-bottom: 1.5rem;
  }

  .featured-hero-title {
    font-size: 1.3rem;
  }

  .featured-hero-excerpt {
    display: none;
  }

  .featured-hero-overlay {
    padding: 1rem 1.25rem;
  }

  .featured-title {
    font-size: 1.5rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   CATEGORY EMPTY STATE
   ============================================================ */

.category-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.25);
}

.category-empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
  opacity: 0.7;
}

.category-empty-state h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.category-empty-state p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}


/* =========================================
   CSP MIGRATION UTILITIES
========================================= */

/* Flex helpers */
.inline-flex-center {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flex-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Image alignment */
.img-inline {
  vertical-align: middle;
  margin-right: 6px;
}

/* Modal sizing */
.modal-md-custom {
  max-width: 520px;
}

/* Utility spacing */
.mt-10 {
  margin-top: 10px;
}

/* Utility text */
.text-muted {
  color: var(--text-muted);
}

/* Hidden (fallback if needed) */
.hidden-inline {
  display: none;
}

.cms-muted {
  padding: 1rem;
  color: var(--text-muted);
}

.cms-error {
  padding: 1rem;
  color: #f87171;
}

.cms-image-preview {
  max-height: 120px;
  max-width: 200px;
  border-radius: 8px;
}

.cms-textarea-sm {
  height: 90px;
  resize: vertical;
}

.cms-textarea-lg {
  height: 260px;
  resize: vertical;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
}

.cms-upload-row {
  margin-top: 8px;
  display: flex;
  gap: 10px;
}

.hidden-input {
  display: none;
}

.cms-preview-container {
  margin-top: 10px;
}

.cms-image-preview {
  max-height: 120px;
  max-width: 200px;
  border-radius: 8px;
}

.cms-actions-spacing {
  margin-top: 1.25rem;
}

.cms-muted-light {
  font-weight: 400;
  color: var(--text-muted);
}

.no-scroll {
  overflow: hidden;
}

a {
  color: #38bdf8;
}

a:hover {
  color: #7dd3fc;
}

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

blockquote {
  border-left: 3px solid var(--dynamic-bg, #38bdf8);
  padding: 12px 16px;
  margin: 12px 0;

  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;

  color: #cbd5f5;
}

ol {
  padding-left: 20px;
}

ol li {
  margin-bottom: 6px;
}

button[data-share="whatsapp"] {
  font-size: 14px !important;
  color: white !important;
}

/* ============================================================
   SHARE MODAL — FINAL POLISH (Aligned with existing system)
   ============================================================ */

/* Modal container refinement */
.modal.share-modal {
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.55);
}

/* Modal box */
.modal.share-modal .modal-content {
  background: linear-gradient(180deg,
      rgba(30, 41, 59, 0.96),
      rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;

  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  overflow: hidden;
}

/* Header */
.modal.share-modal .modal-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding-bottom: 0.8rem;
}

.modal.share-modal .modal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Close button */
.modal.share-modal .modal-close {
  opacity: 0.7;
  transition: all 0.2s ease;
}

.modal.share-modal .modal-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Body spacing */
.modal.share-modal .modal-body {
  padding-top: 1rem;
}

/* Preview */
.share-preview h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.share-preview p {
  font-size: 0.9rem;
  opacity: 0.75;
}

/* Input group */
.share-input-group {
  display: flex;
  gap: 0.5rem;
}

.share-input-group input {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  color: var(--text-primary);

  transition: all 0.2s ease;
}

.share-input-group input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Copy buttons (reuse your .btn but enhance inside modal) */
.modal.share-modal button[data-copy] {
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-weight: 600;

  transition: all 0.2s ease;
}

.modal.share-modal button[data-copy]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

/* Textarea */
#shareText {
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.8rem;
  color: var(--text-primary);
}

/* Divider section */
.modal.share-modal h4 {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.85;
}

/* Share grid */
.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

/* Base share button */
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  padding: 0.7rem;
  border-radius: 12px;

  font-weight: 600;
  font-size: 0.9rem;

  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(148, 163, 184, 0.08);

  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Platform colors (non-invasive, layered over your btn system) */
.share-btn.whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
}

.share-btn.twitter {
  background: #1DA1F2;
  color: #fff;
  border: none;
}

.share-btn.linkedin {
  background: #0A66C2;
  color: #fff;
  border: none;
}

.share-btn.email {
  background: #334155;
  color: #fff;
  border: none;
}

/* Device button */
.share-device {
  width: 100%;
  padding: 0.9rem;
  border-radius: 12px;
  font-weight: 600;

  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  border: none;

  transition: all 0.2s ease;
}

.share-device:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}


/* ============================================================
   COMMENTS — MODERN UI
============================================================ */

.comments-section {
  margin-top: 3rem;
}

/* Input box */
.comment-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-box:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Individual comment */
.comment-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Avatar */
.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

/* Main content */
.comment-content {
  flex: 1;
}

/* Top row */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-time {
  opacity: 0.7;
}

/* Body */
.comment-body {
  margin-top: 0.35rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Actions */
.comment-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

.comment-action {
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.comment-action:hover {
  color: var(--brand-primary);
}

/* Like active */
.comment-action.liked {
  color: var(--brand-primary);
  font-weight: 600;
}

/* Replies (nested) */
.comment-replies {
  margin-top: 0.6rem;
  padding-left: 2.2rem;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-action.liked {
  color: var(--brand-primary);
  font-weight: 600;
}

.reply-box {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.reply-box textarea,
.reply-box input {
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: white;
}

.reply-box button {
  align-self: flex-start;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  background: var(--brand-primary);
  border: none;
  cursor: pointer;
}

.activity-item {
  padding: .75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.activity-header {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.activity-title {
  font-size: .85rem;
  margin-top: .35rem;
  color: var(--text-muted);
}

.activity-time {
  font-size: .75rem;
  opacity: .7;
  margin-top: .25rem;
}

.activity-new {
  border-left: 3px solid #4ade80;
  background: rgba(74, 222, 128, .08);
}

.activity-new .activity-time::after {
  content: " • NEW";
  color: #4ade80;
  font-weight: 700;
}