/* Custom CSS for Mohamed Osman Portfolio - Native HTML/CSS/JS/PHP stack */

:root {
  --bg-primary: #09090b;
  --bg-secondary: #18181b;
  --bg-tertiary: #27272a;
  --bg-card: rgba(24, 24, 27, 0.8);
  --border-color: rgba(39, 39, 42, 0.8);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-emerald-bg: rgba(16, 185, 129, 0.1);
  --accent-sky: #38bdf8;
  --accent-sky-bg: rgba(56, 189, 248, 0.1);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --radius-lg: 1rem;
  --radius-md: 0.75rem;
  --radius-sm: 0.5rem;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.9);
  --border-color: rgba(226, 232, 240, 0.9);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-emerald: #059669;
  --accent-emerald-hover: #047857;
  --accent-emerald-bg: rgba(5, 150, 105, 0.1);
  --accent-sky: #0284c7;
  --accent-sky-bg: rgba(2, 132, 199, 0.1);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Utility Classes & Animations */
.container {
  max-width: 56rem; /* 4xl */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Keyframe Animations */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes terminal-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes button-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes card-entry-fade {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Scroll Reveal Classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-card {
  opacity: 0;
  transform: translateY(20px);
  animation: card-entry-fade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

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

.bg-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.bg-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 12px 30px -10px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

/* Top Scroll Progress Bar */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-sky));
  z-index: 9999;
  transition: width 0.08s ease-out;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

/* Header & Sticky Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(9, 9, 11, 0.4);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

[data-theme="light"] .navbar {
  background-color: rgba(248, 250, 252, 0.5);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0.5rem 0;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid var(--accent-emerald);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.7rem;
  list-style: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-emerald);
}

.nav-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  gap: 0.3rem;
}

.nav-actions-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-switcher {
  display: flex;
  align-items: center;
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
  box-sizing: border-box;
}

.lang-btn {
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  padding: 0.25rem 0;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  text-align: center;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background-color: var(--accent-emerald);
  color: #09090b;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-emerald {
  background-color: var(--accent-emerald);
  color: #09090b;
}

#cv-trigger-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.btn-emerald:hover {
  background-color: var(--accent-emerald-hover);
}

.btn-sky {
  background-color: var(--accent-sky-bg);
  color: var(--accent-sky);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-sky:hover {
  background-color: rgba(56, 189, 248, 0.2);
}

.btn-outline {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background-color: var(--bg-tertiary);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--accent-emerald);
}

/* Hero Section */
.hero-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr auto;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: var(--accent-emerald-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-ring 2s infinite;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 3rem;
  }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.metric-card {
  text-align: center;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-emerald);
  box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.2);
}

.metric-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

.metric-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Terminal Component */
.terminal-card {
  background-color: #09090b;
  border: 1px solid #27272a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.terminal-card:hover {
  box-shadow: 0 15px 35px -10px rgba(16, 185, 129, 0.2);
}

.terminal-header {
  background-color: #18181b;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #27272a;
}

.terminal-dots {
  display: flex;
  gap: 0.35rem;
}

.terminal-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.terminal-dot:hover {
  transform: scale(1.2);
}

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

.terminal-body {
  padding: 1rem;
  color: #34d399;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 12.5rem;
}

.terminal-cursor {
  display: inline-block;
  width: 0.5rem;
  height: 0.9rem;
  background-color: #34d399;
  vertical-align: middle;
  margin-left: 2px;
  animation: terminal-cursor-blink 1s infinite;
}

/* Sections General */
.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

/* Timeline Components */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.4rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 9999px;
  background-color: var(--bg-primary);
  border: 2px solid var(--accent-emerald);
}

.timeline-item.current .timeline-dot {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.timeline-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.timeline-role {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-company {
  color: var(--accent-emerald);
  font-weight: 600;
  font-size: 0.875rem;
}

.timeline-period {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.timeline-highlights {
  list-style: none;
  margin-bottom: 1rem;
}

.timeline-highlights li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.timeline-highlights li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-emerald);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Filter Controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  outline: none;
  width: 100%;
  max-width: 16rem;
}

.search-input:focus {
  border-color: var(--accent-emerald);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--accent-emerald);
  color: #09090b;
  border-color: var(--accent-emerald);
}

/* Grid Layouts */
.grid-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-cards-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cert-card, .stack-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cert-card:hover, .stack-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-emerald);
}

/* Modal Styling */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 42rem;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

/* Form Styles */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-textarea {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-emerald);
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* CLI Interactive Terminal Styles */
.cli-pill-btn {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.4rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.cli-pill-btn:hover {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.cli-pill-btn:active {
  transform: translateY(0);
}

.cli-terminal-card {
  background-color: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cli-terminal-card:focus-within {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.15);
}

#cli-output::-webkit-scrollbar {
  width: 6px;
}

#cli-output::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

#cli-output::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

#cli-output::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.4);
}

/* Print Styles */
@media print {
  .no-print, .navbar, .btn, .filter-bar, .modal-backdrop {
    display: none !important;
  }
  body, html {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .bg-card, .timeline-content {
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
  }
}
