/* ============================================================
   ECMS – Executive Career Management System
   Main Stylesheet v1.0
   Author: Ashraf Ibrahim El Desoky
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  --primary:        #0a2463;
  --primary-light:  #1e3a8a;
  --primary-dark:   #06153d;
  --accent:         #1e90ff;
  --accent-hover:   #1477d6;
  --gold:           #c9a227;
  --gold-light:     #e2b94a;
  --bg:             #ffffff;
  --bg-alt:         #f0f4f8;
  --bg-card:        #ffffff;
  --text:           #1a1a2e;
  --text-muted:     #5a6a82;
  --text-light:     #8898aa;
  --border:         #d1dce8;
  --border-light:   #e8eef5;
  --shadow-sm:      0 2px 8px rgba(10,36,99,0.08);
  --shadow-md:      0 4px 20px rgba(10,36,99,0.12);
  --shadow-lg:      0 8px 40px rgba(10,36,99,0.18);
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --transition:     all 0.3s ease;
  --nav-height:     72px;
  --font-sans:      'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-display:   'Inter', 'Segoe UI', system-ui, sans-serif;
}

[data-theme="dark"] {
  --primary:        #1e3a8a;
  --primary-light:  #2563eb;
  --primary-dark:   #0f1c4d;
  --accent:         #3b9eff;
  --accent-hover:   #60b4ff;
  --gold:           #e2b94a;
  --bg:             #0d1117;
  --bg-alt:         #161b22;
  --bg-card:        #1c2333;
  --text:           #e6edf3;
  --text-muted:     #8b949e;
  --text-light:     #6e7681;
  --border:         #30363d;
  --border-light:   #21262d;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.5);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.text-accent { color: var(--accent); }
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--text-muted); }

/* ── Navigation ── */
.ecms-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(10,17,40,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  z-index: 1000;
  transition: var(--transition);
}

.ecms-nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
}

.nav-brand .brand-text { display: flex; flex-direction: column; }
.nav-brand .brand-name { font-size: 0.95rem; font-weight: 700; color: #fff; line-height: 1.2; }
.nav-brand .brand-title { font-size: 0.65rem; font-weight: 400; color: rgba(255,255,255,0.6); line-height: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-nav {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-nav-search {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-nav-search:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.btn-theme-toggle {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-theme-toggle:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Page Wrapper ── */
.page-wrapper {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ── Hero Section ── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
  padding: 5rem 0;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-credential {
  color: var(--gold-light);
  font-size: 0.85em;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: rgba(255,255,255,0.75);
  font-weight: 400;
  margin-bottom: 1.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  display: block;
}

.hero-stat-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

.hero-stat-divider {
  width: 1px;
  height: 50px;
  background: rgba(255,255,255,0.2);
  align-self: center;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 15px rgba(30,144,255,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30,144,255,0.5);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #a07818);
  color: #fff;
  box-shadow: 0 4px 15px rgba(201,162,39,0.4);
}

.btn-gold:hover {
  transform: translateY(-2px);
  color: #fff;
}

.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

/* ── Section Layout ── */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-title .accent { color: var(--accent); }
.section-title .gold   { color: var(--gold); }

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-divider {
  width: 50px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 2px;
  margin: 1rem auto 0;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(30,144,255,0.1), rgba(10,36,99,0.1));
  border: 1px solid rgba(30,144,255,0.2);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Dashboard Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

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

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  display: block;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  display: block;
}

[data-theme="dark"] .stat-value { color: var(--accent); }

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
  display: block;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--primary), var(--gold));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
  padding-left: 2rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  transform: translateX(-50%);
  transition: var(--transition);
}

.timeline-item:hover .timeline-dot {
  transform: translateX(-50%) scale(1.3);
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.timeline-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.timeline-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timeline-company .country-flag {
  font-size: 1rem;
}

.timeline-body {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* ── Tags / Badges ── */
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid;
}

.tag-primary {
  background: rgba(30,144,255,0.1);
  color: var(--accent);
  border-color: rgba(30,144,255,0.3);
}

.tag-gold {
  background: rgba(201,162,39,0.1);
  color: var(--gold);
  border-color: rgba(201,162,39,0.3);
}

.tag-success {
  background: rgba(16,185,129,0.1);
  color: #10b981;
  border-color: rgba(16,185,129,0.3);
}

.tag-muted {
  background: var(--bg-alt);
  color: var(--text-muted);
  border-color: var(--border);
}

/* ── Skills ── */
.skill-bar-group { margin-bottom: 1rem; }

.skill-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.skill-bar-track {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light));
  transition: width 1.2s ease;
  width: 0;
}

.skill-bar-fill.gold {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ── Competency Grid ── */
.competency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.competency-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.competency-item:hover {
  border-color: var(--accent);
  background: rgba(30,144,255,0.04);
}

.competency-item::before {
  content: '◆';
  color: var(--accent);
  font-size: 0.6rem;
  flex-shrink: 0;
}

/* ── Page Header ── */
.page-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 3rem 0;
  color: #fff;
}

.page-header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.page-header-icon {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.page-header h1 {
  color: #fff;
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.page-header p {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.75rem 0;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover { color: var(--accent); }

.breadcrumb-sep {
  color: var(--border);
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 600;
}

/* ── Footer ── */
.ecms-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand .brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.83rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.55);
  max-width: 280px;
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Search Modal ── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-overlay.active { display: flex; }

.search-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(700px, 90vw);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.search-input-wrap .search-icon {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-modal input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 1.1rem;
  color: var(--text);
  font-family: var(--font-sans);
}

.search-modal input::placeholder { color: var(--text-light); }

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background: var(--bg-alt);
}

.search-result-icon {
  width: 36px; height: 36px;
  background: rgba(30,144,255,0.1);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.search-result-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.search-result-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Experience Cards ── */
.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.exp-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  border-radius: 0 0 0 var(--radius-md);
}

.exp-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.exp-card-meta { flex: 1; }

.exp-card-role {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.exp-card-company {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.exp-card-period {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}

.exp-card-country {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.exp-card-body { font-size: 0.88rem; color: var(--text-muted); }

.exp-card-achievements {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.exp-card-achievements li {
  font-size: 0.83rem;
  color: var(--text);
  list-style: none;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.3rem;
}

.exp-card-achievements li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ── Chart Containers ── */
.chart-wrap {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

/* ── Filter Tabs ── */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-tab {
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(30,144,255,0.06);
}

/* ── Certifications ── */
.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.cert-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--gold);
}

.cert-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.cert-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.cert-body {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Accordion ── */
.accordion-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.accordion-header:hover { background: var(--bg-alt); }

.accordion-header .chevron {
  transition: transform 0.3s;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.accordion-item.open .accordion-header .chevron {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 1.25rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.accordion-item.open .accordion-body { display: block; }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

/* ── Utility Classes ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

.text-center  { text-align: center; }
.text-right   { text-align: right; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-none { display: none !important; }
.d-flex { display: flex !important; }

/* ── Scroll Animation ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Back to Top ── */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px; height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#backToTop.visible { display: flex; }
#backToTop:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ── Progress Bar ── */
.page-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  z-index: 10000;
  width: 0;
  transition: width 0.1s;
}

/* ── Print Styles ── */
@media print {
  .ecms-nav, .ecms-footer, #backToTop, .search-overlay { display: none !important; }
  .page-wrapper { padding-top: 0; }
  body { background: #fff; color: #000; }
  .card, .exp-card, .timeline-body { box-shadow: none; border: 1px solid #ddd; }
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 992px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --nav-height: 60px; }

  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(10,36,99,0.98);
    padding: 1rem;
    gap: 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }

  .nav-links.open a {
    padding: 0.7rem 1rem;
    display: block;
  }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .hero-stats { gap: 1rem; }
  .hero-stat-divider { display: none; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .section { padding: 3rem 0; }

  .exp-card-header { flex-direction: column; }
  .exp-card-period { text-align: left; }

  .hero { padding: 3rem 0; }
  .page-header { padding: 2rem 0; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .hero-actions .btn { width: auto; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Focus Accessibility ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 99999;
  transition: top 0.2s;
}

.skip-link:focus { top: 1rem; }

/* ── Page Wrapper ── */
.page-wrapper { padding-bottom: 4rem; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,0.75); text-decoration: none; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .current { color: rgba(255,255,255,0.9); }
.breadcrumb-sep { opacity: 0.5; }

/* ── Competency Grid ── */
.competency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

/* ── Experience Cards ── */
.exp-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  transition: var(--transition);
}
.exp-card:hover, .exp-card:focus { border-color: var(--accent); box-shadow: var(--shadow-md); }
.exp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.exp-card-role { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; }
.exp-card-company { font-size: 0.9rem; color: var(--accent); font-weight: 600; margin-bottom: 0.2rem; }
.exp-card-country { font-size: 0.8rem; color: var(--text-muted); }
.exp-card-period { text-align: right; flex-shrink: 0; font-size: 0.85rem; color: var(--text-muted); }
.exp-card-body { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }
.exp-card-achievements { margin: 0.5rem 0 0 1rem; padding: 0; line-height: 1.85; }
.exp-card-achievements li { margin-bottom: 0.25rem; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}
.timeline-dot {
  position: absolute;
  left: -1.65rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.timeline-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; }
.timeline-company { font-size: 0.82rem; color: var(--accent); margin-bottom: 0.4rem; }
.timeline-body { font-size: 0.85rem; color: var(--text-muted); line-height: 1.65; }

/* ── Timeline tags ── */
.timeline-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ── Tags extra variants ── */
.tag-success { background: rgba(5,150,105,0.12); color: #059669; }
.tag-muted { background: var(--bg-alt); color: var(--text-muted); }

/* ── Cert card ── */
.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}
.cert-card:hover { border-color: var(--gold); box-shadow: var(--shadow-md); }
.cert-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.cert-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.4rem; }
.cert-body { font-size: 0.8rem; color: var(--text-muted); }

/* ── Btn variants ── */
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(201,162,39,0.3);
}
.btn-gold:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.82rem; }

/* ── Grid auto ── */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ── mb-4 helper ── */
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

/* ── Section description ── */
.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 560px;
  margin: 0 auto 0.5rem;
  line-height: 1.7;
}

/* ── Gold text ── */
.gold { color: var(--gold); }

/* ── Visually hidden ── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Skill bar group spacing ── */
.skill-bar-group { margin-bottom: 0.85rem; }
.skill-bar-fill.gold { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }

/* ── section-alt inside reveal ── */
.section-alt .competency-item {
  background: var(--bg-card);
}

/* ── Nav Dropdown ── */
.nav-dropdown-wrap {
  position: relative;
}
.nav-dropdown-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  transition: var(--transition);
  font-family: var(--font);
  letter-spacing: 0.01em;
}
.nav-dropdown-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 200;
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
}
.nav-dropdown.open { display: block; }
.nav-dropdown li a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}
.nav-dropdown li a:hover {
  background: rgba(30,144,255,0.07);
  color: var(--accent);
}

/* ── Responsive additions ── */
@media (max-width: 768px) {
  .competency-grid { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .exp-card { padding: 1.25rem; }
  .timeline { padding-left: 1.5rem; }
  .timeline-dot { left: -1.25rem; }
}

/* ============================================================
   RTL / Arabic Language Support
   ============================================================ */

html.i18n-rtl {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

html.i18n-rtl body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  text-align: right;
}

/* Nav RTL */
html.i18n-rtl .nav-inner {
  flex-direction: row-reverse;
}

html.i18n-rtl .nav-links {
  padding-right: 0;
}

html.i18n-rtl .nav-dropdown {
  right: 0;
  left: auto;
}

html.i18n-rtl .nav-actions {
  flex-direction: row-reverse;
}

/* Breadcrumb RTL */
html.i18n-rtl .breadcrumb {
  flex-direction: row-reverse;
}

html.i18n-rtl .breadcrumb-sep {
  transform: scaleX(-1);
}

/* Cards & grids RTL */
html.i18n-rtl .exp-card-header {
  flex-direction: row-reverse;
  text-align: right;
}

html.i18n-rtl .exp-card-period {
  text-align: left;
}

html.i18n-rtl .grid-2,
html.i18n-rtl .grid-3 {
  direction: rtl;
}

/* Tables RTL */
html.i18n-rtl table {
  direction: rtl;
}

html.i18n-rtl table td:first-child {
  text-align: right;
}

/* Footer RTL */
html.i18n-rtl .footer-grid {
  direction: rtl;
}

html.i18n-rtl .footer-bottom {
  flex-direction: row-reverse;
}

/* Timeline RTL */
html.i18n-rtl .timeline {
  padding-left: 0;
  padding-right: 1.5rem;
  border-left: none;
  border-right: 2px solid var(--border-light);
}

html.i18n-rtl .timeline-dot {
  left: auto;
  right: -1.25rem;
}

/* Filter tabs RTL */
html.i18n-rtl .filter-tabs {
  flex-direction: row-reverse;
}

/* Skill bars RTL */
html.i18n-rtl .skill-bar-track {
  direction: rtl;
}

html.i18n-rtl .skill-bar-fill {
  margin-left: auto;
  margin-right: 0;
}

/* Section headers RTL */
html.i18n-rtl .section-header {
  text-align: right;
}

html.i18n-rtl .section-title {
  text-align: right;
}

/* Page header RTL */
html.i18n-rtl .page-header-inner {
  flex-direction: row-reverse;
}

/* Buttons RTL */
html.i18n-rtl .btn {
  direction: rtl;
}

/* Lists RTL */
html.i18n-rtl ul,
html.i18n-rtl ol {
  padding-left: 0;
  padding-right: 1.5rem;
}

html.i18n-rtl .exp-card-achievements {
  padding-left: 0;
  padding-right: 1.25rem;
}

html.i18n-rtl .exp-card-achievements li {
  direction: rtl;
}

/* Competency items RTL */
html.i18n-rtl .competency-item {
  direction: rtl;
  text-align: right;
}

/* Tags RTL */
html.i18n-rtl .timeline-tags {
  direction: rtl;
}

/* Search modal RTL */
html.i18n-rtl .search-modal {
  direction: rtl;
}

html.i18n-rtl .search-input-wrap {
  flex-direction: row-reverse;
}

/* Back to top RTL */
html.i18n-rtl #backToTop {
  right: auto;
  left: 1.5rem;
}

/* Language toggle button */
.btn-i18n-toggle:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* ============================================================
   AI Chatbot – Glassmorphism Floating Widget
   ============================================================ */

#ai-chatbot-root {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: 'Inter', 'Cairo', system-ui, -apple-system, sans-serif;
}

[dir="rtl"] #ai-chatbot-root {
  right: auto;
  left: 1.5rem;
}

/* ── Floating Bubble ── */
.ai-chat-bubble {
  width: 72px;
  height: 72px;
  border-radius: 36px;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  border: 2px solid rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  animation: ai-bubble-float 3s ease-in-out infinite;
}
@keyframes ai-bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.ai-chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 16px 48px rgba(14, 165, 233, 0.65);
  animation: none;
}
.ai-chat-bubble-label {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.ai-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid rgba(15,23,42,0.9);
  animation: ai-badge-pulse 1.5s ease-in-out infinite;
}
[dir="rtl"] .ai-chat-badge {
  right: auto;
  left: -4px;
}
@keyframes ai-badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.15); }
}
.ai-chat-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 40px;
  background: rgba(14, 165, 233, 0.3);
  animation: ai-pulse 2.5s ease-out infinite;
  z-index: -1;
}
@keyframes ai-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ── Chat Window (ChatGPT-style) ── */
.ai-chat-window {
  position: absolute;
  bottom: 88px;
  right: 0;
  width: 480px;
  max-width: calc(100vw - 2rem);
  height: 600px;
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  background: #212121;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: bottom right;
}
[dir="rtl"] .ai-chat-window {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}
.ai-chat-hidden {
  opacity: 0;
  transform: scale(0.85) translateY(10px);
  pointer-events: none;
}

/* ── Header (ChatGPT-style minimal) ── */
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #212121;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0ea5e9;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-chat-title {
  color: #ececec;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}
.ai-chat-subtitle {
  color: #8e8e8e;
  font-size: 0.68rem;
  line-height: 1.2;
}
.ai-chat-header-actions {
  display: flex;
  gap: 6px;
}
.ai-chat-icon-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.ai-chat-icon-btn:hover {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.12);
}

/* ── Messages (ChatGPT-style full-width rows, FIXED SIZE, scrolls only here) ── */
.ai-chat-messages {
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  background: #212121;
  min-height: 0;
}
.ai-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 10px;
}
.ai-chat-msg {
  max-width: 100%;
  width: 100%;
  animation: ai-msg-in 0.3s ease;
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
@keyframes ai-msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-chat-msg-bot {
  background: #212121;
}
.ai-chat-msg-user {
  background: #2f2f2f;
}
.ai-chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}
.ai-chat-msg-bot .ai-chat-msg-avatar {
  background: #0ea5e9;
}
.ai-chat-msg-user .ai-chat-msg-avatar {
  background: #6366f1;
}
.ai-chat-msg-content {
  padding: 0;
  border-radius: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  word-break: break-word;
  color: #ececec;
  flex: 1;
}
.ai-chat-msg-bot .ai-chat-msg-content {
  background: transparent;
  color: #ececec;
}
.ai-chat-msg-user .ai-chat-msg-content {
  background: transparent;
  color: #ececec;
}
[dir="rtl"] .ai-chat-msg-bot .ai-chat-msg-content,
[dir="rtl"] .ai-chat-msg-user .ai-chat-msg-content {
  border-radius: 0;
}

/* LTR text input override */
[dir="ltr"] #ai-chatbot-root textarea.ai-chat-input,
[dir="ltr"] #ai-chatbot-root textarea.ai-chat-input:focus,
[dir="ltr"] #ai-chatbot-root textarea.ai-chat-input:hover,
[dir="ltr"] #ai-chatbot-root textarea.ai-chat-input:active {
  direction: ltr !important;
  text-align: left !important;
}

/* ── Markdown Links ── */
.ai-chat-link {
  color: #38bdf8;
  text-decoration: underline;
  font-weight: 600;
}
.ai-chat-link:hover {
  color: #7dd3fc;
}

/* ── Typing Indicator ── */
.ai-chat-typing-indicator .ai-chat-msg-content {
  display: flex;
  gap: 4px;
  align-items: center;
}
.ai-chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: ai-bounce 1.4s ease-in-out infinite;
}
.ai-chat-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-chat-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Quick Chips (ChatGPT-style suggestion pills) ── */
.ai-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  flex: none;
  background: #212121;
}
.ai-chat-chip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ececec;
  font-size: 0.78rem;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.ai-chat-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Input Area (ChatGPT-style — single rounded box with send button inside) ── */
.ai-chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 12px 16px 16px;
  flex: none;
  background: #212121;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ai-chat-input-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #2f2f2f;
  border-radius: 28px;
  padding: 8px 8px 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s;
}
.ai-chat-input-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.2);
}
#ai-chatbot-root textarea.ai-chat-input,
#ai-chatbot-root textarea.ai-chat-input:focus,
#ai-chatbot-root textarea.ai-chat-input:hover,
#ai-chatbot-root textarea.ai-chat-input:active {
  flex: 1;
  width: 100%;
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 14px 0 !important;
  color: #ececec !important;
  font-size: 0.95rem !important;
  outline: none !important;
  font-family: inherit !important;
  resize: none !important;
  line-height: 1.5 !important;
  direction: rtl;
  text-align: right !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
#ai-chatbot-root textarea.ai-chat-input::placeholder {
  color: #8e8e8e !important;
  opacity: 1 !important;
}
.ai-chat-send {
  background: #ececec;
  border: none;
  color: #212121;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: opacity 0.2s, transform 0.2s;
}
.ai-chat-send:hover {
  opacity: 0.85;
  transform: scale(1.05);
}
.ai-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .ai-chat-window {
    width: calc(100vw - 1.5rem);
    height: calc(100vh - 8rem);
    max-height: calc(100vh - 7rem);
  }
  #ai-chatbot-root {
    bottom: 1rem;
    right: 1rem;
  }
  [dir="rtl"] #ai-chatbot-root {
    left: 1rem;
  }
  .ai-chat-bubble {
    width: 64px;
    height: 64px;
  }
  .ai-chat-bubble-label {
    display: none;
  }
}

/* ── External Visitor Counter Badge ── */
.visitor-counter {
  display: inline-block;
  height: 30px;
  width: auto;
  vertical-align: middle;
  opacity: 0.85;
  border-radius: 6px;
  transition: opacity 0.3s ease;
}
.visitor-counter:hover {
  opacity: 1;
}
