/* ==========================================================================
   Ebrahim Mohammed Gaber - Executive & Academic Portfolio Design System
   Modern RTL-first CSS with Glassmorphism, Theme Variables & Responsive Grid
   ========================================================================== */

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

:root {
  /* Color Palette - Executive Dark Luxury */
  --bg-dark: #070b14;
  --bg-primary: #0c1322;
  --bg-secondary: #141e33;
  --bg-card: rgba(20, 30, 51, 0.7);
  --bg-card-hover: rgba(28, 42, 71, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  
  --accent-gold: #dfb15b;
  --accent-gold-glow: rgba(223, 177, 91, 0.25);
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.2);
  --accent-emerald: #34d399;
  --accent-blue: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-gold: #f3d08a;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-active: rgba(223, 177, 91, 0.4);
  --border-cyan: rgba(56, 189, 248, 0.3);

  --font-arabic: 'Cairo', 'Tajawal', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 35px rgba(223, 177, 91, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-dark: #f1f5f9;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.8);
  
  --accent-gold: #b8860b;
  --accent-cyan: #0284c7;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-gold: #92400e;

  --border-light: rgba(0, 0, 0, 0.08);
  --border-active: rgba(184, 134, 11, 0.4);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
}

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

html {
  font-family: var(--font-arabic);
  direction: rtl;
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(circle at 10% 20%, rgba(14, 23, 42, 0.9) 0%, var(--bg-dark) 80%);
}

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

ul {
  list-style: none;
}

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

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

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

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

.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-cyan {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--text-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-3px);
}

/* Header & Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition-normal);
}

.navbar.scrolled {
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 0;
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  object-fit: cover;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.brand-title {
  font-size: 0.78rem;
  color: var(--accent-gold);
  font-family: var(--font-sans);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-gold);
  background: rgba(223, 177, 91, 0.08);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent-gold);
  border-radius: var(--radius-full);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b8860b 100%);
  color: #070b14;
  box-shadow: 0 4px 15px rgba(223, 177, 91, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(223, 177, 91, 0.45);
  background: linear-gradient(135deg, #eed18e 0%, var(--accent-gold) 100%);
}

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

.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-2px);
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 160px 0 90px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../images/hero-bg.jpg') no-repeat center center / cover;
  opacity: 0.15;
  z-index: -1;
  filter: blur(4px);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 70% 30%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(223, 177, 91, 0.08) 0%, transparent 60%);
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(223, 177, 91, 0.1);
  border: 1px solid rgba(223, 177, 91, 0.3);
  border-radius: var(--radius-full);
  color: var(--accent-gold);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--accent-gold);
  margin-bottom: 20px;
  font-weight: 600;
}

.hero-degree-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.degree-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--accent-cyan);
  font-weight: 600;
}

.hero-vision {
  position: relative;
  padding: 16px 24px;
  border-right: 4px solid var(--accent-gold);
  background: rgba(223, 177, 91, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 28px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-gold);
}

.hero-bio-summary {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Hero Portrait Card */
.hero-card {
  position: relative;
  text-align: center;
  padding: 32px 24px;
}

.portrait-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 24px;
  border-radius: 50%;
  padding: 8px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-cyan) 100%);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.portrait-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-primary);
}

.portrait-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-gold);
  font-family: var(--font-sans);
}

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

/* Section Header */
.section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 50px;
}

.section-subtitle {
  color: var(--accent-gold);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* Cards & Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(223, 177, 91, 0.1);
  border: 1px solid rgba(223, 177, 91, 0.3);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 24px;
}

.card-icon.cyan {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.96rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-bullets {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-bullets li {
  position: relative;
  padding-right: 24px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.card-bullets li::before {
  content: '✓';
  position: absolute;
  right: 0;
  top: 0;
  color: var(--accent-gold);
  font-weight: bold;
}

/* Timeline & Academic Qualifications */
.timeline {
  position: relative;
  padding-right: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  right: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-dot {
  position: absolute;
  right: -28px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 3px solid var(--bg-dark);
}

.timeline-content {
  padding: 20px 24px;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-subtitle {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  font-weight: 600;
}

/* Core Competencies Tags */
.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.skill-tag:hover {
  background: rgba(223, 177, 91, 0.1);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Form Styles */
.contact-form {
  padding: 40px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  background: rgba(7, 11, 20, 0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-arabic);
  font-size: 0.98rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(223, 177, 91, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

/* Footer */
.footer {
  background: #05080f;
  border-top: 1px solid var(--border-light);
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 12px;
  max-width: 400px;
}

.footer-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--accent-gold);
  padding-right: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: calc(100vh - 70px);
    background: var(--bg-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 20px;
    transition: var(--transition-normal);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    border-left: 1px solid var(--border-light);
  }
  .nav-menu.active {
    right: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .hero-cta {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
}
