/* ═══════════════════════════════════════════════════════════════════
   Ahmed Elshamy CV Theme — main.css
   Same visual identity as main portfolio site
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --red:       #B30000;
  --deep-red:  #7A0000;
  --glow:      #FF2A2A;
  --black:     #0B0B0B;
  --bg:        #0d0000;
  --glass:     rgba(255,255,255,0.06);
  --glass-2:   rgba(255,255,255,0.10);
  --border:    rgba(255,255,255,0.08);
  --text:      #EAEAEA;
  --muted:     #9A9A9A;
  --green:     #22C55E;
  --font-ar:   'Cairo', sans-serif;
  --font-en:   'Inter', sans-serif;
  --radius:    16px;
  --radius-lg: 24px;
  --max-w:     900px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: linear-gradient(180deg,
    #3a0000 0%, #200000 8%, #130000 18%,
    #0f0000 30%, #0a0000 55%, #060000 85%, #040000 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.lang-en { font-family: var(--font-en); direction: ltr; text-align: left; }
img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #040000; }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; }

/* ── Background canvas ── */
#aecv-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
}

/* ── Layout ── */
.aecv-page { position: relative; z-index: 1; }
.aecv-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section base ── */
.aecv-section {
  padding: 80px 0;
  position: relative;
}
.aecv-section + .aecv-section { padding-top: 0; }

/* ── Section title ── */
.aecv-section-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.aecv-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(179,0,0,0.6), transparent);
}
body.lang-en .aecv-section-title::after {
  background: linear-gradient(270deg, rgba(179,0,0,0.6), transparent);
}
.aecv-section-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--red), var(--deep-red));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(179,0,0,0.3);
}
.aecv-section-icon svg {
  width: 18px; height: 18px;
  stroke: #fff; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Glass card ── */
.aecv-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  transition: border-color 0.35s, transform 0.35s, box-shadow 0.35s;
}
.aecv-card:hover {
  border-color: rgba(179,0,0,0.3);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}

/* ════════════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════════════ */
.aecv-header {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 960px;
  z-index: 1000;
  background: rgba(6,0,0,0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 60px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  will-change: top, opacity;
  transition: top 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.4s;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.aecv-header.hide { top: -90px; opacity: 0; pointer-events: none; }

.aecv-header__brand {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.aecv-header__brand span { color: var(--red); }

.aecv-header__right {
  display: flex; align-items: center; gap: 10px;
}

/* Lang button */
.aecv-lang-btn {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 40px; padding: 7px 14px;
  cursor: pointer; color: var(--text);
  font-size: 0.82rem; font-weight: 600;
  transition: all 0.3s; font-family: inherit;
  white-space: nowrap;
}
.aecv-lang-btn svg { width: 15px; height: 15px; }
.aecv-lang-btn:hover {
  background: var(--red); border-color: var(--red);
  box-shadow: 0 0 18px rgba(179,0,0,0.4);
}

/* Download CV button in header */
.aecv-header__dl {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--red), var(--deep-red));
  border: none; border-radius: 40px;
  padding: 8px 18px; cursor: pointer;
  color: #fff; font-size: 0.82rem; font-weight: 700;
  transition: all 0.3s; font-family: inherit;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 0 20px rgba(179,0,0,0.3);
}
.aecv-header__dl:hover {
  box-shadow: 0 0 30px rgba(255,42,42,0.5);
  transform: translateY(-1px);
}
.aecv-header__dl svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Mobile: hide DL button text */
@media (max-width: 540px) {
  .aecv-header__dl-text { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════════════ */
.aecv-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.aecv-hero__bg {
  position: absolute; inset: 0;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center top;
  transform: scale(1.06);
  will-change: transform;
}

.aecv-hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(30,0,0,0.35) 0%,
    rgba(6,0,0,0.55) 55%,
    rgba(4,0,0,0.90) 85%,
    #040000 100%
  );
}

.aecv-hero__content {
  position: relative; z-index: 2;
  text-align: center; max-width: 700px; width: 100%;
}

/* Entrance */
.aecv-hero__avatar,
.aecv-hero__name,
.aecv-hero__title,
.aecv-hero__badges,
.aecv-hero__btns {
  opacity: 0; transform: translateY(28px);
}
.aecv-hero.ready .aecv-hero__avatar  { animation: cv-up 0.9s cubic-bezier(0.22,1,0.36,1) 0.15s forwards; }
.aecv-hero.ready .aecv-hero__name    { animation: cv-up 0.9s cubic-bezier(0.22,1,0.36,1) 0.30s forwards; }
.aecv-hero.ready .aecv-hero__title   { animation: cv-up 0.8s cubic-bezier(0.22,1,0.36,1) 0.44s forwards; }
.aecv-hero.ready .aecv-hero__badges  { animation: cv-up 0.8s cubic-bezier(0.22,1,0.36,1) 0.56s forwards; }
.aecv-hero.ready .aecv-hero__btns    { animation: cv-up 0.8s cubic-bezier(0.22,1,0.36,1) 0.68s forwards; }
@keyframes cv-up { to { opacity:1; transform:translateY(0); } }

/* Avatar */
.aecv-hero__avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 24px;
  border: 2px solid rgba(179,0,0,0.5);
  box-shadow: 0 0 30px rgba(179,0,0,0.25);
}
.aecv-hero__avatar img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
}

.aecv-hero__name {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fff 0%, #eaeaea 55%, var(--glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.aecv-hero__title {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Skill badges row */
.aecv-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.aecv-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 30px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}
.aecv-badge svg { width: 12px; height: 12px; stroke: var(--red); fill:none; stroke-width:2; stroke-linecap:round; }

/* Hero buttons */
.aecv-hero__btns {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.aecv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 50px;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  text-decoration: none; border: none;
  position: relative; overflow: hidden; isolation: isolate;
  transition: box-shadow 0.3s, transform 0.3s, background 0.3s;
}
.aecv-btn > * { position: relative; z-index: 1; }

/* Shine */
.aecv-btn::before {
  content: '';
  position: absolute; top:0; left:-110%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg,transparent 30%,rgba(255,255,255,0.18) 50%,transparent 70%);
  transform: skewX(-15deg);
  animation: cv-shine 3.5s ease-in-out infinite;
  pointer-events: none; z-index: 0;
}
@keyframes cv-shine { 0%{left:-110%} 28%{left:140%} 100%{left:140%} }

.aecv-btn--primary {
  background: linear-gradient(135deg, var(--red), var(--deep-red));
  color: #fff;
  box-shadow: 0 4px 22px rgba(179,0,0,0.35);
}
.aecv-btn--primary:hover {
  background: linear-gradient(135deg, var(--glow), var(--red));
  box-shadow: 0 8px 36px rgba(255,42,42,0.5);
  transform: translateY(-2px);
}
.aecv-btn--ghost {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
}
.aecv-btn--ghost:hover {
  border-color: rgba(179,0,0,0.5);
  background: rgba(179,0,0,0.12);
  box-shadow: 0 0 22px rgba(179,0,0,0.18);
  transform: translateY(-2px);
}
.aecv-btn svg { width: 17px; height: 17px; }

/* ════════════════════════════════════════════════════════════════════
   ABOUT
   ════════════════════════════════════════════════════════════════════ */
.aecv-about__text {
  font-size: 1rem;
  line-height: 1.9;
  color: rgba(234,234,234,0.82);
}

/* ════════════════════════════════════════════════════════════════════
   EDUCATION
   ════════════════════════════════════════════════════════════════════ */
.aecv-edu__row {
  display: flex; align-items: flex-start; gap: 18px;
}
.aecv-edu__icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(179,0,0,0.15), rgba(122,0,0,0.1));
  border: 1px solid rgba(179,0,0,0.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.aecv-edu__icon svg { width: 20px; height: 20px; stroke: var(--red); fill:none; stroke-width:2; stroke-linecap:round; }
.aecv-edu__degree {
  font-size: 1rem; font-weight: 700; margin-bottom: 4px;
}
.aecv-edu__school {
  font-size: 0.88rem; color: var(--muted);
}

/* ════════════════════════════════════════════════════════════════════
   EXPERIENCE
   ════════════════════════════════════════════════════════════════════ */
.aecv-exp__list { display: flex; flex-direction: column; gap: 20px; }

.aecv-exp__item {
  position: relative;
  padding-right: 52px;
  padding-top: 4px;
}
body.lang-en .aecv-exp__item {
  padding-right: 0;
  padding-left: 52px;
}

/* Vertical timeline line */
.aecv-exp__item::before {
  content: '';
  position: absolute;
  top: 14px; right: 19px;
  width: 1px;
  height: calc(100% + 20px);
  background: linear-gradient(to bottom, rgba(179,0,0,0.4), transparent);
}
body.lang-en .aecv-exp__item::before { right: auto; left: 19px; }
.aecv-exp__item:last-child::before { display: none; }

/* Dot */
.aecv-exp__item::after {
  content: '';
  position: absolute;
  top: 12px; right: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px rgba(179,0,0,0.5);
}
body.lang-en .aecv-exp__item::after { right: auto; left: 14px; }

.aecv-exp__company {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text); margin-bottom: 2px;
}
.aecv-exp__period {
  font-size: 0.78rem; font-weight: 500;
  color: var(--red); letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.aecv-exp__tasks {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.aecv-exp__tasks li {
  font-size: 0.88rem; color: var(--muted);
  display: flex; align-items: flex-start; gap: 8px;
}
.aecv-exp__tasks li::before {
  content: '';
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
  margin-top: 7px;
}

/* ════════════════════════════════════════════════════════════════════
   SKILLS
   ════════════════════════════════════════════════════════════════════ */
.aecv-skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.aecv-skill-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  font-size: 0.88rem; font-weight: 600;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.aecv-skill-item:hover {
  border-color: rgba(179,0,0,0.35);
  box-shadow: 0 0 20px rgba(179,0,0,0.1);
}
.aecv-skill-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
}

/* Software skill with logo/icon */
.aecv-software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.aecv-sw-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--muted); text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}
.aecv-sw-item:hover {
  border-color: rgba(179,0,0,0.35);
  transform: translateY(-3px);
}
.aecv-sw-item__icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.aecv-sw-item__icon svg {
  width: 32px; height: 32px;
  display: block;
}

/* Platforms */
.aecv-platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.aecv-platform-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 18px 14px;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  font-size: 0.82rem; font-weight: 600;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.aecv-platform-item:hover {
  border-color: rgba(179,0,0,0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.2);
}
.aecv-platform-item__icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(179,0,0,0.12), rgba(122,0,0,0.08));
  border: 1px solid rgba(179,0,0,0.18);
}
.aecv-platform-item__icon svg {
  width: 20px; height: 20px;
  fill: none; stroke: rgba(179,0,0,0.8);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ════════════════════════════════════════════════════════════════════
   CONTACT
   ════════════════════════════════════════════════════════════════════ */
.aecv-contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.aecv-contact-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex; align-items: center; gap: 14px;
  text-decoration: none;
  transition: border-color 0.3s, transform 0.3s;
}
.aecv-contact-item:hover {
  border-color: rgba(179,0,0,0.35);
  transform: translateY(-2px);
}
.aecv-contact-item__icon {
  width: 42px; height: 42px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--red), var(--deep-red));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 16px rgba(179,0,0,0.25);
}
.aecv-contact-item__icon svg {
  width: 20px; height: 20px;
  stroke: #fff; fill:none;
  stroke-width: 2; stroke-linecap:round; stroke-linejoin:round;
}
.aecv-contact-item__label {
  font-size: 0.72rem; font-weight: 600;
  color: var(--red); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 3px;
}
.aecv-contact-item__value {
  font-size: 0.88rem; font-weight: 600;
  color: var(--text);
}

/* Portfolio CTA card */
.aecv-portfolio-cta {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(179,0,0,0.2);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  position: relative; overflow: hidden;
}
.aecv-portfolio-cta::before {
  content: '';
  position: absolute; top:-60px; left:50%; transform:translateX(-50%);
  width:300px; height:300px;
  background: radial-gradient(circle, rgba(179,0,0,0.08), transparent 70%);
  pointer-events: none;
}
.aecv-portfolio-cta h3 {
  font-size: 1.3rem; font-weight: 700; margin-bottom: 8px;
}
.aecv-portfolio-cta p {
  font-size: 0.9rem; color: var(--muted); margin-bottom: 24px;
}

/* ════════════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════════════ */
.aecv-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 28px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.aecv-footer a {
  color: var(--text); font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--red);
}
.aecv-footer a:hover { color: var(--glow); }

/* ════════════════════════════════════════════════════════════════════
   SCROLL REVEAL
   ════════════════════════════════════════════════════════════════════ */
.aecv-reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.75s cubic-bezier(0.4,0,0.2,1),
              transform 0.75s cubic-bezier(0.4,0,0.2,1);
}
.aecv-reveal.is-visible { opacity: 1; transform: translateY(0); }
.aecv-reveal--d1 { transition-delay: 0.08s; }
.aecv-reveal--d2 { transition-delay: 0.16s; }
.aecv-reveal--d3 { transition-delay: 0.24s; }
.aecv-reveal--d4 { transition-delay: 0.32s; }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .aecv-header { top: 10px; padding: 10px 16px; width: calc(100% - 20px); }
  .aecv-hero { padding: 100px 20px 60px; }
  .aecv-hero__name { font-size: 2rem; }
  .aecv-hero__btns { flex-direction: column; align-items: center; }
  .aecv-section { padding: 60px 0; }
  .aecv-skills__grid { grid-template-columns: 1fr 1fr; }
  .aecv-contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .aecv-skills__grid { grid-template-columns: 1fr; }
  .aecv-software-grid { grid-template-columns: repeat(2,1fr); }
  .aecv-platforms-grid { grid-template-columns: repeat(2,1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
