/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --blue-50:    #E6F1FB;
  --blue-100:   #B5D4F4;
  --blue-600:   #185FA5;
  --blue-800:   #0C447C;
  --blue-900:   #042C53;
  --purple-50:  #EEEDFE;
  --purple-100: #CECBF6;
  --purple-600: #534AB7;
  --purple-800: #3C3489;
  --teal-50:    #E1F5EE;
  --teal-800:   #085041;
  --coral-50:   #FAECE7;
  --coral-800:  #712B13;
  --gray-200:   #B4B2A9;
  --gray-600:   #5F5E5A;
  --bg:         #F7F8FA;
  --bg-card:    #FFFFFF;
  --text-main:  #1A1A1A;
  --text-mute:  #6B6B6B;
  --text-hint:  #9A9A9A;
  --border:     rgba(0,0,0,0.08);
  --border-md:  rgba(0,0,0,0.14);
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  22px;
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #111215;
    --bg-card:   #1C1D21;
    --text-main: #F0F0F0;
    --text-mute: #9A9AA0;
    --text-hint: #555;
    --border:    rgba(255,255,255,0.07);
    --border-md: rgba(255,255,255,0.13);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.7;
  transition: direction 0.2s;
}

body.ltr {
  direction: ltr;
  font-family: 'Space Mono', 'Tajawal', sans-serif;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== NAVBAR ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  font-family: 'Space Mono', monospace;
  font-weight: 700; font-size: 17px;
  color: var(--text-main); letter-spacing: -0.5px;
}
.nav-logo .accent { color: var(--blue-600); }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--text-mute); text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-main); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Language Toggle */
.lang-toggle {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-md);
  background: var(--bg);
  color: var(--text-mute);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
.lang-toggle:hover {
  border-color: var(--blue-600);
  color: var(--blue-600);
}
.lang-toggle.active {
  background: var(--blue-600);
  color: #fff;
  border-color: var(--blue-600);
}

.nav-menu {
  display: none; background: none; border: none;
  font-size: 22px; color: var(--text-main); cursor: pointer;
}

/* Mobile */
.mobile-menu {
  display: none; flex-direction: column;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem; gap: 0.75rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 15px; color: var(--text-mute); text-decoration: none; font-weight: 500; }

@media (max-width: 620px) {
  .nav-links { display: none; }
  .nav-menu  { display: block; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-600) 60%, #2563eb 100%);
  padding: 5rem 2rem 4rem;
  text-align: center; overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; max-width: 600px; margin: 0 auto; }
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.07) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.hero-tag {
  display: inline-block; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,0.15); color: #fff;
  padding: 5px 16px; border-radius: 100px; margin-bottom: 1.25rem;
  border: 1px solid rgba(255,255,255,0.2);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 900;
  color: #fff; line-height: 1.2; margin-bottom: 1rem;
}
.hero-sub { font-weight: 400; opacity: 0.85; }
.hero-desc { font-size: 16px; color: rgba(255,255,255,0.8); max-width: 420px; margin: 0 auto 2rem; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--blue-800);
  font-family: 'Tajawal', sans-serif; font-size: 15px; font-weight: 700;
  padding: 12px 28px; border-radius: 100px; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.25); }

/* ===== SECTION ===== */
.section { padding: 3.5rem 0; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.section-title { font-size: 22px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.section-subtitle { font-size: 14px; color: var(--text-mute); }
.section-count {
  font-family: 'Space Mono', monospace; font-size: 12px;
  color: var(--text-hint); background: var(--bg);
  border: 1px solid var(--border); padding: 4px 12px;
  border-radius: 100px; white-space: nowrap; margin-top: 4px;
}

/* ===== FILTERS ===== */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.75rem; }
.filter-btn {
  font-family: 'Tajawal', sans-serif; font-size: 14px; font-weight: 500;
  padding: 7px 18px; border-radius: 100px;
  border: 1px solid var(--border-md); background: var(--bg-card);
  color: var(--text-mute); cursor: pointer; transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--blue-600); color: var(--blue-600); }
.filter-btn.active { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }

/* ===== APPS GRID ===== */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

/* ===== APP CARD ===== */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-md); }
.app-card.wip { opacity: 0.75; }
.app-card.hidden { display: none; }

/* THUMB */
.card-thumb {
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  position: relative; border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.thumb-blue   { background: var(--blue-50); }
.thumb-purple { background: var(--purple-50); }
.thumb-teal   { background: var(--teal-50); }
.thumb-coral  { background: var(--coral-50); }

@media (prefers-color-scheme: dark) {
  .thumb-blue   { background: #0D2340; }
  .thumb-purple { background: #1A1650; }
  .thumb-teal   { background: #0A2920; }
  .thumb-coral  { background: #2C1208; }
}

/* APP ICON IMAGE */
.app-icon {
  width: 76px; height: 76px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.thumb-emoji {
  font-size: 44px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

.card-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; font-weight: 700;
  background: var(--blue-600); color: #fff;
  padding: 3px 10px; border-radius: 100px;
}
.badge-wip { background: var(--gray-600); }

/* LTR: flip badge side */
body.ltr .card-badge { left: auto; right: 10px; }

/* CARD BODY */
.app-card { display: flex; flex-direction: column; }
.card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.card-desc { flex: 1; }
.card-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-name { font-size: 16px; font-weight: 700; color: var(--text-main); line-height: 1.3; }
.card-tag {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 100px;
  white-space: nowrap; flex-shrink: 0;
}
.tag-mobile { background: var(--blue-50);    color: var(--blue-800); }
.tag-web    { background: var(--teal-50);    color: var(--teal-800); }
.tag-tool   { background: var(--purple-50);  color: var(--purple-800); }
.tag-game   { background: var(--coral-50);   color: var(--coral-800); }

@media (prefers-color-scheme: dark) {
  .tag-mobile { background: #0D2340; color: var(--blue-100); }
  .tag-web    { background: #0A2920; color: #9FE1CB; }
  .tag-tool   { background: #1A1650; color: var(--purple-100); }
  .tag-game   { background: #2C1208; color: #F5C4B3; }
}

.card-desc { font-size: 13.5px; color: var(--text-mute); line-height: 1.6; margin-bottom: 14px; }
.card-footer { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }

.btn-primary {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Tajawal', sans-serif; font-size: 14px; font-weight: 700;
  padding: 9px 0; border-radius: var(--radius-md);
  border: none; background: var(--blue-600); color: #fff;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--blue-800); transform: scale(1.02); }
.btn-primary.btn-disabled {
  background: var(--gray-200); color: var(--gray-600);
  cursor: not-allowed; transform: none;
}

/* ===== ABOUT ===== */
.about-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 3rem 0;
}
.about-card {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 2rem;
}
.about-avatar { font-size: 52px; line-height: 1; flex-shrink: 0; }
.about-text h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text-main); }
.about-text p  { font-size: 15px; color: var(--text-mute); line-height: 1.7; }

/* ===== CONTACT ===== */
.contact-section { padding: 3.5rem 0; text-align: center; }
.contact-section .section-title   { margin-bottom: 6px; }
.contact-section .section-subtitle { margin-bottom: 2rem; }
.contact-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.contact-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-mute);
  text-decoration: none; background: var(--bg-card);
  border: 1px solid var(--border-md); padding: 10px 20px;
  border-radius: 100px; transition: all 0.15s;
}
.contact-item:hover { border-color: var(--blue-600); color: var(--blue-600); }
.contact-item i { font-size: 18px; }

/* ===== FOOTER ===== */
.footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 1.5rem 2rem; text-align: center; }
.footer p { font-size: 13px; color: var(--text-hint); font-family: 'Space Mono', monospace; }