/**
 * Affilion Capital - Modern Crypto Affiliate Stylesheet
 * Dark-first, High-conversion Fintech Theme
 */

:root {
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #172136;
  --bg-surface: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(16, 185, 129, 0.25);
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-purple: #8b5cf6;
  --accent-gold: #f59e0b;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6 {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: #38bdf8;
}

/* Gradients */
.text-gradient {
  background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-purple {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Dark Theme Text Colors & Muted Overrides */
.text-muted {
  color: #94a3b8 !important; /* Tailwind Slate-400 - high contrast readability */
}
.text-slate-light {
  color: #cbd5e1 !important;
}
.text-cyan {
  color: #06b6d4 !important;
}
.text-emerald {
  color: #10b981 !important;
}


/* Navbar */
.navbar-custom {
  background-color: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.55rem 0;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.navbar-brand {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #06b6d4, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}
.nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  transition: all 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  color: #ffffff !important;
}

/* Crypto Live Ticker Bar */
.crypto-ticker-bar {
  background: #070a10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0;
  font-size: 0.82rem;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.ticker-container::-webkit-scrollbar {
  display: none;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #94a3b8;
  font-family: monospace;
}
.ticker-up {
  color: #10b981;
}
.ticker-down {
  color: #ef4444;
}

/* Cards */
.card-crypto {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card-crypto:hover {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.6);
  transform: translateY(-2px);
}
.card-crypto-body {
  padding: 1.5rem;
}

/* Feature & Stat Cards */
.stat-card {
  background: linear-gradient(145deg, #111827 0%, #0d1322 100%);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.stat-card-gold::after {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
}
.stat-card-purple::after {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.stat-icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.stat-icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.stat-icon-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.stat-icon-gold {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Custom Buttons */
.btn-primary-crypto {
  background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
  transition: all 0.2s ease;
}
.btn-primary-crypto:hover {
  background: linear-gradient(135deg, #0891b2 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.btn-outline-crypto {
  background: transparent;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 500;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  transition: all 0.2s ease;
}
.btn-outline-crypto:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Forms */
.form-control-crypto {
  background-color: #0d1322 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control-crypto:focus {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2) !important;
  background-color: #0e1627 !important;
}
.form-control-crypto::placeholder {
  color: #64748b;
}

.form-select-crypto {
  background-color: #0d1322 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-radius: 10px;
  padding: 0.7rem 1rem;
}
.form-select-crypto:focus {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2) !important;
}

/* Tables */
.table-crypto {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-main);
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
}
.table-crypto th {
  background-color: #0d1322;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.table-crypto td {
  padding: 1.1rem 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
  white-space: nowrap;
}
.table-crypto td.text-wrap,
.table-crypto th.text-wrap {
  white-space: normal;
}
.table-crypto tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Modals */
.modal-content-crypto {
  background-color: #111827;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: #ffffff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.modal-header-crypto {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1.5rem;
}
.modal-footer-crypto {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1.5rem;
}

/* Portal Sidebar & Layout - Responsive Fintech System */
.portal-layout {
  display: flex;
  width: 100%;
  max-width: 100vw;
  min-height: calc(100vh - 56px);
  position: relative;
  font-size: 0.88rem; /* Clean 14px base typography for dashboard */
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Compact Desktop Sidebar */
.portal-sidebar {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
  background-color: #0c121e;
  border-right: 1px solid var(--border-color);
  flex: 0 0 230px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
@media (min-width: 992px) {
  .portal-sidebar {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
  }
  .portal-sidebar::-webkit-scrollbar {
    width: 4px;
  }
  .portal-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }
  .portal-sidebar::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
  }
  .portal-sidebar::-webkit-scrollbar-thumb:hover {
    background: #334155;
  }
  .portal-main {
    width: calc(100% - 230px) !important;
    max-width: calc(100% - 230px) !important;
    flex: 1 1 auto;
  }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .portal-sidebar {
    width: 215px;
    min-width: 215px;
    max-width: 215px;
    flex: 0 0 215px;
  }
  .sidebar-link {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    margin: 0.1rem 0.4rem;
    gap: 0.45rem;
  }
  .portal-main {
    width: calc(100% - 215px) !important;
    max-width: calc(100% - 215px) !important;
    padding: 1rem 1rem 2rem !important;
  }
}

/* Sidebar Links */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.8rem;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 6px;
  margin: 0.1rem 0.5rem;
  transition: all 0.15s ease;
}
.sidebar-link:hover, .sidebar-link.active {
  background-color: rgba(6, 182, 212, 0.12);
  color: #38bdf8;
}
.sidebar-link.active {
  border-left: 3px solid #06b6d4;
  color: #ffffff;
  font-weight: 600;
}

/* Main Dashboard Canvas & Container - Fluid & Adaptive */
.portal-main {
  flex-grow: 1;
  padding: 1.25rem 1.5rem 2.5rem;
  background-color: var(--bg-dark);
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}
.portal-container {
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}
@media (min-width: 1600px) {
  .portal-main {
    padding: 1.5rem 2.5rem 3rem;
  }
}

/* Portal Typography Scaling - Crisp & Compact */
.portal-layout h1, .portal-layout .h1 { font-size: clamp(1.2rem, 1.8vw, 1.45rem) !important; line-height: 1.25; font-weight: 700; }
.portal-layout h2, .portal-layout .h2 { font-size: clamp(1.1rem, 1.6vw, 1.3rem) !important; line-height: 1.25; }
.portal-layout h3, .portal-layout .h3 { font-size: clamp(1.0rem, 1.4vw, 1.15rem) !important; line-height: 1.3; }

.portal-layout h4, .portal-layout .h4 { font-size: 0.95rem !important; }
.portal-layout h5, .portal-layout .h5 { font-size: 0.88rem !important; }
.portal-layout h6, .portal-layout .h6 { font-size: 0.82rem !important; }
.portal-layout .display-4,
.portal-layout .display-5,
.portal-layout .display-6 {
  font-size: 1.45rem !important;
  line-height: 1.25 !important;
}
.portal-layout .lead { font-size: 0.92rem !important; }
.portal-layout .small, .portal-layout small { font-size: 0.8rem; }

/* Portal Cards - Compact Padding & Radius */
.portal-layout .card-crypto {
  border-radius: 10px;
}
.portal-layout .card-crypto.p-4 {
  padding: 1.15rem !important;
}
.portal-layout .card-crypto.p-3 {
  padding: 0.85rem 1rem !important;
}
.portal-layout .card-crypto-body {
  padding: 1rem;
}

/* Portal Stat Cards - Dense & Proportional */
.portal-layout .stat-card {
  padding: 0.95rem 1.15rem;
  border-radius: 10px;
}
.portal-layout .stat-card::after {
  width: 55px;
  height: 55px;
}
.portal-layout .stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
}
.portal-layout .stat-card .fs-4 {
  font-size: 1.25rem !important;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
}

/* Portal Tables - High-Density Clean Rows */
.portal-layout .table-crypto th {
  padding: 0.6rem 0.8rem;
  font-size: 0.74rem;
}
.portal-layout .table-crypto td {
  padding: 0.65rem 0.8rem;
  font-size: 0.84rem;
}

/* Portal Forms & Inputs */
.portal-layout .form-control-crypto,
.portal-layout .form-select-crypto {
  padding: 0.42rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 7px;
}
.portal-layout .form-label {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

/* Portal Buttons */
.portal-layout .btn {
  padding: 0.38rem 0.8rem;
  font-size: 0.83rem;
  border-radius: 7px;
}
.portal-layout .btn-sm {
  padding: 0.22rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 5px;
}

/* Portal Spacing Controls */
.portal-layout .mb-4 {
  margin-bottom: 1.15rem !important;
}
.portal-layout .mb-5 {
  margin-bottom: 1.35rem !important;
}
.portal-layout .row.g-4 {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}
.portal-layout .row.g-3 {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.75rem;
}

/* Portal Modals - Compact */
.portal-layout .modal-content-crypto,
.modal-content-crypto {
  border-radius: 12px;
}
.portal-layout .modal-header-crypto,
.modal-header-crypto {
  padding: 0.85rem 1.15rem;
}
.portal-layout .modal-footer-crypto,
.modal-footer-crypto {
  padding: 0.85rem 1.15rem;
}

/* Badges */
.badge-cpa {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.badge-revshare {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-hybrid {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Hero Section & Video Background */
.hero-wrapper {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
  background-color: #070a12;
}
.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.hero-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0.32;
  filter: saturate(1.2) contrast(1.15);
}
.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(10, 14, 23, 0.72) 0%, rgba(10, 14, 23, 0.90) 65%, rgba(10, 14, 23, 0.98) 100%);
  z-index: 1;
}
.hero-glow-1 {
  position: absolute;
  top: -100px;
  left: 10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(50px);
  z-index: 2;
}
.hero-glow-2 {
  position: absolute;
  top: 20%;
  right: 5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  z-index: 2;
}

/* Hero Carousel / Slider */
.hero-carousel {
  position: relative;
  z-index: 5;
}
.hero-carousel .carousel-inner {
  padding: 1rem 0;
}
.hero-carousel .carousel-item {
  transition: opacity 0.75s ease-in-out;
}
.hero-lead,
.hero-description,
.hero-carousel .lead,
.hero-carousel p.lead {
  color: #e2e8f0 !important;
  font-size: 1.22rem !important;
  font-weight: 400;
  line-height: 1.7;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 25px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.01em;
}
.hero-carousel-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.25rem;
  padding: 0;
  list-style: none;
  z-index: 4;
}
.hero-carousel-indicators button {
  width: 32px;
  height: 4px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.25);
  border: none;
  outline: none;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0;
}
.hero-carousel-indicators button.active {
  width: 54px;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}
.hero-carousel-control {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 5;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-carousel-control:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: #06b6d4;
  color: #38bdf8;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}
.hero-carousel-control.prev {
  left: -20px;
}
.hero-carousel-control.next {
  right: -20px;
}
@media (max-width: 991.98px) {
  .hero-carousel-control {
    display: none;
  }
}

/* Offer Logo placeholder / thumbnail */
.offer-logo-box {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* Footer */
.footer-custom {
  background-color: #070a10;
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  color: #94a3b8;
  font-size: 0.9rem;
}
.footer-title {
  color: #ffffff;
  font-weight: 600;
  margin-bottom: 1.25rem;
  font-size: 1rem;
}
.footer-link {
  color: #94a3b8;
  display: block;
  margin-bottom: 0.6rem;
  transition: color 0.2s ease;
}
.footer-link:hover {
  color: #38bdf8;
}

/* ==========================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   ========================================================== */

/* Prevent background scroll when mobile sidebar drawer is open */
body.sidebar-open {
  overflow: hidden !important;
}

/* Responsive Table Enhancements */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}
.table-responsive::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
.table-responsive .table-crypto {
  min-width: 680px;
}
.table-responsive .table-crypto.table-wide {
  min-width: 820px;
}

/* Tablet & Mobile Breakpoint (< 992px) */
@media (max-width: 991.98px) {
  /* Public Navbar Collapse Styling */
  .navbar-collapse {
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 0.75rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
  }
  .navbar-nav .nav-link {
    padding: 0.65rem 1rem !important;
    border-radius: 8px;
    margin-bottom: 0.2rem;
  }
  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    background-color: rgba(6, 182, 212, 0.12);
    color: #ffffff !important;
  }

  /* Portal Layout: Mobile Slide-over Drawer */
  .portal-layout {
    display: block;
  }
  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 86vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1055;
    background-color: #0d1322;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border-color);
  }
  .portal-sidebar.show {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
  }
  .portal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .portal-backdrop.show {
    opacity: 1;
    visibility: visible;
  }
  .portal-main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.25rem 0.85rem;
  }
}


/* Tablets and Mobile (< 768px) */
@media (max-width: 767.98px) {
  /* Prevent iOS Safari auto-zoom on input focus */
  .form-control,
  .form-select,
  .form-control-crypto,
  .form-select-crypto,
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  textarea {
    font-size: 16px !important;
  }

  h1, .h1 { font-size: 1.65rem; }
  h2, .h2 { font-size: 1.45rem; }
  h3, .h3 { font-size: 1.25rem; }
  h4, .h4 { font-size: 1.15rem; }
  
  .display-4 { font-size: 2.15rem !important; line-height: 1.2 !important; }
  .display-5 { font-size: 1.85rem !important; line-height: 1.25 !important; }
  .display-6 { font-size: 1.6rem !important; line-height: 1.25 !important; }
  .hero-lead, .hero-description, .lead { font-size: 1.05rem !important; line-height: 1.55 !important; }

  .stat-card {
    padding: 1rem;
    border-radius: 12px;
  }
  .stat-card .fs-4 {
    font-size: 1.25rem !important;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
  }

  .card-crypto {
    border-radius: 12px;
    padding: 1.2rem !important;
  }
  .card-crypto-body {
    padding: 1rem;
  }

  .hero-wrapper {
    padding: 3rem 0 2rem;
  }
  .hero-glow-1, .hero-glow-2 {
    display: none; /* improve rendering speed on mobile devices */
  }

  .table-crypto th,
  .table-crypto td {
    padding: 0.75rem 0.85rem;
    font-size: 0.85rem;
  }
  .table-crypto th {
    font-size: 0.75rem;
  }

  .footer-custom {
    padding: 2.5rem 0 1.5rem;
  }
}

/* Extra Small Mobile (< 576px) */
@media (max-width: 575.98px) {
  .navbar-custom {
    padding: 0.5rem 0;
  }
  .brand-text {
    font-size: 1.05rem;
  }
  .navbar-brand {
    font-size: 1.1rem;
    gap: 0.35rem;
  }
  .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }

  .card-crypto {
    padding: 1rem !important;
    border-radius: 10px;
  }

  .stat-card {
    padding: 0.85rem;
  }
  .stat-card .fs-4 {
    font-size: 1.1rem !important;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .form-control-crypto,
  .form-select-crypto {
    padding: 0.6rem 0.85rem;
  }
  .btn-primary-crypto,
  .btn-outline-crypto {
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
  }
  .btn-lg {
    padding: 0.65rem 1.25rem !important;
    font-size: 1rem !important;
    width: 100%;
  }

  /* Modals on small phones */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  .modal-body {
    padding: 1rem !important;
  }
  .modal-header,
  .modal-footer {
    padding: 0.85rem 1rem !important;
  }

  /* Dropdown menus on small screens */
  .dropdown-menu {
    max-width: calc(100vw - 1.5rem);
  }

  /* Crypto Ticker Bar */
  .crypto-ticker-bar {
    font-size: 0.75rem;
    padding: 0.3rem 0;
  }

  .portal-main {
    padding: 0.85rem 0.5rem;
  }
}

/* ==========================================================================
   Floating Telegram Chat Button (Left Side)
   ========================================================================== */
.telegram-float-btn {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  color: #ffffff !important;
  padding: 0.55rem 1rem 0.55rem 0.65rem;
  border-radius: 50px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 8px 24px rgba(34, 158, 217, 0.45), 0 0 0 0 rgba(42, 171, 238, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  animation: telegramPulse 2.6s infinite;
}

.telegram-float-btn:hover,
.telegram-float-btn:focus {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(34, 158, 217, 0.65);
  color: #ffffff !important;
}

.telegram-float-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.telegram-float-label {
  white-space: nowrap;
  letter-spacing: 0.01em;
}

@keyframes telegramPulse {
  0% {
    box-shadow: 0 8px 24px rgba(34, 158, 217, 0.45), 0 0 0 0 rgba(42, 171, 238, 0.55);
  }
  70% {
    box-shadow: 0 8px 24px rgba(34, 158, 217, 0.45), 0 0 0 12px rgba(42, 171, 238, 0);
  }
  100% {
    box-shadow: 0 8px 24px rgba(34, 158, 217, 0.45), 0 0 0 0 rgba(42, 171, 238, 0);
  }
}

@media (max-width: 575.98px) {
  .telegram-float-btn {
    left: 14px;
    bottom: 14px;
    padding: 0.5rem;
    border-radius: 50%;
  }
  .telegram-float-label {
    display: none;
  }
  .telegram-float-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    font-size: 1.45rem;
  }
}
