/* ============================================================
   KBK Active — Premium Design Layer
   A cohesive refinement of the core design system:
   typography, depth, motion, and micro-interactions.
   Safe to load after main.css — only enhances existing classes.
   ============================================================ */

:root {
  --premium-shadow-xs: 0 1px 2px rgba(10, 22, 40, 0.06), 0 1px 1px rgba(10, 22, 40, 0.04);
  --premium-shadow-sm: 0 2px 6px rgba(10, 22, 40, 0.06), 0 1px 2px rgba(10, 22, 40, 0.05);
  --premium-shadow-md: 0 8px 24px -6px rgba(10, 22, 40, 0.12), 0 4px 10px -4px rgba(10, 22, 40, 0.06);
  --premium-shadow-lg: 0 20px 48px -12px rgba(10, 22, 40, 0.16), 0 8px 20px -8px rgba(10, 22, 40, 0.10);
  --premium-grad-brand: linear-gradient(135deg, #142b48 0%, #1a3a5c 45%, #117070 100%);
  --premium-grad-gold: linear-gradient(120deg, #b89230 0%, #d4b66a 50%, #b89230 100%);
  --premium-grad-teal: linear-gradient(135deg, #117070 0%, #158585 100%);
  --premium-ring: 0 0 0 3px rgba(21, 133, 133, 0.22);
}

/* ---------- Base polish ---------- */
html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(21, 133, 133, 0.18);
  color: var(--color-primary-800, #142b48);
}

*:focus-visible {
  outline: none;
  box-shadow: var(--premium-ring);
  border-radius: 4px;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-primary-400, #2a5280), var(--color-accent-500, #158585));
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-primary-500, #1a3a5c), var(--color-accent-600, #117070));
  background-clip: padding-box;
}

/* ---------- Typography refinement ---------- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  background: linear-gradient(180deg, var(--color-primary-800, #142b48), var(--color-primary-600, #142b48));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
  margin-bottom: var(--space-4);
}

.section-header::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 999px;
  margin: var(--space-4) auto 0;
  background: var(--premium-grad-gold);
}

.section-header-left::after {
  margin-inline: 0;
}

.section-subtitle {
  letter-spacing: 0.005em;
}

/* ---------- Navbar ---------- */
.navbar {
  transition: box-shadow 0.35s ease, background-color 0.35s ease, border-color 0.35s ease;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.86) !important;
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: var(--premium-shadow-md), 0 1px 0 rgba(10, 22, 40, 0.04);
}

[data-theme="dark"] .navbar.scrolled {
  background-color: rgba(15, 23, 42, 0.82) !important;
  box-shadow: var(--premium-shadow-lg), 0 1px 0 rgba(255, 255, 255, 0.05);
}

.navbar-logo {
  transition: transform 0.25s ease;
}
.navbar-logo:hover {
  transform: scale(1.02);
}

.navbar-link {
  position: relative;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar-link:not(.navbar-dropdown-toggle)::after {
  content: "";
  position: absolute;
  left: var(--space-2, 8px);
  right: var(--space-2, 8px);
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: var(--premium-grad-gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.navbar-link:not(.navbar-dropdown-toggle).active::after,
.navbar-link:not(.navbar-dropdown-toggle):hover::after {
  transform: scaleX(1);
}

.navbar-dropdown-toggle.active::after {
  content: "";
  position: absolute;
  left: var(--space-2, 8px);
  right: var(--space-2, 8px);
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: var(--premium-grad-gold);
}

.mega-menu {
  border-radius: 14px;
  box-shadow: var(--premium-shadow-lg);
  border: 1px solid var(--color-neutral-100, #e8e8ec);
  overflow: hidden;
}

[data-theme="dark"] .mega-menu {
  border-color: rgba(255, 255, 255, 0.08);
  background: #1e293b;
}

.mega-link {
  border-radius: 10px;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.mega-link:hover {
  transform: translateX(3px);
  box-shadow: var(--premium-shadow-sm);
}

[dir="rtl"] .mega-link:hover {
  transform: translateX(-3px);
}

.btn-primary,
.navbar-account-link {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.22), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background-image: linear-gradient(135deg, #1a3a5c 0%, #142b48 55%, #117070 130%);
  border: none;
  box-shadow: 0 10px 24px -8px rgba(20, 43, 72, 0.5);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -10px rgba(20, 43, 72, 0.55);
}

.btn-secondary {
  background-image: var(--premium-grad-gold);
  border: none;
  box-shadow: 0 10px 22px -8px rgba(184, 146, 48, 0.5);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -10px rgba(184, 146, 48, 0.55);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.45);
}
.btn-outline-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.45);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

/* ---------- Hero ---------- */
.hero-badge {
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--premium-shadow-sm);
}

.hero-badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-inline-end: 8px;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: kbk-pulse 2.2s infinite;
  vertical-align: middle;
}

@keyframes kbk-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  letter-spacing: -0.03em;
}

.hero-title-highlight {
  background: linear-gradient(100deg, #d4b66a 0%, #f1e6c5 35%, #c8a84e 70%, #d4b66a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: kbk-shimmer 6s linear infinite;
  background-size: 200% auto;
}

@keyframes kbk-shimmer {
  to { background-position: 200% center; }
}

.hero-description {
  font-size: 1.12rem;
  line-height: 1.75;
  letter-spacing: 0.005em;
}

.hero-stat-item {
  position: relative;
}

.hero-stat-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15%;
  bottom: 15%;
  inset-inline-end: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.hero-stat-value {
  letter-spacing: -0.02em;
  font-variation-settings: "wght" 700;
}

/* ---------- Cards & panels ---------- */
.news-card,
[class*="card"] {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--premium-shadow-lg);
  border-color: transparent;
  background-image: linear-gradient(180deg, var(--color-white, #fff), var(--color-primary-50, #eaf1f9));
}

[data-theme="dark"] .news-card:hover {
  background-image: linear-gradient(180deg, #1e293b, #172032);
  border-color: rgba(255, 255, 255, 0.1);
}

.news-card-image img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ---------- Article reading experience ---------- */
.article-body {
  font-size: 1.06rem;
  line-height: 1.85;
  letter-spacing: 0.002em;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin-top: 2.2rem;
  margin-bottom: 0.85rem;
  scroll-margin-top: 110px;
}

.article-body h2 {
  font-size: 1.55rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-neutral-100, #e8e8ec);
}

.article-body h3 {
  font-size: 1.25rem;
}

.article-body p {
  margin-bottom: 1.15rem;
}

.article-body a {
  color: var(--color-primary-500, #1a3a5c);
  font-weight: 600;
  text-decoration-color: rgba(21, 133, 133, 0.5);
  text-underline-offset: 3px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.15rem;
  padding-inline-start: 1.4rem;
}

.article-body li {
  margin-bottom: 0.45rem;
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-inline-start: 4px solid var(--color-accent-500, #158585);
  background: var(--color-neutral-50, #f9fafb);
  border-radius: 0 10px 10px 0;
  color: var(--color-neutral-600, #4a4a52);
  font-style: italic;
}

[dir="rtl"] .article-body blockquote {
  border-radius: 10px 0 0 10px;
  border-inline-start: none;
  border-inline-end: 4px solid var(--color-accent-500, #158585);
}

.article-body img {
  border-radius: 14px;
  box-shadow: var(--premium-shadow-md);
  margin: 1.5rem 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--premium-shadow-sm);
}

.article-body th,
.article-body td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-neutral-100, #e8e8ec);
}

.article-body th {
  background: var(--color-primary-50, #eaf1f9);
  color: var(--color-primary-800, #142b48);
  font-weight: 600;
}

.article-body code {
  background: var(--color-neutral-100, #e8e8ec);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 0.85em;
}

[data-theme="dark"] .article-body code {
  background: #1e293b;
}

/* ---------- Knowledge center listing ---------- */
.kb-listing .card,
.kb-related .card {
  border-radius: 16px;
  overflow: hidden;
}

.kb-listing .card > div:first-child {
  overflow: hidden;
}

.kb-listing .card img,
.kb-related .card img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.kb-listing .card:hover img,
.kb-related .card:hover img {
  transform: scale(1.07);
}

.kb-listing .card h3 {
  transition: color 0.2s ease;
}

.kb-listing .card:hover h3 {
  color: var(--color-accent-500, #158585);
}

.kb-listing .badge,
.kb-related .badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid transparent;
  background-image: linear-gradient(180deg, var(--color-primary-900, #060e1a) 0%, #050b14 100%);
}

.footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #b89230, #158585, #b89230);
  background-size: 200% auto;
  animation: kbk-shimmer 8s linear infinite;
}

.footer a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-heading {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.footer-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease, padding-inline-start 0.2s ease;
}

.footer-link::before {
  content: "";
  width: 0;
  height: 1px;
  background: var(--color-secondary-400, #dec888);
  transition: width 0.2s ease;
}

.footer-link:hover {
  color: var(--color-secondary-400, #dec888);
  padding-inline-start: 6px;
}

.footer-link:hover::before {
  width: 12px;
}

.social-link {
  border-radius: 10px;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.social-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -8px rgba(184, 146, 48, 0.5);
}

.footer-bottom {
  font-size: var(--text-xs, 0.75rem);
}

/* ---------- Back to top ---------- */
.back-to-top {
  border-radius: 12px;
  box-shadow: var(--premium-shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--premium-shadow-lg);
}

/* ---------- Service / solution cards ---------- */
.solution-card {
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.solution-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(21, 133, 133, 0.08), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.solution-card:hover::after {
  opacity: 1;
}

.solution-card:hover .solution-icon {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -8px rgba(21, 133, 133, 0.4);
}

.solution-icon {
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.solution-card:hover .solution-accent,
.solution-card:hover .solution-card-accent {
  transform: scaleX(1);
}

.solution-link {
  font-weight: 600;
}

.solution-link:hover .solution-link-arrow {
  transform: translateX(5px);
}
[dir="rtl"] .solution-link:hover .solution-link-arrow {
  transform: translateX(-5px);
}

/* ---------- Industry cards ---------- */
.industry-card {
  border-radius: 16px;
  overflow: hidden;
}

.industry-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--premium-shadow-lg);
}

/* ---------- Partners ---------- */
.partner-highlight {
  border-radius: 16px;
}

.partner-highlight-logo {
  border-radius: 12px;
}

/* ---------- Testimonials ---------- */
[class*="testimonial"] {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

[class*="testimonial"]:hover {
  transform: translateY(-4px);
  box-shadow: var(--premium-shadow-md);
}

/* ---------- Section badges ---------- */
.section .badge,
.section-header .badge {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: var(--premium-shadow-xs);
}

/* ---------- Service cards (services page + business solutions) ---------- */
.card-accent {
  border-radius: 16px;
}

.card-accent .feature-icon {
  border-radius: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.card-accent:hover .feature-icon {
  transform: translateY(-3px);
  box-shadow: var(--premium-shadow-md);
}

.card-accent:hover .card-title {
  color: var(--color-accent-600, #117070);
}

.card-title {
  transition: color 0.2s ease;
  letter-spacing: -0.01em;
}

/* ---------- Page headers (inner pages) ---------- */
.page-header {
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #b89230, #158585, #b89230);
  background-size: 200% auto;
  animation: kbk-shimmer 8s linear infinite;
}

.page-header-title {
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.page-header-breadcrumb a {
  transition: color 0.2s ease;
}

/* ---------- Section transitions ---------- */
.section, .section-sm, .section-lg {
  position: relative;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid transparent;
  background-image: linear-gradient(180deg, var(--color-primary-900, #060e1a) 0%, #050b14 100%);
}

.footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #b89230, #158585, #b89230);
  background-size: 200% auto;
  animation: kbk-shimmer 8s linear infinite;
}

.footer a {
  transition: color 0.2s ease, transform 0.2s ease;
}

/* ---------- Links ---------- */
a {
  transition: color 0.2s ease;
}

/* ---------- Dark mode adjustments ---------- */
[data-theme="dark"] .section-title {
  background: linear-gradient(180deg, #eaf1f9, #8ab0d6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] ::selection {
  background: rgba(77, 186, 186, 0.28);
  color: #eaf1f9;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
