/* ==========================================================================
   Mohammad Khaddam - Senior Full Stack Developer Portfolio CSS
   Ultra-modern glassmorphism design system with neon dark mode & micro-interactions
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  --bg-body: #07090e;
  --bg-surface: #0f1420;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.35);
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-arabic: 'Tajawal', sans-serif;
  --font-code: 'Fira Code', monospace;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(241, 245, 249, 1);
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(99, 102, 241, 0.5);
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

/* Force Bootstrap text utility overrides for high contrast */
.text-muted {
  color: var(--text-muted) !important;
}

.text-dim {
  color: var(--text-dim) !important;
}

.text-main {
  color: var(--text-main) !important;
}

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

/* Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
}

body[dir="rtl"] {
  font-family: var(--font-arabic), var(--font-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Interactive Canvas Background */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Custom Selection */
::selection {
  background: var(--primary);
  color: #fff;
}

/* Typography Utilities */
.text-gradient {
  background: linear-gradient(135deg, #a5b4fc 0%, var(--primary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #67e8f9 0%, var(--accent) 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.font-code {
  font-family: var(--font-code);
}

/* Navbar */
.navbar-custom {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  transition: var(--transition-smooth);
  z-index: 1030;
}

.navbar-custom.scrolled {
  padding: 0.6rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.brand-logo {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--border-glow);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-code);
}

.nav-link-custom {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav-link-custom:hover,
.nav-link-custom.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Buttons */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
  color: #fff;
}

.btn-outline-custom {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 600;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline-custom:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-main);
  transform: translateY(-2px);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: var(--accent);
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
}

/* Hero Section */
.hero-section {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 7rem 0 4rem 0;
  position: relative;
}

.avatar-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}

.avatar-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  opacity: 0.6;
  filter: blur(20px);
  animation: pulseGlow 4s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.05); opacity: 0.8; }
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.status-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--emerald);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: blink 1.5s infinite;
}

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

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid var(--border-glow);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Stats Card */
.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: center;
  transition: var(--transition-fast);
}

.stat-box:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-label {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Interactive Code Terminal */
.terminal-window {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.terminal-header {
  background: #111726;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.terminal-dots {
  display: flex;
  gap: 8px;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-tabs {
  display: flex;
  gap: 6px;
}

.terminal-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.terminal-tab.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent);
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-code);
  font-size: 0.875rem;
  color: #e2e8f0;
  min-height: 220px;
  overflow-x: auto;
}

.code-keyword { color: #c678dd; }
.code-function { color: #61afef; }
.code-string { color: #98c379; }
.code-variable { color: #e06c75; }
.code-comment { color: #5c6370; font-style: italic; }

/* Filter Tabs */
.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.filter-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

/* Project Cards */
.project-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-img-wrapper {
  height: 200px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

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

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

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

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

.project-tech-chip {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glow);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-code);
}

.project-badge-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glow);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

/* Timeline */
.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2.5rem;
  border-left: 2px solid var(--border-color);
}

body[dir="rtl"] .timeline-item {
  padding-left: 0;
  padding-right: 2rem;
  border-left: none;
  border-right: 2px solid var(--border-color);
}

.timeline-item:last-child {
  border-color: transparent;
}

.timeline-dot {
  position: absolute;
  left: -9px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

body[dir="rtl"] .timeline-dot {
  left: auto;
  right: -9px;
}

/* Skill Progress */
.skill-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition-fast);
}

.skill-card:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.skill-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* Contact Item */
.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.contact-item:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-main);
  transform: translateX(6px);
}

/* Modal Customization */
.modal-content-custom {
  background: #0f1420;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  color: var(--text-main);
}

#modalProjectDesc {
  color: #cbd5e1 !important;
  font-size: 0.95rem;
  line-height: 1.6;
}

#modalProjectHighlights li {
  color: #94a3b8;
  font-size: 0.9rem;
}

.modal-header-custom {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.75rem;
}

.modal-footer-custom {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.75rem;
}

/* Form Controls */
.form-control-custom {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.form-control-custom:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  color: var(--text-main);
  box-shadow: 0 0 15px var(--primary-glow);
}

.form-control-custom::placeholder {
  color: var(--text-dim);
}

/* Toast Notification */
.toast-custom {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 2000;
  background: #0f172a;
  border: 1px solid var(--emerald);
  color: var(--text-main);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition-smooth);
}

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

/* Section Title */
.section-subtitle {
  font-family: var(--font-code);
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 1.25rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* Responsive fixes */
@media (max-width: 768px) {
  .section-title { font-size: 1.8rem; }
  .stat-number { font-size: 1.75rem; }
  .avatar-wrapper { width: 200px; height: 200px; }
  .toast-custom { left: 20px; right: 20px; bottom: 20px; }
}
