:root,
:root[data-theme="dark"] {
  --primary: #0047AB;
  --primary-dark: #003580;
  --primary-light: #2d6ac5;
  --secondary: #F4C430;
  --secondary-dark: #d4a520;
  --secondary-light: #ffd966;
  --bg-dark: #0a0e1a;
  --bg-card: #141829;
  --bg-card-hover: #1a1f35;
  --border: #1f2937;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-heading: #f9fafb;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  --header-bg: linear-gradient(135deg, #0a0e1a 0%, #1a2332 100%);
  --hero-bg: linear-gradient(135deg, #0f1623 0%, #1a2838 100%);
  --feature-bg: linear-gradient(135deg, var(--bg-card) 0%, #1a2030 100%);
}

:root[data-theme="light"] {
  --primary: #0047AB;
  --primary-dark: #003580;
  --primary-light: #2d6ac5;
  --secondary: #F4C430;
  --secondary-dark: #d4a520;
  --secondary-light: #ffd966;
  --bg-dark: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f5;
  --border: #dee2e6;
  --text: #212529;
  --text-muted: #6c757d;
  --text-heading: #000000;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.15);
  --header-bg: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  --hero-bg: linear-gradient(135deg, #f0f4f8 0%, #ffffff 100%);
  --feature-bg: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

ul, ol, li, p {
  color: var(--text);
}

header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 6px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

/* Auto-hide header on scroll */
header.header-hidden {
  transform: translateY(-100%);
}

header nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

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

header a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

header a:hover {
  color: var(--primary);
}

header a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

header a:hover::after {
  width: 100%;
}

header a.active::after {
  width: 100%;
  background: var(--primary);
  height: 3px;
}

header a.active {
  color: var(--primary);
}

/* Dropdown Navigation - Inline with other links */
.nav-dropdown {
  position: relative;
  display: inline-block;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  border-radius: 0 !important;
}

.nav-dropdown-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.3s ease;
  font-family: inherit;
  position: relative;
  outline: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
}

.nav-dropdown-toggle:focus {
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
}

.nav-dropdown-toggle:active {
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
}

.nav-dropdown-toggle:hover {
  background: transparent !important;
  box-shadow: none !important;
}

.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.nav-dropdown-toggle:hover {
  color: var(--primary);
}

.nav-dropdown-toggle:hover::after {
  width: 100%;
}

.nav-dropdown.open .nav-dropdown-toggle {
  color: var(--primary);
}

.nav-dropdown.open .nav-dropdown-toggle::after {
  width: 100%;
}

.dropdown-label {
  letter-spacing: 0.3px;
}

.dropdown-chevron {
  font-size: 0.7rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  margin-left: 0.15rem;
}

.nav-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.nav-dropdown-menu a:last-child {
  border-bottom: none;
}

.nav-dropdown-menu a:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
  padding-left: 1.25rem;
}

.nav-dropdown-menu a::after {
  display: none;
}

.menu-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.menu-text {
  flex: 1;
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown-toggle,
  .nav-dropdown-menu,
  .nav-dropdown-menu a,
  .dropdown-chevron {
    transition: none !important;
    animation: none !important;
  }
}

.theme-toggle {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-size: 1.25rem;
}

.theme-toggle:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.theme-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem 2rem;
  width: 100%;
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

h3 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--shadow-lg);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--feature-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 12px 24px var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero {
  text-align: center;
  padding: 0.5rem 2rem 4rem 2rem;
  background: transparent;
  border-radius: 20px;
  margin-bottom: 3rem;
  border: none;
}

.hero h2 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 2rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
}

button,
.btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(0, 71, 171, 0.3);
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 71, 171, 0.5);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

button:active,
.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 71, 171, 0.2);
}

.form-container {
  max-width: 450px;
  margin: 2rem auto;
  background: var(--bg-card);
  padding: 3rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px var(--shadow-lg);
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.deal-item {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.deal-item summary {
  box-shadow: 0 2px 4px var(--shadow);
}

.deal-item summary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.deal-item[open] summary {
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

.deal-item[open] > div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  animation: slideDown 0.3s ease;
}

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

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

.deal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
}

.status-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-prospect { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.status-kyc { background: rgba(251, 191, 36, 0.2); color: #f59e0b; }
.status-docs { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.status-inspection { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.status-payment { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.status-closed { background: rgba(16, 185, 129, 0.2); color: #10b981; }

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.glossary-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.glossary-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.glossary-term {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.quiz-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.quiz-options {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-dark);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-option:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.quiz-option input[type="radio"] {
  width: auto;
  margin-left: 1rem;
  margin-bottom: 0;
  order: 2;
}

.quiz-option span {
  order: 1;
  flex: 1;
}

.certificate {
  background: var(--feature-bg);
  border: 4px solid var(--primary);
  border-radius: 16px;
  padding: 4rem 3rem;
  text-align: center;
  margin: 3rem auto;
  max-width: 800px;
  box-shadow: 0 12px 48px var(--shadow-lg);
}

.certificate-seal {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.lesson-card {
  background: var(--bg-card);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px var(--shadow);
}

.lesson-card h3 {
  color: var(--primary);
  margin-top: 0;
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

code {
  background: var(--bg-card-hover);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--primary);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  font-size: 0.95rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--feature-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 992px) {
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.25rem;
  }
  
  header .nav-links {
    gap: 0.75rem;
    font-size: 0.95rem;
  }
  
  .hero h2 {
    font-size: 2.5rem;
  }
  
  main {
    padding: 2rem 1rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .form-container {
    padding: 2rem 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .dashboard-grid,
  .validator-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  header nav {
    padding: 0.75rem 1rem;
  }
  
  header .nav-links {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  
  header .nav-links a {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }
  
  .hero h2 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  .certificate {
    padding: 2rem 1.5rem;
  }
  
  .certificate-seal {
    font-size: 3rem;
  }
  
  /* Mobile-specific adjustments */
  .card-grid {
    gap: 1rem;
  }
  
  .btn {
    width: 100%;
    max-width: 100%;
  }
}

/* KSI Logo Styles */
.ksi-logo {
  max-width: 200px;
  height: auto;
  mix-blend-mode: multiply;
  transition: all 0.3s ease;
}

[data-theme="dark"] .ksi-logo {
  mix-blend-mode: screen;
  filter: brightness(1.2);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.header-logo-img {
  max-width: 50px;
  height: auto;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .header-logo-img {
  mix-blend-mode: screen;
  filter: brightness(1.2);
}

.header-tagline {
  font-size: 0.65rem;
  color: rgba(0, 0, 0, 0.8);
  margin-top: -0.2rem;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}

[data-theme="dark"] .header-tagline {
  color: var(--text-heading);
  opacity: 0.9;
}

.hero-logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-logo {
  max-width: 1000px;
  height: auto;
  mix-blend-mode: normal;
  filter: none;
  background: transparent;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

[data-theme="dark"] .hero-logo {
  mix-blend-mode: normal;
  filter: none;
  background: white;
  box-shadow: 0 4px 12px rgba(244, 196, 48, 0.3);
}

/* Enhanced button styling with KSI colors */
.btn-primary-gold {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: #000000;
  font-weight: 700;
}

.btn-primary-gold:hover {
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--secondary) 100%);
  box-shadow: 0 6px 20px rgba(244, 196, 48, 0.5);
}

/* Accent colors for highlights */
.accent-gold {
  color: var(--secondary);
}

.text-royal-blue {
  color: var(--primary);
}

/* ===== HAMBURGER MOBILE MENU ===== */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger-icon {
  font-size: 2rem;
  color: var(--primary);
  transition: all 0.3s ease;
}

/* ===== COMPREHENSIVE MOBILE RESPONSIVE DESIGN ===== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
  /* Mobile Menu Toggle Button */
  .mobile-menu-toggle {
    display: block;
  }
  
  /* Navigation */
  header {
    padding: 0.75rem 1rem;
  }
  
  header nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  
  header .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-top: 0.5rem;
  }
  
  header .nav-links.is-open {
    display: flex;
  }
  
  header .nav-links a,
  .nav-dropdown {
    width: 100%;
    text-align: left;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
  }
  
  header .nav-links a:last-child {
    border-bottom: none;
  }
  
  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 0.625rem 0;
    font-size: 0.9375rem;
  }
  
  .nav-dropdown-menu {
    display: none;
    position: static;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    transform: none !important;
    box-shadow: none;
    border-left: 2px solid var(--primary);
    border-radius: 0;
    padding-left: 0.75rem;
    background: transparent;
    overflow: hidden;
  }
  
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    animation: expandDropdown 0.2s ease;
  }
  
  @keyframes expandDropdown {
    from {
      opacity: 0;
      max-height: 0;
    }
    to {
      opacity: 1;
      max-height: 500px;
    }
  }
  
  .nav-dropdown-menu a {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
  }
  
  .nav-dropdown-menu a:last-child {
    border-bottom: none;
  }
  
  /* Theme toggle */
  .theme-toggle {
    align-self: flex-start;
    margin-top: 0.5rem;
  }
  
  /* Hero section */
  .hero {
    padding: 3rem 1.5rem;
  }
  
  .hero h2 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .hero-logo {
    max-width: 360px;
  }
  
  /* Container */
  .container {
    padding: 2rem 1.5rem;
  }
  
  /* Cards */
  .card {
    padding: 1.5rem;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  /* Forms */
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .form-row .form-group {
    width: 100%;
  }
  
  /* Buttons */
  .btn-group {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Tables */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    min-width: 600px;
  }
  
  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Dashboard grids */
  .dashboard-grid,
  .validator-grid,
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Progress tracker */
  .progress-tracker {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .progress-step {
    width: 100%;
    border-left: 3px solid var(--border);
    border-top: none;
    padding-left: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .progress-step.active {
    border-left-color: var(--primary);
  }
  
  /* Deal cards */
  .deal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .deal-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .deal-actions .btn {
    width: 100%;
  }
  
  /* Quiz/Test */
  .question-card {
    padding: 1.25rem;
  }
  
  /* Certificate */
  .certificate {
    padding: 2rem 1rem;
  }
  
  .certificate-seal {
    font-size: 3rem;
  }
  
  /* Validation results */
  .validation-result {
    padding: 1.25rem;
  }
  
  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  /* Contact sections */
  .contact-section {
    padding: 1rem;
  }
  
  /* Glossary */
  .glossary-grid {
    grid-template-columns: 1fr;
  }
  
  /* Pricing dashboard */
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  /* Admin tables */
  .admin-table-container {
    overflow-x: auto;
  }
  
  .admin-table {
    min-width: 700px;
  }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
  /* Typography */
  h1 {
    font-size: 1.75rem;
    word-wrap: break-word;
  }
  
  h2 {
    font-size: 1.5rem;
    word-wrap: break-word;
  }
  
  h3 {
    font-size: 1.2rem;
  }
  
  /* Container */
  .container {
    padding: 1.5rem 1rem;
  }
  
  /* Main padding */
  main {
    padding: 0.5rem 1rem 2rem 1rem;
  }
  
  /* Cards */
  .card {
    padding: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Hero */
  .hero {
    padding: 0.5rem 1rem 2rem 1rem;
  }
  
  .hero h2 {
    font-size: 1.75rem !important;
    line-height: 1.3;
  }
  
  .hero-logo {
    max-width: 400px;
  }
  
  .hero p {
    font-size: 1rem !important;
  }
  
  /* Header */
  header h1 {
    font-size: 1.1rem;
  }
  
  header .nav-links {
    width: 100%;
    justify-content: center;
  }
  
  .header-logo-img {
    max-width: 35px;
  }
  
  /* Buttons */
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    width: 100%;
    max-width: 100%;
  }
  
  /* Button groups */
  .btn-group {
    flex-direction: column !important;
    width: 100% !important;
  }
  
  .btn-group .btn {
    width: 100% !important;
    margin: 0.25rem 0 !important;
  }
  
  /* Forms */
  .form-container {
    padding: 1.5rem 1rem;
  }
  
  /* Input fields */
  input,
  select,
  textarea {
    font-size: 16px;
    padding: 0.75rem;
  }
  
  /* Stats */
  .stat-value {
    font-size: 1.75rem;
  }
  
  .stat-label {
    font-size: 0.85rem;
  }
  
  /* Status badges */
  .status-badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }
  
  /* Tables - enable horizontal scroll */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* Index page specific */
  .index-hero-logo-section {
    padding: 1.5rem 1rem !important;
  }
  
  /* Feature cards */
  .feature-card {
    padding: 1.5rem 1rem;
  }
  
  /* Certificate */
  .certificate {
    padding: 1.5rem 0.75rem;
  }
  
  .certificate h1 {
    font-size: 1.5rem;
  }
  
  .certificate-seal {
    font-size: 2.5rem;
  }
  
  /* Validation cards */
  .validation-card {
    padding: 1rem;
  }
  
  /* Checkboxes and radios */
  .checkbox-group,
  .radio-group {
    gap: 0.75rem;
  }
  
  /* Modal dialogs */
  .modal-content {
    width: 95%;
    margin: 1rem;
    padding: 1.5rem;
  }
  
  /* Alerts */
  .alert {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  /* News cards */
  .news-section {
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .news-section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 1rem !important;
    gap: 0.5rem !important;
  }
  
  .news-section-header h2 {
    font-size: 1.2rem !important;
  }
  
  .news-section-header span {
    font-size: 0.75rem !important;
  }
  
  .news-cards {
    padding: 1rem !important;
  }
  
  .news-card {
    padding: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .news-card h3 {
    font-size: 1rem !important;
    word-break: break-word;
  }
  
  .news-card p {
    font-size: 0.9rem !important;
  }
  
  /* Pricing grid */
  .pricing-grid,
  .stats-grid,
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  /* Deal tracker */
  .deal-card,
  .contact-section {
    padding: 1rem !important;
  }
  
  /* Admin dashboard */
  .admin-card {
    padding: 1rem !important;
  }
  
  /* Time zone cards */
  .timezone-card {
    padding: 1rem !important;
    font-size: 0.9rem !important;
  }
  
  /* Glossary widget */
  .glossary-widget {
    bottom: 5rem !important;
    right: 0.5rem !important;
  }
  
  /* Templates */
  .template-card {
    padding: 1rem !important;
  }
  
  /* Validator sections */
  .validator-section {
    padding: 1rem !important;
  }
  
  /* Course content */
  .lesson-card,
  .quiz-container {
    padding: 1rem !important;
  }
  
  /* Prevent text overflow */
  p, li, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  /* Prevent horizontal scroll */
  body, html {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

/* Landscape phones and small tablets */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 2rem 1.5rem;
  }
  
  .hero h2 {
    font-size: 1.75rem;
  }
  
  .container {
    padding: 2rem 2rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn,
  button,
  a {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .btn:hover,
  a:hover {
    transform: none;
  }
  
  /* Better tap highlighting */
  * {
    -webkit-tap-highlight-color: rgba(0, 71, 171, 0.1);
  }
}

/* Print styles */
@media print {
  header,
  .theme-toggle,
  .btn,
  button {
    display: none !important;
  }
  
  .container {
    max-width: 100%;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
