@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap");

/* ===== CSS Variables / Design Tokens ===== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #8a8a8a;
  --accent: #8b85ff;
  --accent-hover: #a19cff;
  --accent-glow: rgba(139, 133, 255, 0.3);
  --gradient: linear-gradient(135deg, #8b85ff 0%, #60a5fa 100%);
  --gradient-text: linear-gradient(135deg, #a19cff, #60a5fa, #22d3ee);
  --border-color: #2a2a2a;
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 40px rgba(108, 99, 255, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --header-height: 70px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.18);
  --gradient: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  --gradient-text: linear-gradient(135deg, #4f46e5, #2563eb, #0e7490);
  --border-color: #e0e0e0;
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 40px rgba(108, 99, 255, 0.12);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

li {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

/* ===== Loader ===== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 45px;
  height: 45px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Header ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: transparent;
  backdrop-filter: blur(0px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 5rem);
  transition: background var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}

header.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

/* ===== Demo Video Section ===== */
.demo-video {
  padding: 5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.demo-video .section-title {
  margin-bottom: 3rem;
}

.video-wrapper {
  animation: fadeIn 0.6s ease forwards;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.logo span {
  color: var(--accent);
}

nav ul {
  display: flex;
  gap: 2rem;
}

nav ul li a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.25rem 0;
}

nav ul li a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
  transition: width var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--text-primary);
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(20deg);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ===== Section Title ===== */
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
  margin: 0.75rem auto 3rem;
}

/* ===== Reveal Animation ===== */
@keyframes revealFallback {
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  /* Safety: auto-reveal after 2s if JS observer never fires */
  animation: revealFallback 0.6s ease 2s forwards;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.7) 0%,
    rgba(10, 10, 10, 0.85) 50%,
    rgba(10, 10, 10, 0.95) 100%
  );
}

/* Todo: remove this background gradient */
[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 800px;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-name {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
  line-height: 1.1;
}

.hero-role {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 600;
  min-height: 2.5rem;
  margin-bottom: 1rem;
}

.typed-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cursor {
  color: var(--accent);
  animation: blink 0.8s infinite;
  font-weight: 300;
}

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

.hero-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

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

.hero-social {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}

.hero-social a {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.1rem;
  transition: all var(--transition);
  position: relative;
}

.hero-social a::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 10;
}

.hero-social a:hover::after {
  opacity: 1;
}

.hero-social a[href*="github"]:hover {
  border-color: #333;
  color: #333;
  background: rgba(51, 51, 51, 0.1);
}

.hero-social a[href*="linkedin"]:hover {
  border-color: #0A66C2;
  color: #0A66C2;
  background: rgba(10, 102, 194, 0.1);
}

.hero-social a[href*="wa.me"]:hover {
  border-color: #25D366;
  color: #25D366;
  background: rgba(37, 211, 102, 0.1);
}

.hero-social a[href*="x.com"]:hover,
.hero-social a[href*="twitter"]:hover {
  border-color: #000000;
  color: #000000;
  background: rgba(0, 0, 0, 0.1);
}

.hero-social a[href*="instagram"]:hover {
  border-color: #fd1d1d;
  color: #fd1d1d;
  background: rgba(253, 29, 29, 0.1);
}

.hero-social a:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}

.scroll-indicator a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ===== About Section ===== */
.about {
  padding: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 3/4;
  object-fit: cover;
}

.about-image::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: calc(var(--radius-lg) + 4px);
  z-index: -1;
  opacity: 0.3;
}

.about-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.8;
}

.about-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
}

.stat-plus {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ===== Services Section ===== */
.services {
  padding: 6rem 2rem;
  background: var(--bg-secondary);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: transform var(--transition);
}

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

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(59, 130, 246, 0.1));
  border-radius: 50%;
  font-size: 1.75rem;
  color: var(--accent);
  transition: all var(--transition);
}

.service-card:hover .service-icon {
  background: var(--gradient);
  color: #fff;
  transform: scale(1.1);
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ===== GitHub Stats Section ===== */
.github-stats {
  padding: 6rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.github-stats .section-title {
  margin-bottom: 3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.stat-card {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

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

.stat-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

/* ===== Skills Section ===== */
.skills {
  padding: 6rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: calc((100% - 6 * 1.25rem) / 7);
  min-width: 130px;
  max-width: 150px;
  padding: 1.5rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: default;
  position: relative;
  box-sizing: border-box;
}

.skill-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.skill-item i,
.skill-item svg {
  font-size: 2.5rem;
  color: var(--accent);
  transition: transform var(--transition);
}

.skill-item:hover i,
.skill-item:hover svg {
  transform: scale(1.15);
}

.skill-item span:first-of-type {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== Projects Section ===== */
.projects {
  padding: 6rem 2rem;
  background: var(--bg-secondary);
}

.projects-filter {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108, 99, 255, 0.08);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.project-card.hidden {
  display: none;
}

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

.project-card .project-image {
  position: relative;
  overflow: hidden;
  height: 220px;
}

.project-card .project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.08);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(108, 99, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-link {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--accent);
  border-radius: 50%;
  font-size: 1.2rem;
  transform: translateY(20px);
  transition: all var(--transition);
}

.project-card:hover .project-link {
  transform: translateY(0);
}

.project-link:hover {
  background: var(--bg-primary);
  transform: scale(1.1) !important;
}

.project-info {
  padding: 1.5rem;
}

.project-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-proof {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(108, 99, 255, 0.18);
  border-radius: var(--radius);
}

.project-proof div {
  display: grid;
  gap: 0.15rem;
}

.project-proof span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-proof strong {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags span {
  padding: 0.25rem 0.75rem;
  background: rgba(108, 99, 255, 0.1);
  color: var(--accent);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.more-projects {
  text-align: center;
  margin-top: 3rem;
}

.more-projects p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ===== Testimonials Section ===== */
.testimonials {
  padding: 6rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.testimonials .section-title {
  margin-bottom: 1rem;
}

.testimonials .section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 3rem;
  text-align: center;
}

.testimonial-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(139, 133, 255, 0.18), transparent 32%),
    var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3rem);
  box-shadow: var(--shadow);
}

.testimonial-card::before {
  content: "“";
  position: absolute;
  top: -1.25rem;
  right: 2rem;
  color: var(--accent);
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.16;
}

.testimonial-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  margin-bottom: 1.5rem;
  background: rgba(10, 102, 194, 0.12);
  color: #0a66c2;
  border: 1px solid rgba(10, 102, 194, 0.28);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.testimonial-card blockquote {
  position: relative;
  z-index: 1;
  color: var(--text-primary);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 2rem;
}

.testimonial-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.testimonial-footer strong {
  display: block;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.testimonial-footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.testimonial-footer p:last-child {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ===== Blog Section ===== */
.blog {
  padding: 6rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

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

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

.blog-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.blog-category {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1rem 0;
  line-height: 1.4;
  color: var(--text-primary);
}

.blog-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.blog-tags span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.blog-tags span::before {
  content: '';
}

.blog-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  width: fit-content;
}

.blog-link:hover {
  gap: 0.75rem;
}

.blog-link i {
  transition: transform var(--transition);
}

.blog-card:hover .blog-link i {
  transform: translateX(4px);
}

/* ===== Career Timeline Section ===== */
.timeline {
  padding: 6rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.timeline-container {
  position: relative;
  padding: 1rem 0;
}

/* Timeline Axis line on far left side */
.timeline-container::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  margin-bottom: 2.5rem;
  position: relative;
}

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

.timeline-item:nth-child(odd) .timeline-content,
.timeline-item:nth-child(even) .timeline-content {
  margin-left: 48px;
  margin-right: 0;
  width: calc(100% - 48px);
}

/* Marker dot aligned on left axis */
.timeline-marker {
  position: absolute;
  left: 16px;
  top: 1.75rem;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 2;
  transition: all var(--transition);
}

.timeline-item:hover .timeline-marker {
  transform: translateX(-50%) scale(1.4);
  box-shadow: 0 0 0 6px var(--accent-glow);
}

/* Full Width Experience Cards */
.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  transition: all var(--transition);
  box-sizing: border-box;
  backdrop-filter: blur(10px);
}

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

/* Card Header (Flexbox Row) */
.timeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.timeline-logo-container {
  width: 60px;
  height: 60px;
  max-width: 60px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all var(--transition);
  flex-shrink: 0;
}

.timeline-content:hover .timeline-logo-container {
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.timeline-company-logo {
  max-width: 60px;
  max-height: 60px;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

.timeline-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(139, 133, 255, 0.12) 0%, rgba(108, 99, 255, 0.06) 100%);
}

.timeline-title-group h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.timeline-company-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.timeline-company-name a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

.timeline-company-name a:hover {
  text-decoration: underline;
}

.timeline-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

.timeline-mode {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  color: var(--accent);
  background: rgba(139, 133, 255, 0.1);
  border: 1px solid rgba(139, 133, 255, 0.24);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Content Body */
.timeline-card-body {
  width: 100%;
}

.timeline-tech {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  background: rgba(108, 99, 255, 0.08);
  color: var(--accent);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(108, 99, 255, 0.18);
  width: 100%;
  box-sizing: border-box;
}

.timeline-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-highlights li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.timeline-highlights li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.timeline-highlights li:last-child {
  margin-bottom: 0;
}

/* Responsiveness (Mobile & Small Screens) */
@media (max-width: 768px) {
  .timeline {
    padding: 4rem 1rem;
  }

  .timeline-container::before {
    left: 12px;
  }

  .timeline-marker {
    left: 12px;
    top: 1.5rem;
  }

  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    margin-left: 36px;
    margin-right: 0;
    padding: 1.25rem;
    width: calc(100% - 36px);
  }

  .timeline-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .timeline-header-right {
    align-items: flex-start;
    width: 100%;
  }

  .timeline-header-left {
    gap: 0.85rem;
  }

  .timeline-logo-container {
    width: 48px;
    height: 48px;
    max-width: 48px;
    border-radius: 10px;
  }

  .timeline-logo-fallback {
    font-size: 1.25rem;
  }

  .timeline-title-group h3 {
    font-size: 1.1rem;
  }

  .timeline-tech {
    font-size: 0.78rem;
    padding: 0.5rem 0.8rem;
    margin-bottom: 1rem;
  }

  .timeline-highlights li {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.6rem;
  }
}

/* ===== Project Search (in Projects Section) ===== */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 1.5rem auto 2rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition);
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}



/* ===== Analytics Dashboard Section ===== */
.analytics {
  padding: 6rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--bg-secondary);
}

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

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition);
}

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

.analytics-card i {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.analytics-card h3 {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 1rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.5rem 0 0 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-container {
    max-width: 100%;
    margin: 1rem auto 1.5rem;
  }

  .search-input {
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    font-size: 0.95rem;
  }

  .search-icon {
    left: 0.75rem;
  }

  .before-after {
    padding: 4rem 1rem;
  }

  .slider-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .slider-content {
    height: 300px;
  }

  .slider-handle::-webkit-slider-thumb {
    width: 50px;
    height: 50px;
  }

  .slider-handle::-moz-range-thumb {
    width: 50px;
    height: 50px;
  }

  .improvements-list {
    gap: 1rem;
  }

  .improvements-list h3 {
    font-size: 0.9rem;
    padding: 0.8rem;
  }

  .analytics {
    padding: 4rem 1rem;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .analytics-card {
    padding: 1.5rem;
  }

  .analytics-card i {
    font-size: 2rem;
  }

  .analytics-value {
    font-size: 1.5rem;
  }
}

.contact {
  padding: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.contact-subtitle {
  text-align: center;
  color: var(--text-secondary);
  max-width: 500px;
  margin: -2rem auto 3rem;
  font-size: 1.05rem;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-item i {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(59, 130, 246, 0.1));
  color: var(--accent);
  border-radius: 50%;
  font-size: 1rem;
}

.contact-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.contact-item a,
.contact-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.contact-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.contact-socials a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition);
  position: relative;
}

.contact-socials a::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 10;
}

.contact-socials a:hover::after {
  opacity: 1;
}

.contact-socials a[href*="github"]:hover {
  border-color: #333;
  color: #333;
  background: rgba(51, 51, 51, 0.1);
}

.contact-socials a[href*="linkedin"]:hover {
  border-color: #0A66C2;
  color: #0A66C2;
  background: rgba(10, 102, 194, 0.1);
}

.contact-socials a[href*="wa.me"]:hover {
  border-color: #25D366;
  color: #25D366;
  background: rgba(37, 211, 102, 0.1);
}

.contact-socials a[href*="x.com"]:hover,
.contact-socials a[href*="twitter"]:hover {
  border-color: #000000;
  color: #000000;
  background: rgba(0, 0, 0, 0.1);
}

.contact-socials a[href*="instagram"]:hover {
  border-color: #fd1d1d;
  color: #fd1d1d;
  background: rgba(253, 29, 29, 0.1);
}

.contact-socials a:hover {
  transform: translateY(-3px);
}

.contact-form .form-group {
  margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition);
  outline: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===== Scroll to Top ===== */
.scroll-top {
  position: fixed;
  right: -60px;
  bottom: 1.5rem;
  width: 50px;
  height: 50px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: 0 4px 15px var(--accent-glow);
  z-index: 50;
}

.scroll-top.show {
  right: 1.5rem;
}

.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

/* ===== Footer ===== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 2rem 1.5rem;
  text-align: center;
  position: relative;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-logo {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  display: inline-block;
  line-height: 1.2;
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 550px;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 0.8rem;
  margin-bottom: 1.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-dot {
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.5;
  user-select: none;
}

.footer-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.social-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.social-icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--accent-glow);
}

.footer-bottom {
  width: 100%;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.heart {
  color: #ef4444;
  display: inline-block;
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }

  .about-image {
    max-width: 350px;
    margin: 0 auto;
  }

  .about-stats {
    justify-content: center;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-info {
    text-align: center;
  }

  .contact-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-socials {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    padding: 5rem 2rem 2rem;
    transition: right var(--transition);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
  }

  nav.open {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav ul li a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .about-stats {
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stat-card {
    max-width: 100%;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 250px;
    justify-content: center;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .skill-item {
    width: calc((100% - 2 * 0.75rem) / 3);
    min-width: 85px;
    max-width: 110px;
    padding: 1rem 0.25rem;
  }

  .skill-item i,
  .skill-item svg {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    max-width: 100%;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card h3 {
    font-size: 1.1rem;
  }

  .blog-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== Language Toggle Button ===== */
.lang-toggle {
  background: none;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  transition: all var(--transition);
  letter-spacing: 0;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Form Status Messages ===== */
.form-status {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.5rem;
}

.form-status.success {
  color: #22c55e;
}

.form-status.error {
  color: #ef4444;
}

/* ===== RTL Support ===== */
[dir="rtl"] {
  font-family: "Tajawal", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[dir="rtl"] nav ul li a::after {
  left: auto;
  right: 0;
}

[dir="rtl"] nav {
  right: auto;
}

@media (max-width: 768px) {
  [dir="rtl"] nav {
    right: auto;
    left: -100%;
  }

  [dir="rtl"] nav.open {
    left: 0;
    right: auto;
  }
}

[dir="rtl"] .about-content {
  direction: rtl;
}

[dir="rtl"] .contact-content {
  direction: rtl;
}

[dir="rtl"] .scroll-top {
  right: -60px;
  left: auto;
}

[dir="rtl"] .scroll-top.show {
  right: 1.5rem;
  left: auto;
}

[dir="rtl"] footer,
[dir="rtl"] .footer-content {
  direction: rtl;
}

[dir="rtl"] .footer-tagline,
[dir="rtl"] .footer-links a,
[dir="rtl"] .footer-bottom p {
  font-family: "Tajawal", sans-serif;
}

[dir="rtl"] .hero-social {
  direction: ltr;
}

[dir="rtl"] .skills-grid {
  direction: ltr;
}

[dir="rtl"] .project-tags {
  direction: ltr;
}

/* ===== Timeline RTL Overrides ===== */
[dir="rtl"] .timeline-container::before {
  left: auto;
  right: 16px;
}

[dir="rtl"] .timeline-marker {
  left: auto;
  right: 16px;
  transform: translateX(50%);
}

[dir="rtl"] .timeline-item:hover .timeline-marker {
  transform: translateX(50%) scale(1.4);
}

[dir="rtl"] .timeline-item:nth-child(odd) .timeline-content,
[dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
  margin-left: 0;
  margin-right: 48px;
  width: calc(100% - 48px);
  text-align: right;
}

[dir="rtl"] .timeline-card-header {
  text-align: right;
}

[dir="rtl"] .timeline-header-left {
  text-align: right;
}

[dir="rtl"] .timeline-title-group {
  text-align: right;
}

[dir="rtl"] .timeline-title-group h3,
[dir="rtl"] .timeline-company-name {
  text-align: right;
}

[dir="rtl"] .timeline-header-right {
  align-items: flex-start;
  text-align: right;
}

[dir="rtl"] .timeline-card-body {
  text-align: right;
}

[dir="rtl"] .timeline-tech {
  text-align: right;
}

[dir="rtl"] .timeline-section-title {
  text-align: right;
}

[dir="rtl"] .timeline-highlights {
  text-align: right;
  padding: 0;
  margin: 0;
}

[dir="rtl"] .timeline-highlights li {
  text-align: right;
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .timeline-highlights li::before {
  left: auto;
  right: 0;
  content: "←";
}

@media (max-width: 768px) {
  [dir="rtl"] .timeline-container::before {
    right: 12px;
  }

  [dir="rtl"] .timeline-marker {
    right: 12px;
  }

  [dir="rtl"] .timeline-item:nth-child(odd) .timeline-content,
  [dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
    margin-right: 36px;
    width: calc(100% - 36px);
    text-align: right;
  }

  [dir="rtl"] .timeline-card-header {
    align-items: flex-start;
    text-align: right;
  }

  [dir="rtl"] .timeline-header-right {
    align-items: flex-start;
    text-align: right;
  }

  [dir="rtl"] .timeline-highlights li {
    text-align: right;
  }
}

/* ===== Collaboration Section ===== */
.collaboration {
  padding: 6rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--bg-secondary);
}

.collaboration .section-title {
  margin-bottom: 1rem;
}

.collaboration .section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  text-align: center;
}

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

.collab-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  transition: all var(--transition);
  text-align: center;
}

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

.collab-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.8rem;
  color: white;
}

.collab-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.collab-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.collab-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.collab-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.collab-features i {
  color: var(--accent);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* ===== AI Chat Widget ===== */
.chat-widget {
  position: fixed;
  bottom: calc(1.5rem + 50px + 0.8rem);
  right: 1.5rem;
  z-index: 99;
}

.chat-button {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-hover);
  position: relative;
  border: none;
  font-size: 1.5rem;
  color: white;
}

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.chat-badge.hidden {
  opacity: 0;
  transform: scale(0);
  visibility: hidden;
  pointer-events: none;
}

.chat-modal {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  max-height: 600px;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

.chat-modal.active {
  display: flex;
}

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

.chat-header {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.chat-title-group h3 {
  margin: 0;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.chat-title-group p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  transition: transform var(--transition);
}

.chat-close:hover {
  transform: rotate(90deg);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  margin-bottom: 0.5rem;
  animation: fadeIn 0.3s ease-in;
}

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

.bot-message {
  justify-content: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.message-content {
  max-width: 70%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  word-wrap: break-word;
}

.bot-message .message-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.user-message .message-content {
  background: var(--accent);
  color: white;
}

.chat-suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.suggestion-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.suggestion-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.chat-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition);
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-send {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.chat-send:hover {
  background: #5a4fd1;
  transform: scale(1.05);
}

/* ===== Responsive Collaboration ===== */
@media (max-width: 768px) {
  .collaboration {
    padding: 4rem 1.5rem;
  }

  .collaboration-grid {
    grid-template-columns: 1fr;
  }

  .collab-card {
    padding: 2rem 1.5rem;
  }

  .chat-widget {
    bottom: calc(1rem + 50px + 0.8rem);
  }

  .chat-button {
    width: 50px;
    height: 50px;
  }

  .chat-modal {
    width: calc(100vw - 2rem);
    max-width: 350px;
  }
}

/* ===== RTL Support for Chat ===== */
[dir="rtl"] .scroll-top.show {
  right: auto;
  left: 1.5rem;
}

[dir="rtl"] .scroll-top {
  right: auto;
  left: -60px;
}

[dir="rtl"] .chat-widget {
  right: 1.5rem;
  left: auto;
}

[dir="rtl"] .chat-modal {
  right: 0;
  left: auto;
}

[dir="rtl"] .chat-messages {
  direction: rtl;
}

[dir="rtl"] .bot-message {
  justify-content: flex-end;
}

[dir="rtl"] .user-message {
  justify-content: flex-start;
}

[dir="rtl"] .chat-input-wrapper {
  flex-direction: row-reverse;
}

[dir="rtl"] .collab-features {
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

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

  .cursor,
  .scroll-indicator,
  .heart,
  .loader-spinner {
    animation: none !important;
  }
}
