:root {
  /* Brand Colors - Defined once, used throughout */
  --primary-color: #1C028E;
  --primary-dark: #15026b;
  --primary-light: #2d03b5;
  --secondary-color: #4D4C4F;
  --accent-color: #B16A06;

  /* Bootstrap Color Overrides - Use brand colors */
  --bs-primary: var(--primary-color);
  --bs-primary-rgb: 28, 2, 142;
  --bs-secondary: var(--secondary-color);
  --bs-secondary-rgb: 77, 76, 79;

  /* Text Colors */
  --text-dark: #1e293b;
  --text-light: #64748b;

  /* Background Colors */
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Gradients using brand colors */
  --gradient-primary: linear-gradient(135deg, #1C028E 0%, #2d03b5 100%);
  --gradient-secondary: linear-gradient(135deg, #4D4C4F 0%, #1C028E 100%);
  --gradient-accent: linear-gradient(135deg, #B16A06 0%, #d87d08 100%);
  --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.main-content {
  flex: 1;
  padding: 3rem 0;
}

/* Bootstrap component overrides to use brand colors (keep minimal + consistent) */
.text-primary {
  --bs-text-opacity: 1;
  color: var(--primary-color) !important;
}

.bg-primary {
  --bs-bg-opacity: 1;
  background-color: var(--primary-color) !important;
}

.border-primary {
  --bs-border-opacity: 1;
  border-color: var(--primary-color) !important;
}

/* Modern Navbar */
.navbar-modern {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-modern.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-brand i {
  font-size: 1.75rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.navbar-nav .nav-link {
  color: var(--text-dark) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-nav .nav-link:hover {
  background: var(--bg-light);
  color: var(--primary-color) !important;
  transform: translateY(-1px);
}

.navbar-nav .nav-link i {
  font-size: 1.1rem;
}

/* Enhanced dropdown (single definition) */
.dropdown-menu-modern {
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: 1rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  animation: fadeInDown 0.3s ease-out;
  z-index: 1050;
}

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

.dropdown-menu-modern .dropdown-item {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dropdown-menu-modern .dropdown-item:hover {
  background: var(--bg-light);
  color: var(--primary-color);
  transform: translateX(4px);
}

.dropdown-menu-modern .dropdown-item i {
  color: var(--primary-color);
}

.navbar-modern .dropdown-menu {
  z-index: 1050;
}

.navbar-modern .dropdown {
  position: relative;
  z-index: 1051;
}

/* Modern Cards */
.card {
  border: none;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  overflow: hidden;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  box-shadow: var(--shadow-2xl);
  transform: translateY(-8px) scale(1.02);
  background: rgba(255, 255, 255, 0.95);
}

.card-body {
  padding: 2rem;
}

.card-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-title i {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.card-text {
  color: var(--text-light);
  line-height: 1.7;
}

.hover-shadow {
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.hover-shadow:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-color);
  text-decoration: none;
}

/* Modern Buttons (single, consistent definitions) */
.btn {
  border-radius: 0.875rem;
  font-weight: 600;
  padding: 0.875rem 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 0.025em;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background-image: var(--gradient-primary);
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
  position: relative;
  z-index: 1;
}

.btn-primary:hover {
  background-image: var(--gradient-secondary);
  box-shadow: 0 8px 20px 0 rgba(99, 102, 241, 0.5);
  transform: translateY(-3px) scale(1.02);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: #fff;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}

.btn-secondary:hover {
  background-color: #3d3c3f;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
  position: relative;
  z-index: 1;
}

.btn-outline-primary:hover {
  background-image: var(--gradient-primary);
  background-color: var(--primary-color);
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px 0 rgba(99, 102, 241, 0.3);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 1rem;
}

/* Typography */
h1 {
  font-weight: 800;
  color: var(--text-dark);
  font-size: 3rem;
  margin-bottom: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.2;
  animation: fadeInUp 0.6s ease-out;
}

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

h2 {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h3 {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

h4, h5 {
  font-weight: 600;
  color: var(--text-dark);
}

/* Lists */
.list-group-item {
  border: none;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  background: var(--bg-light);
  transition: all 0.2s ease;
  animation: fadeInLeft 0.5s ease-out;
  animation-fill-mode: both;
}

.list-group-item:hover {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.list-group-item i {
  color: var(--primary-color);
  margin-right: 0.75rem;
}

ul.list-unstyled li {
  margin-bottom: 0.75rem;
}

ul.list-unstyled li a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

ul.list-unstyled li a:hover {
  color: var(--primary-dark);
  transform: translateX(4px);
}

ul.list-unstyled li a::before {
  content: "→";
  opacity: 0;
  transition: opacity 0.2s ease;
}

ul.list-unstyled li a:hover::before {
  opacity: 1;
}

/* Breadcrumbs */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 2rem;
}

.breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
}

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

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2rem;
}

/* Footer */
.footer-modern {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  padding: 3rem 0;
  margin-top: 4rem;
  box-shadow: 0 -4px 20px 0 rgba(0, 0, 0, 0.05);
  position: relative;
}

.footer-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.3;
}

.footer-modern p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Container improvements */
.container {
  max-width: 1200px;
}

/* Hero section */
.hero-section {
  text-align: center;
  padding: 3rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
  pointer-events: none;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-section .lead {
  font-size: 1.5rem;
  color: var(--text-light);
  font-weight: 400;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-section h1 {
  animation: fadeInUp 0.6s ease-out;
  position: relative;
  z-index: 1;
}

/* Shadow utilities */
.shadow-md {
  box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

/* Additional spacing */
.mb-5 {
  margin-bottom: 3rem !important;
}

.g-4 {
  gap: 1.5rem !important;
}

.g-3 {
  gap: 1rem !important;
}

/* Icon enhancements */
.bi {
  transition: transform 0.3s ease;
}

.card:hover .bi {
  transform: scale(1.1);
}

/* Gradient text effect */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Badges */
.badge {
  font-weight: 600;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.badge.bg-primary {
  background-image: var(--gradient-primary) !important;
  background-color: var(--primary-color) !important;
}

/* Images (scope hover effects to content; avoid navbar/logo) */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.main-content img {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-content img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl) !important;
}

.hero-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-image:hover {
  transform: scale(1.05);
}

.image-credit {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem 0 0 0;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
}

.card img {
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* Keep partner logos unrounded and fully visible in the overview list */
.partner-logo-wrap {
  width: 160px;
  height: 80px;
  overflow: visible;
}

.card .partner-logo {
  border-radius: 0 !important;
  object-fit: contain !important;
  width: 100%;
  height: 100%;
  box-shadow: none !important;
  transform: none !important;
  background: transparent;
}

.main-content .partner-logo:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Ensure images in containers are properly constrained */
.container img,
.col img,
[class*="col-"] img {
  max-width: 100%;
  height: auto;
}

img.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Link hover underline effect (scoped; avoid navbar/buttons/dropdowns) */
a {
  transition: all 0.2s ease;
  position: relative;
}

.main-content a:not(.btn):not(.nav-link):not(.dropdown-item)::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.main-content a:not(.btn):not(.nav-link):not(.dropdown-item):hover::after {
  width: 100%;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Apply card entrance animation only to content area (avoid modals/nav) */
.main-content .card {
  animation: fadeIn 0.6s ease-out;
  animation-fill-mode: both;
}

/* Stagger only for direct children in common grids (still best-effort) */
.main-content .card:nth-child(1) { animation-delay: 0.1s; }
.main-content .card:nth-child(2) { animation-delay: 0.2s; }
.main-content .card:nth-child(3) { animation-delay: 0.3s; }
.main-content .card:nth-child(4) { animation-delay: 0.4s; }

.list-group-item:nth-child(1) { animation-delay: 0.1s; }
.list-group-item:nth-child(2) { animation-delay: 0.2s; }
.list-group-item:nth-child(3) { animation-delay: 0.3s; }
.list-group-item:nth-child(4) { animation-delay: 0.4s; }
.list-group-item:nth-child(5) { animation-delay: 0.5s; }

/* Loading animation */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Alerts */
.alert {
  border-radius: 1rem;
  border: none;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.alert-light {
  background: rgba(255, 255, 255, 0.9);
}

.alert-success {
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.9), rgba(187, 247, 208, 0.9));
  color: #065f46;
  border-left: 4px solid #10b981;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.9), rgba(254, 202, 202, 0.9));
  color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }

  .card-body { padding: 1.5rem; }

  .main-content { padding: 2rem 0; }

  .hero-section { padding: 2rem 0 1.5rem; }

  .hero-section .lead { font-size: 1.25rem; }

  .btn { padding: 0.75rem 1.5rem; }

  .btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }

  .hero-image-wrapper { margin-top: 2rem; }

  .image-credit {
    font-size: 0.65rem;
    padding: 0.375rem 0.75rem;
  }
}

/* Reduced motion: disable animations/transitions where possible */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .btn::before { display: none !important; }
}

/* Dark mode support (optional placeholder) */
@media (prefers-color-scheme: dark) {
  /* extend later if needed */
}

/* Print styles */
@media print {
  .navbar-modern,
  .footer-modern {
    display: none;
  }
}
