/* ============================================================
   JOOD PORTFOLIO — style.css
   Sections:
     1. CSS Variables (colors, fonts)
     2. Reset & Base
     3. Navigation
     4. Hero
     5. Stats Row
     6. Shared Section Styles
     7. Dashboard
     8. Skill Bars
     9. Activity Chart
    10. Projects
    11. Reviews
    12. Contact
    13. Footer
    14. Toast Notification
    15. Animations
    16. Mobile Responsive
   ============================================================ */


/* ══════════════════════════════════════════════════════════
   1. CSS VARIABLES
   — Change colors here to restyle the whole site easily
   ══════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:       #0a0a0f;   /* page background */
  --bg2:      #111118;   /* cards & sections */
  --bg3:      #1a1a24;   /* inputs & inner cards */

  /* Borders */
  --border:   rgba(255, 255, 255, 0.07);
  --border2:  rgba(255, 255, 255, 0.12);

  /* Text */
  --text:     #f0eee8;   /* primary text */
  --text2:    #8b8a95;   /* secondary / muted text */
  --text3:    #55545e;   /* placeholder / very muted */

  /* Accent colors */
  --accent:   #7c6aff;   /* purple — primary accent */
  --accent2:  #a78bfa;   /* light purple */
  --accent3:  #4ade80;   /* green — success / available */
  --accent4:  #f97316;   /* orange — warning */
  --glow:     rgba(124, 106, 255, 0.15);

  /* Fonts */
  --font-display: 'Tajawal', sans-serif;
  --font-body: 'Tajawal', sans-serif;
  --font-mono:    'DM Mono', monospace;        /* code/labels */
}


/* ══════════════════════════════════════════════════════════
   2. RESET & BASE
   ══════════════════════════════════════════════════════════ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background:   var(--bg);
  color:        var(--text);
  font-family:  var(--font-body);
  font-size:    15px;
  line-height:  1.7;
  overflow-x:   hidden;
}

/* Subtle noise texture layered on top of everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}


/* ══════════════════════════════════════════════════════════
   3. NAVIGATION
   ══════════════════════════════════════════════════════════ */
nav {
  position:        fixed;
  top: 0; left: 0; right: 0;
  z-index:         100;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         0 2.5rem;
  height:          60px;
  background:      rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom:   1px solid var(--border);
}

.nav-logo {
  font-family:     var(--font-display);
  font-size:       20px;
  color:           var(--text);
  text-decoration: none;
  letter-spacing:  -0.5px;
}

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

.nav-links {
  display:    flex;
  gap:        2rem;
  list-style: none;
}

.nav-links a {
  color:          var(--text2);
  text-decoration: none;
  font-size:      13px;
  font-weight:    400;
  letter-spacing: 0.02em;
  transition:     color 0.2s;
}

.nav-links a:hover { color: var(--text); }

/* "Hire Me" button inside nav */
.nav-cta {
  padding:       7px 18px;
  background:    var(--accent);
  color:         #fff !important;
  border-radius: 6px;
  font-weight:   500 !important;
  font-size:     13px !important;
  transition:    opacity 0.2s !important;
}

.nav-cta:hover { opacity: 0.85; }


/* ══════════════════════════════════════════════════════════
   4. HERO
   ══════════════════════════════════════════════════════════ */
#hero {
  min-height:      100vh;
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         80px 2rem 4rem;
  position:        relative;
  text-align:      center;
}

/* Purple radial glow in the background */
.hero-glow {
  position:       absolute;
  width:          600px;
  height:         600px;
  border-radius:  50%;
  background:     radial-gradient(circle, rgba(124, 106, 255, 0.12) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform:      translate(-50%, -50%);
  pointer-events: none;
}

.hero-inner {
  position:   relative;
  z-index:    1;
  max-width:  680px;
}

/* "Available for projects" pill badge */
.hero-badge {
  display:       inline-flex;
  align-items:   center;
  gap:           6px;
  padding:       5px 14px;
  border:        1px solid var(--border2);
  border-radius: 100px;
  font-size:     12px;
  font-family:   var(--font-mono);
  color:         var(--text2);
  margin-bottom: 1.5rem;
  background:    var(--bg2);
}

/* Animated green dot inside badge */
.hero-badge .dot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--accent3);
  animation:     pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1);   }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* "J" circle avatar */
.hero-avatar {
  width:         90px;
  height:        90px;
  border-radius: 50%;
  margin:        0 auto 1.5rem;
  background:    linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-family:   var(--font-display);
  font-size:     36px;
  color:         #fff;
  box-shadow:    0 0 0 4px var(--bg),
                 0 0 0 5px var(--border2),
                 0 20px 60px rgba(124, 106, 255, 0.3);
}

h1.hero-name {
  font-family:    var(--font-display);
  font-size:      clamp(48px, 8vw, 80px);
  line-height:    1;
  letter-spacing: -2px;
  margin-bottom:  0.5rem;
  /* Gradient text effect */
  background:             linear-gradient(135deg, var(--text) 0%, var(--text2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip:         text;
}

.hero-role {
  font-family:    var(--font-mono);
  font-size:      14px;
  color:          var(--accent);
  margin-bottom:  1.5rem;
  letter-spacing: 0.05em;
}

.hero-desc {
  font-size:     17px;
  color:         var(--text2);
  max-width:     500px;
  margin:        0 auto 2rem;
  line-height:   1.8;
  font-weight:   300;
}

.hero-btns {
  display:         flex;
  gap:             12px;
  justify-content: center;
  flex-wrap:       wrap;
}

/* Primary (filled) button — used across the page */
.btn-primary {
  display:         inline-flex;
  align-items:     center;
  gap:             8px;
  padding:         12px 28px;
  background:      var(--accent);
  color:           #fff;
  border:          none;
  border-radius:   8px;
  font-family:     var(--font-body);
  font-size:       14px;
  font-weight:     500;
  cursor:          pointer;
  text-decoration: none;
  transition:      all 0.2s;
  box-shadow:      0 8px 30px rgba(124, 106, 255, 0.3);
}

.btn-primary:hover {
  transform:  translateY(-2px);
  box-shadow: 0 12px 40px rgba(124, 106, 255, 0.4);
}

/* Secondary (outline) button */
.btn-secondary {
  display:         inline-flex;
  align-items:     center;
  gap:             8px;
  padding:         12px 28px;
  background:      transparent;
  color:           var(--text);
  border:          1px solid var(--border2);
  border-radius:   8px;
  font-family:     var(--font-body);
  font-size:       14px;
  font-weight:     400;
  cursor:          pointer;
  text-decoration: none;
  transition:      all 0.2s;
}

.btn-secondary:hover {
  background:    var(--bg3);
  border-color:  var(--border2);
}


/* ══════════════════════════════════════════════════════════
   5. STATS ROW  (Projects / Clients / Commits / Hours)
   ══════════════════════════════════════════════════════════ */
.stats-row {
  display:         flex;
  justify-content: center;
  margin-top:      4rem;
  border:          1px solid var(--border);
  border-radius:   12px;
  overflow:        hidden;
  background:      var(--bg2);
}

.stat-item {
  flex:        1;
  padding:     1.5rem;
  text-align:  center;
  border-right: 1px solid var(--border);
}

.stat-item:last-child { border-right: none; }

.stat-num {
  font-family:  var(--font-display);
  font-size:    32px;
  color:        var(--text);
  display:      block;
}

.stat-label {
  font-size:      12px;
  color:          var(--text3);
  font-family:    var(--font-mono);
  letter-spacing: 0.05em;
}


/* ══════════════════════════════════════════════════════════
   6. SHARED SECTION STYLES
   ══════════════════════════════════════════════════════════ */
.section {
  max-width: 1100px;
  margin:    0 auto;
  padding:   6rem 2rem;
}

/* Small uppercase label above section titles */
.section-tag {
  font-family:    var(--font-mono);
  font-size:      11px;
  color:          var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom:  0.75rem;
}

.section-title {
  font-family:    var(--font-display);
  font-size:      clamp(28px, 4vw, 40px);
  letter-spacing: -1px;
  margin-bottom:  1rem;
  line-height:    1.15;
}

.section-sub {
  font-size:     15px;
  color:         var(--text2);
  max-width:     480px;
  font-weight:   300;
  margin-bottom: 3rem;
}


/* ══════════════════════════════════════════════════════════
   7. DASHBOARD
   ══════════════════════════════════════════════════════════ */
.dash-wrapper {
  background:    var(--bg2);
  border-top:    1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.dash-inner {
  max-width: 1100px;
  margin:    0 auto;
  padding:   5rem 2rem;
}

/* 4-column metric card grid */
.dash-grid {
  display:               grid;
  grid-template-columns: repeat(4, 1fr);
  gap:                   1px;         /* gap shows --border color as divider lines */
  background:            var(--border);
  border:                1px solid var(--border);
  border-radius:         12px;
  overflow:              hidden;
  margin-bottom:         2rem;
}

.dash-card {
  background:  var(--bg2);
  padding:     1.75rem;
  transition:  background 0.2s;
}

.dash-card:hover { background: var(--bg3); }

.dash-card-label {
  font-family:    var(--font-mono);
  font-size:      11px;
  color:          var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom:  0.5rem;
}

.dash-card-value {
  font-family:   var(--font-display);
  font-size:     36px;
  line-height:   1;
  margin-bottom: 0.5rem;
}

.dash-card-change {
  font-size:   12px;
  display:     flex;
  align-items: center;
  gap:         4px;
}

/* Color classes for change indicators */
.up   { color: var(--accent3); }
.warn { color: var(--accent4); }


/* ══════════════════════════════════════════════════════════
   8. SKILL BARS
   — To edit a skill: change data-width in HTML + the span text
   ══════════════════════════════════════════════════════════ */
.skills-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   1.5rem;
  margin-bottom:         2rem;
}

.skill-header {
  display:         flex;
  justify-content: space-between;
  margin-bottom:   8px;
  font-size:       13px;
}

.skill-name { color: var(--text);  font-weight: 500; }
.skill-pct  { color: var(--text2); font-family: var(--font-mono); font-size: 12px; }

.skill-track {
  height:        4px;
  background:    var(--bg3);
  border-radius: 2px;
  overflow:      hidden;
}

/* Bar starts at width:0 and animates to data-width via JS */
.skill-fill {
  height:        100%;
  border-radius: 2px;
  transition:    width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  position:      relative;
}

/* Small dot at the end of each bar */
.skill-fill::after {
  content:       '';
  position:      absolute;
  right: 0; top: -2px;
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    inherit;
}


/* ══════════════════════════════════════════════════════════
   9. ACTIVITY CHART
   — Chart data (months & hours) is set in script.js
   ══════════════════════════════════════════════════════════ */
.chart-container {
  background:    var(--bg3);
  border:        1px solid var(--border);
  border-radius: 12px;
  padding:       1.5rem;
  margin-bottom: 2rem;
}

.chart-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   1.5rem;
}

.chart-title { font-size: 14px; font-weight: 500; }
.chart-sub   { font-size: 12px; color: var(--text3); font-family: var(--font-mono); }

/* Bar chart is flex row — bars grow from bottom via height % */
.bar-chart {
  display:     flex;
  align-items: flex-end;
  gap:         8px;
  height:      120px;
}

.bar-col {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  gap:             6px;
}

.bar {
  width:         100%;
  border-radius: 4px 4px 0 0;
  transition:    opacity 0.2s;
  cursor:        pointer;
  min-height:    4px;
}

.bar:hover { opacity: 0.75; }

.bar-lbl {
  font-size:   10px;
  color:       var(--text3);
  font-family: var(--font-mono);
}


/* ══════════════════════════════════════════════════════════
   10. PROJECTS
   — To add a project: copy a <a class="project-card"> block in HTML
   ══════════════════════════════════════════════════════════ */
.projects-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap:                   1.5rem;
}

.project-card {
  background:      var(--bg2);
  border:          1px solid var(--border);
  border-radius:   14px;
  overflow:        hidden;
  transition:      all 0.3s;
  cursor:          pointer;
  text-decoration: none;
  display:         block;
  color:           inherit;
}

.project-card:hover {
  border-color: var(--border2);
  transform:    translateY(-4px);
  box-shadow:   0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Emoji thumbnail area — background set inline per project */
.project-thumb {
  height:          180px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       48px;
  position:        relative;
  overflow:        hidden;
}

/* Gradient fade at bottom of thumb */
.project-thumb::after {
  content:    '';
  position:   absolute;
  inset:      0;
  background: linear-gradient(to bottom, transparent 50%, var(--bg2));
}

.project-body { padding: 1.25rem; }

.project-tags {
  display:       flex;
  gap:           6px;
  flex-wrap:     wrap;
  margin-bottom: 0.75rem;
}

/* Technology tags (HTML / CSS / etc.) */
.tag {
  padding:       3px 10px;
  border-radius: 100px;
  font-size:     11px;
  font-family:   var(--font-mono);
  border:        1px solid var(--border);
  color:         var(--text3);
  background:    var(--bg3);
}

.project-title {
  font-size:     16px;
  font-weight:   500;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size:     13px;
  color:         var(--text2);
  line-height:   1.6;
  margin-bottom: 1rem;
  font-weight:   300;
}

.project-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  font-size:       12px;
  color:           var(--text3);
  font-family:     var(--font-mono);
}

.project-link {
  color:       var(--accent2);
  display:     flex;
  align-items: center;
  gap:         4px;
  font-size:   12px;
}


/* ══════════════════════════════════════════════════════════
   11. REVIEWS
   — To add a review: copy a <div class="review-card"> block in HTML
   ══════════════════════════════════════════════════════════ */
.reviews-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:                   1.5rem;
}

.review-card {
  background:   var(--bg2);
  border:       1px solid var(--border);
  border-radius: 14px;
  padding:      1.5rem;
  transition:   border-color 0.2s;
}

.review-card:hover { border-color: var(--border2); }

.review-stars {
  color:         #fbbf24;   /* gold stars */
  font-size:     13px;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.review-text {
  font-size:     14px;
  color:         var(--text2);
  line-height:   1.7;
  font-weight:   300;
  margin-bottom: 1.25rem;
  font-style:    italic;
}

.reviewer-info {
  display:     flex;
  align-items: center;
  gap:         10px;
}

/* Initials avatar circle — colors set inline per reviewer */
.rev-avatar {
  width:           38px;
  height:          38px;
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       13px;
  font-weight:     500;
  flex-shrink:     0;
}

.rev-name { font-size: 13px; font-weight: 500; }
.rev-role { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }


/* ══════════════════════════════════════════════════════════
   12. CONTACT
   ══════════════════════════════════════════════════════════ */
.contact-grid {
  display:     grid;
  grid-template-columns: 1fr 1.5fr;
  gap:         3rem;
  align-items: start;
}

.contact-info h3 {
  font-family:   var(--font-display);
  font-size:     24px;
  margin-bottom: 1rem;
}

.contact-info p {
  font-size:     14px;
  color:         var(--text2);
  line-height:   1.8;
  margin-bottom: 2rem;
  font-weight:   300;
}

.contact-links {
  display:        flex;
  flex-direction: column;
  gap:            12px;
}

.contact-link {
  display:         flex;
  align-items:     center;
  gap:             12px;
  font-size:       13px;
  color:           var(--text2);
  text-decoration: none;
  transition:      color 0.2s;
}

.contact-link:hover { color: var(--text); }

.contact-link-icon {
  width:           36px;
  height:          36px;
  border-radius:   8px;
  border:          1px solid var(--border);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       14px;
  background:      var(--bg3);
  flex-shrink:     0;
}

/* Contact form card */
.contact-form {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: 16px;
  padding:       2rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display:        block;
  font-size:      12px;
  font-family:    var(--font-mono);
  color:          var(--text3);
  letter-spacing: 0.08em;
  margin-bottom:  8px;
  text-transform: uppercase;
}

.form-input {
  width:       100%;
  padding:     10px 14px;
  background:  var(--bg3);
  border:      1px solid var(--border);
  border-radius: 8px;
  color:       var(--text);
  font-family: var(--font-body);
  font-size:   14px;
  outline:     none;
  transition:  border-color 0.2s;
}

.form-input:focus       { border-color: var(--accent); }
.form-input::placeholder { color: var(--text3); }

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


/* ══════════════════════════════════════════════════════════
   13. FOOTER
   ══════════════════════════════════════════════════════════ */
footer {
  border-top:  1px solid var(--border);
  padding:     2rem;
  text-align:  center;
  font-size:   12px;
  color:       var(--text3);
  font-family: var(--font-mono);
}

.footer-socials {
  display:         flex;
  gap:             12px;
  justify-content: center;
  margin-bottom:   1rem;
}

/* Social icon circle buttons */
.soc {
  width:           38px;
  height:          38px;
  border:          1px solid var(--border);
  border-radius:   8px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  color:           var(--text3);
  text-decoration: none;
  font-size:       14px;
  transition:      all 0.2s;
  background:      var(--bg2);
}

.soc:hover {
  border-color: var(--border2);
  color:        var(--text);
  background:   var(--bg3);
}


/* ══════════════════════════════════════════════════════════
   14. TOAST NOTIFICATION
   ══════════════════════════════════════════════════════════ */
.toast {
  position:      fixed;
  bottom:        2rem;
  right:         2rem;
  padding:       12px 20px;
  background:    var(--bg3);
  border:        1px solid var(--border2);
  border-radius: 10px;
  font-size:     13px;
  color:         var(--text);
  z-index:       999;
  /* Hidden by default — JS adds .show to reveal */
  transform:     translateY(100px);
  opacity:       0;
  transition:    all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display:       flex;
  align-items:   center;
  gap:           8px;
}

.toast.show {
  transform: translateY(0);
  opacity:   1;
}

.toast-icon {
  color:     var(--accent3);
  font-size: 16px;
}


/* ══════════════════════════════════════════════════════════
   15. ANIMATIONS
   — Elements with .fade-in start invisible;
     JS adds .visible when they scroll into view
   ══════════════════════════════════════════════════════════ */
.fade-in {
  opacity:    0;
  transform:  translateY(20px);
  transition: opacity 0.7s, transform 0.7s;
}

.fade-in.visible {
  opacity:   1;
  transform: none;
}

/* About section two-column layout */
.about-grid {
  display:     grid;
  grid-template-columns: 1.2fr 1fr;
  gap:         4rem;
  align-items: start;
}

.about-text p {
  font-size:     15px;
  color:         var(--text2);
  line-height:   1.9;
  margin-bottom: 1.25rem;
  font-weight:   300;
}

/* Timeline with vertical line */
.timeline { position: relative; }

.timeline::before {
  content:    '';
  position:   absolute;
  left: 0; top: 8px; bottom: 0;
  width:      1px;
  background: var(--border2);
}

.tl-item {
  padding-left: 1.5rem;
  position:     relative;
  margin-bottom: 1.75rem;
}

/* Glowing dot on the timeline line */
.tl-item::before {
  content:       '';
  position:      absolute;
  left: -4px; top: 6px;
  width:         9px;
  height:        9px;
  border-radius: 50%;
  background:    var(--accent);
  box-shadow:    0 0 12px var(--accent);
}

.tl-year  { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 3px; }
.tl-title { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.tl-desc  { font-size: 13px; color: var(--text3); }


/* ══════════════════════════════════════════════════════════
   16. MOBILE RESPONSIVE  (max-width: 768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Hide nav links on mobile */
  nav { padding: 0 1.25rem; }
  .nav-links { display: none; }

  /* Tighter section padding */
  .section { padding: 4rem 1.25rem; }

  /* Dashboard: 2 columns instead of 4 */
  .dash-grid { grid-template-columns: repeat(2, 1fr); }

  /* Skills: single column */
  .skills-grid { grid-template-columns: 1fr; }

  /* About & Contact: stack vertically */
  .about-grid   { grid-template-columns: 1fr; gap: 2rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }

  /* Stats row wraps */
  .stats-row { flex-wrap: wrap; }
  .stat-item {
    min-width:    45%;
    border-right:  none;
    border-bottom: 1px solid var(--border);
  }
}

/* ══════════════════════════════════════════════════════════
   GALLERY — معرض الصور
   ══════════════════════════════════════════════════════════ */

/* عداد الصور فوق الكارت */
.img-count {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 100px;
  font-family: var(--font-mono);
  z-index: 2;
  backdrop-filter: blur(6px);
}

/* زر "صور / فيديو" داخل الكارت */
.proj-media-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(124,106,255,0.12);
  color: var(--accent2);
  border: 1px solid rgba(124,106,255,0.25);
  border-radius: 100px;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s;
}
.proj-media-btn:hover { background: rgba(124,106,255,0.22); }

/* ── Overlay backdrop ── */
#gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
}
#gallery-overlay.open { opacity: 1; }

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,5,10,0.88);
  backdrop-filter: blur(8px);
}

/* ── Modal box ── */
.gallery-modal {
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  transform: scale(0.94);
  transition: transform 0.3s;
}
#gallery-overlay.open .gallery-modal { transform: scale(1); }

/* ── Header ── */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.gallery-title {
  font-size: 16px;
  font-weight: 500;
}
.gallery-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
}
.gallery-close:hover { background: var(--bg4); color: var(--text); }

/* ── Slides ── */
.gallery-slides { margin-bottom: 1rem; }
.gallery-media-item { animation: fadeSlide 0.25s ease; }
@keyframes fadeSlide { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ── Nav buttons ── */
.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gallery-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
}
.gallery-nav-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.gallery-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
  min-width: 50px;
  text-align: center;
}

/* ── Thumbnails ── */
.gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.gallery-thumb {
  width: 60px; height: 45px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb:hover  { border-color: var(--border2); }

/* ══════════════════════════════════════════════════════════
   PROJECT MODAL — نافذة تفاصيل المشروع
   ══════════════════════════════════════════════════════════ */

/* Overlay */
.proj-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(5, 5, 12, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
}
.proj-modal-overlay.open { opacity: 1; }

/* Modal box */
.proj-modal-box {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  transform: scale(0.93) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.proj-modal-overlay.open .proj-modal-box {
  transform: scale(1) translateY(0);
}

/* زر الإغلاق */
.proj-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 10;
  transition: all 0.2s;
}
.proj-modal-close:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* قسم اليسار: الصور */
.proj-modal-left {
  padding: 1.5rem;
  border-left: 1px solid var(--border);
}

/* معرض الصور */
.modal-gallery { display: flex; flex-direction: column; gap: 10px; }

/* thumbnails */
.modal-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.modal-thumb {
  width: 64px;
  height: 48px;
  border-radius: 7px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.modal-thumb:hover  { border-color: var(--border2); transform: scale(1.05); }
.modal-thumb.active { border-color: var(--accent); }

/* صورة الإيموجي الكبير */
.modal-emoji-hero {
  height: 260px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* قسم اليمين: التفاصيل */
.proj-modal-right {
  padding: 2rem 1.75rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.proj-modal-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.proj-modal-title {
  font-family: var(--font-display, 'Tajawal', sans-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.proj-modal-year {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono, monospace);
  display: flex;
  align-items: center;
  gap: 6px;
}

.proj-modal-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.8;
  font-weight: 300;
}

/* زر زيارة الموقع */
.proj-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(124, 106, 255, 0.3);
  align-self: flex-start;
}
.proj-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(124, 106, 255, 0.4);
}

.proj-modal-btn-disabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--bg3);
  color: var(--text3);
  border-radius: 9px;
  font-size: 14px;
  border: 1px solid var(--border);
  align-self: flex-start;
}

/* معلومات إضافية */
.proj-modal-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.proj-meta-item {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono, monospace);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Mobile */
@media (max-width: 700px) {
  .proj-modal-box {
    grid-template-columns: 1fr;
    max-height: 88vh;
  }
  .proj-modal-left {
    border-left: none;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
  }
  .proj-modal-right { padding: 1.25rem; }
}
