/* ================================================
   Ampleforth Network 2025 Theme
   Consolidated from three HTML mockups
   ================================================ */

/* ================================================
   BOOTSTRAP 5 CSS CUSTOM PROPERTIES OVERRIDE
   ================================================ */
:root {
  /* === BOOTSTRAP COLOR SYSTEM OVERRIDES === */
  
  /* Primary Brand Colors */
  --bs-primary: #1f2937;
  --bs-primary-rgb: 31, 41, 55;
  --bs-secondary: #6b7280;
  --bs-secondary-rgb: 107, 114, 128;
  
  /* Success/Danger for Metrics */
  --bs-success: #10b981;
  --bs-success-rgb: 16, 185, 129;
  --bs-danger: #ef4444;
  --bs-danger-rgb: 239, 68, 68;
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;
  --bs-info: #3b82f6;
  --bs-info-rgb: 59, 130, 246;
  
  /* Grayscale System */
  --bs-gray-100: #f3f4f6;
  --bs-gray-200: #e5e7eb;
  --bs-gray-300: #d1d5db;
  --bs-gray-400: #9ca3af;
  --bs-gray-500: #6b7280;
  --bs-gray-600: #4b5563;
  --bs-gray-700: #374151;
  --bs-gray-800: #1f2937;
  --bs-gray-900: #111827;
  
  /* Body & Background */
  --bs-body-bg: #f9fafb;
  --bs-body-color: #374151;
  --bs-emphasis-color: #111827;
  --bs-secondary-color: #6b7280;
  --bs-tertiary-color: #9ca3af;
  
  /* Borders */
  --bs-border-color: #e5e7eb;
  --bs-border-color-translucent: rgba(229, 231, 235, 0.6);
  
  /* === CUSTOM DASHBOARD VARIABLES === */
  
  /* Sidebar Colors */
  --sidebar-bg: #1f2937;
  --sidebar-text: #d1d5db;
  --sidebar-text-hover: #ffffff;
  --sidebar-active: #374151;
  --sidebar-border: #374151;
  
  /* License Lock Icon Colors */
  --lock-basic-color: #f59e0b;    /* Orange - Basic license */
  --lock-pro-color: #10b981;      /* Green - Pro license */  
  --lock-elite-color: #8b5cf6;    /* Purple - Elite license */
  
  /* Card System */
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  
  /* Metric Cards */
  --metric-positive: #10b981;
  --metric-negative: #ef4444;
  --metric-neutral: #6b7280;
  --metric-bg-positive: #d1fae5;
  --metric-bg-negative: #fee2e2;
  
  /* Chart Colors */
  --chart-primary: #10b981;
  --chart-secondary: #3b82f6;
  --chart-tertiary: #8b5cf6;
  --chart-quaternary: #f59e0b;
  --chart-grid: #f3f4f6;
  
  /* Typography Adjustments */
  --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-heading-color: #111827;
}

/* ================================================
   LAYOUT STRUCTURE
   ================================================ */

/* Main Layout Grid */
.dashboard-container {
  min-height: 100vh;
  background-color: var(--bs-body-bg);
}

/* Sidebar Styling */
.sidebar {
  background-color: var(--sidebar-bg);
  min-height: 100vh;
  height: 100%;
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin: 0.125rem 0.5rem;
  transition: all 0.15s ease-in-out;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: var(--sidebar-active);
  color: var(--sidebar-text-hover);
}

.sidebar .nav-link i {
  margin-right: 0.75rem;
  width: 1rem;
}

/* License Lock Icon Classes */
.lock-icon-basic {
  color: var(--lock-basic-color) !important;
}

.lock-icon-pro {
  color: var(--lock-pro-color) !important;
}

.lock-icon-elite {
  color: var(--lock-elite-color) !important;
}

/* Navigation Section Headers */
.nav-section-header {
  color: var(--sidebar-text-hover);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  padding: 0.5rem 1rem;
  margin-bottom: 0.25rem;
  opacity: 0.9;
}

/* Welcome Section */
.welcome-section {
  background-color: var(--bs-gray-800);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0.5rem;
  border: 1px solid var(--sidebar-border);
}

.welcome-section .welcome-title {
  color: var(--sidebar-text-hover);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.welcome-section .welcome-subtitle {
  color: var(--sidebar-text);
  font-size: 0.75rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.welcome-section .plan-badges {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.welcome-section .plan-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-badge.basic {
  background-color: var(--bs-warning);
  color: #000;
}

.plan-badge.pro {
  background-color: var(--bs-success);
  color: #fff;
}

.plan-badge.elite {
  background-color: #8b5cf6;
  color: #fff;
}

.welcome-section .settings-icon {
  color: var(--sidebar-text);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.15s ease-in-out;
}

.welcome-section .settings-icon:hover {
  color: var(--sidebar-text-hover);
}

/* Main Content Area */
.main-content {
  background-color: var(--bs-body-bg);
  min-height: 100vh;
  padding: 1.5rem;
  background-image: url("/Media/patterns/transparenttextures.com/bright-squares.png");
}

/* Dashboard container adjustments for mobile */
@media (max-width: 991.98px) {
  .dashboard-container .row.g-0 {
    position: relative;
  }
}

/* ================================================
   CARD COMPONENTS
   ================================================ */

/* Base Card Styling */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 0.75rem;
  transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

/* Metric Cards */
.metric-card {
  padding: 1.5rem;
}

.metric-card .metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bs-emphasis-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.metric-card .metric-label {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.metric-card .metric-change {
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.metric-change.positive {
  color: var(--metric-positive);
}

.metric-change.negative {
  color: var(--metric-negative);
}

.metric-change.neutral {
  color: var(--metric-neutral);
}

/* Chart Cards */
.chart-card {
  padding: 1.5rem;
}

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

.chart-card .chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--bs-emphasis-color);
  margin: 0;
}

.chart-card .chart-subtitle {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  margin: 0;
}

/* ================================================
   DAPP COMPONENTS (from dapps_overview_page)
   ================================================ */

/* dApp Card Specific Styling */
.dapp-card {
  height: 100%;
  transition: transform 0.15s ease-in-out;
}

.dapp-card:hover {
  transform: translateY(-2px);
}

.dapp-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 1rem;
}

.dapp-icon.token-wrapper {
  background: linear-gradient(135deg, var(--bs-info) 0%, #1e40af 100%);
}

.dapp-icon.digital-cash {
  background: linear-gradient(135deg, var(--bs-success) 0%, #059669 100%);
}

.dapp-icon.staking {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.dapp-icon.defi {
  background: linear-gradient(135deg, var(--bs-warning) 0%, #d97706 100%);
}

.dapp-icon.lending {
  background: linear-gradient(135deg, var(--bs-danger) 0%, #dc2626 100%);
}

.dapp-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--bs-secondary-color);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.dapp-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dapp-actions .btn-sm {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

/* ================================================
   RESEARCH COMPONENTS (from research_page)
   ================================================ */

/* Site Tag Badges */
.site-tag {
  background-color: var(--bs-gray-200);
  color: var(--bs-emphasis-color);
  border: none;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  margin: 0.25rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.site-tag:hover {
  background-color: var(--bs-primary);
  color: white;
}

.site-tag.active {
  background-color: var(--bs-primary);
  color: white;
}

.site-tag .count {
  background-color: rgba(255, 255, 255, 0.3);
  padding: 0.125rem 0.375rem;
  border-radius: 0.75rem;
  font-size: 0.65rem;
  margin-left: 0.25rem;
}

/* Research Article Cards */
.research-card {
  transition: transform 0.15s ease-in-out;
  height: 100%;
  cursor: pointer;
}

.research-card:hover {
  transform: translateY(-2px);
}

.research-card .card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.research-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bs-emphasis-color);
  line-height: 1.3;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.research-preview {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Featured Research Cards */
.research-featured-card {
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  border: none;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.research-featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.research-featured-image {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
}

.research-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.research-featured-card:hover .research-featured-image img {
  transform: scale(1.05);
}

.featured-overlay {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
}

.research-section-badge.featured {
  background-color: var(--bs-warning);
  color: var(--bs-dark);
  font-weight: 600;
}

.research-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.research-source {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.source-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  text-transform: uppercase;
  font-weight: bold;
}

.source-icon.medium {
  background-color: #000;
}

.source-icon.github {
  background-color: #24292e;
}

.source-icon.youtube {
  background-color: #ff0000;
}

.source-icon.twitter {
  background-color: #1da1f2;
}

.source-icon.other {
  background-color: var(--bs-gray-500);
}

.research-section-badge {
  background-color: var(--bs-info);
  color: white;
  font-size: 0.65rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.75rem;
  white-space: nowrap;
}

.research-section-badge.good-reads {
  background-color: var(--bs-success);
}

.research-section-badge.technical {
  background-color: var(--bs-warning);
  color: #000;
}

.research-section-badge.news {
  background-color: var(--bs-info);
}

/* Stats Cards */
.stat-card {
  text-align: center;
  padding: 1rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bs-emphasis-color);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  font-weight: 500;
}

/* ================================================
   DATA TABLES
   ================================================ */

.table {
  --bs-table-bg: var(--card-bg);
  --bs-table-striped-bg: #f9fafb;
  --bs-table-hover-bg: #f3f4f6;
  --bs-table-border-color: var(--bs-border-color);
}

.table th {
  background-color: var(--bs-gray-50);
  color: var(--bs-secondary-color);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 0.75rem;
  border-bottom: 2px solid var(--bs-border-color);
}

.table td {
  padding: 1rem 0.75rem;
  vertical-align: middle;
}

/* Progress Bars in Tables */
.progress-thin {
  height: 0.5rem;
}

/* ================================================
   NAVIGATION & HEADER
   ================================================ */

.navbar-brand {
  font-weight: 700;
  color: var(--bs-emphasis-color);
}

.breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 1rem;
}

.breadcrumb-item {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.breadcrumb-item.active {
  color: var(--bs-emphasis-color);
  font-weight: 500;
}

/* ================================================
   BADGES & STATUS INDICATORS
   ================================================ */

.badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

.status-indicator {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}

.status-indicator.online {
  background-color: var(--bs-success);
}

.status-indicator.offline {
  background-color: var(--bs-secondary);
}

.status-indicator.warning {
  background-color: var(--bs-warning);
}

/* ================================================
   BUTTONS & INTERACTIONS
   ================================================ */

.btn {
  font-weight: 500;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-gray-700);
  --bs-btn-hover-border-color: var(--bs-gray-700);
}

.btn-outline-secondary {
  --bs-btn-color: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-bg: var(--bs-gray-100);
}

/* ================================================
   FORM CONTROLS (from research page)
   ================================================ */

.form-control {
  border-radius: 0.375rem;
  border: 1px solid var(--bs-border-color);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(31, 41, 55, 0.25);
}

.form-select {
  border-radius: 0.375rem;
  border: 1px solid var(--bs-border-color);
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

.text-muted {
  color: var(--bs-tertiary-color) !important;
}

.text-success {
  color: var(--metric-positive) !important;
}

.text-danger {
  color: var(--metric-negative) !important;
}

.bg-success-subtle {
  background-color: var(--metric-bg-positive) !important;
}

.bg-danger-subtle {
  background-color: var(--metric-bg-negative) !important;
}

/* Small text helpers */
.fs-7 {
  font-size: 0.875rem;
}

.fs-8 {
  font-size: 0.75rem;
}

/* ================================================
   RESPONSIVE ADJUSTMENTS
   ================================================ */

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
  
  .metric-card {
    padding: 1rem;
  }
  
  .chart-card {
    padding: 1rem;
  }
  
  .metric-card .metric-value {
    font-size: 1.5rem;
  }
}

/* ================================================
   ANIMATION & TRANSITIONS
   ================================================ */

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hover-lift:hover {
  transform: translateY(-2px);
  transition: transform 0.15s ease-in-out;
}

/* ================================================
   AMPLEFORTH-SPECIFIC COMPONENTS
   ================================================ */

/* Countdown Timer */
.countdown-timer {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bs-emphasis-color);
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: 0.5rem;
  border: 2px solid var(--bs-border-color);
}

/* Hash Display */
.hash-display {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--bs-info);
  word-break: break-all;
  background-color: #f8fafc;
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--bs-border-color);
}

/* Network Statistics */
.network-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.network-stat-item:last-child {
  border-bottom: none;
}

.network-stat-label {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.network-stat-value {
  font-weight: 700;
  color: var(--bs-emphasis-color);
  text-align: right;
}

/* Status Badges for Health Monitoring */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.status-up {
  background-color: var(--metric-bg-positive);
  color: var(--metric-positive);
}

.status-down {
  background-color: var(--metric-bg-negative);
  color: var(--metric-negative);
}

.status-degraded {
  background-color: #fef3c7;
  color: var(--bs-warning);
}

/* Mobile responsive adjustments for status badges */
@media (max-width: 576px) {
  .status-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }
}