/* DeyaAldeen Portfolio - Main Styles */

/* ============================================
   CSS Variables - Light & Dark Theme
   ============================================ */
:root {
  --bg-main: #FDFBF7;
  --bg-card: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --accent: #F97316;
  --border-subtle: rgba(15, 23, 42, 0.1);
  --section-dark-bg: #0F172A;
  --tech-grid-color: rgba(15, 23, 42, 0.05);
}

.dark {
  --bg-main: #0F172A;
  --bg-card: #1E293B;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-tertiary: #64748B;
  --accent: #FB923C;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --section-dark-bg: #020617;
  --tech-grid-color: rgba(255, 255, 255, 0.05);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-main);
  color: var(--text-primary);
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
  min-height: 100vh;
}

.dark body {
  background-color: #0F172A;
}

.font-serif {
  font-family: 'Playfair Display', Georgia, serif;
}

.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================
   Theme Utility Classes
   ============================================ */
.theme-text-primary { color: var(--text-primary); }
.theme-text-secondary { color: var(--text-secondary); }
.theme-text-tertiary { color: var(--text-tertiary); }
.theme-border { border-color: var(--border-subtle); }
.theme-section-dark { background-color: var(--section-dark-bg); color: #fff; }
.theme-bg-card { background-color: var(--bg-card); }
.theme-bg-main { background-color: var(--bg-main); }

/* ============================================
   Background Grid Pattern
   ============================================ */
.bg-tech-grid {
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, var(--tech-grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--tech-grid-color) 1px, transparent 1px);
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  width: 100%;
  z-index: 50;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border-subtle);
}

.nav.scrolled {
  background-color: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(12px);
  height: 64px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dark .nav.scrolled {
  background-color: rgba(15, 23, 42, 0.95);
}

.nav:not(.scrolled) {
  background-color: transparent;
  height: 96px;
}

.nav-link {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  text-decoration: none;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  background-color: var(--section-dark-bg);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 25px 50px -12px rgba(249, 115, 22, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: var(--accent);
}

/* ============================================
   Spotlight Card Effect
   ============================================ */
.spotlight-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.dark .spotlight-card {
  background-color: rgba(255, 255, 255, 0.05);
}

.spotlight-effect {
  pointer-events: none;
  position: absolute;
  inset: -1px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ============================================
   Brand Logo Cards
   ============================================ */
.brand-logo {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  transition: all 0.5s ease;
  overflow: hidden;
  cursor: crosshair;
}

.dark .brand-logo {
  background-color: rgba(255, 255, 255, 0.05);
}

.brand-logo:hover {
  border-color: var(--accent);
  box-shadow: 0 25px 50px -12px rgba(249, 115, 22, 0.1);
}

.brand-logo .tech-reveal {
  position: absolute;
  inset: 0;
  background-color: var(--accent);
  transform: translateY(100%);
  transition: transform 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.brand-logo:hover .tech-reveal {
  transform: translateY(0);
}

.brand-logo .tech-reveal-text {
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.7s ease 0.1s;
}

.brand-logo:hover .tech-reveal-text {
  opacity: 1;
}

.brand-logo .logo-text {
  position: relative;
  z-index: 10;
  text-align: center;
  transition: all 0.5s ease;
}

.brand-logo:hover .logo-text {
  opacity: 0;
  transform: scale(0.9);
}

.brand-logo .corner-accent {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--border-subtle);
  transition: border-color 0.3s ease;
}

.brand-logo:hover .corner-accent {
  border-color: white;
}

.brand-logo .corner-accent.top-left {
  top: 8px;
  left: 8px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.brand-logo .corner-accent.bottom-right {
  bottom: 8px;
  right: 8px;
  border-bottom: 1px solid;
  border-right: 1px solid;
}

/* ============================================
   Testimonial Cards
   ============================================ */
.testimonial-card {
  width: 400px;
  flex-shrink: 0;
  padding: 32px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin: 0 16px;
  position: relative;
  transition: border-color 0.3s ease;
}

.testimonial-card:hover {
  border-color: var(--accent);
}

.testimonial-quote-icon {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 32px;
  height: 32px;
  color: rgba(249, 115, 22, 0.2);
}

/* ============================================
   Accordion
   ============================================ */
.accordion-item {
  border-bottom: 1px solid var(--border-subtle);
}

.accordion-button {
  width: 100%;
  padding: 32px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-radius: 2px;
}

.accordion-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.accordion-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: all 0.5s ease;
}

.accordion-content.open {
  max-height: 160px;
  opacity: 1;
  padding-bottom: 32px;
  padding-left: 16px;
  padding-right: 16px;
}

/* ============================================
   Range Slider
   ============================================ */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -8px;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
  transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

/* ============================================
   Form Inputs - Floating Labels
   ============================================ */
.form-group {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.3s ease;
}

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

.form-label {
  position: absolute;
  left: 0;
  top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: all 0.3s ease;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: -16px;
  font-size: 12px;
  color: var(--accent);
}

/* ============================================
   Animations - Keyframes
   ============================================ */
@keyframes drawLine {
  0% { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

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

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marquee-reverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Animation Classes */
.animate-draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2s ease-out forwards;
}

.animate-fade-up {
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
}

.animate-marquee {
  animation: marquee 60s linear infinite;
}

.animate-marquee-reverse {
  animation: marquee-reverse 60s linear infinite;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin-slow {
  animation: spin 60s linear infinite;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* Hover pause animation */
.group:hover .animate-marquee,
.group:hover .animate-marquee-reverse {
  animation-play-state: paused;
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu {
  display: none;
  position: fixed;
  top: 96px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-main);
  z-index: 40;
  padding: 48px 24px;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu-link {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  padding: 16px 0;
  transition: padding-left 0.3s ease;
}

.mobile-menu-link:hover {
  padding-left: 8px;
}

/* ============================================
   Utility Classes
   ============================================ */
.container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 1024px) {
  .container {
    padding: 0 48px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Gradient overlays for marquee */
.marquee-fade-left {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 128px;
  background: linear-gradient(to right, var(--bg-main), transparent);
  z-index: 10;
  pointer-events: none;
}

.marquee-fade-right {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 128px;
  background: linear-gradient(to left, var(--bg-main), transparent);
  z-index: 10;
  pointer-events: none;
}

.dark .marquee-fade-left {
  background: linear-gradient(to right, var(--section-dark-bg), transparent);
}

.dark .marquee-fade-right {
  background: linear-gradient(to left, var(--section-dark-bg), transparent);
}

/* Section specific fades */
.testimonials-section .marquee-fade-left,
.testimonials-section .marquee-fade-right {
  background: linear-gradient(to right, var(--bg-main), transparent);
}

.dark .testimonials-section .marquee-fade-left {
  background: linear-gradient(to right, var(--bg-main), transparent);
}

.dark .testimonials-section .marquee-fade-right {
  background: linear-gradient(to left, var(--bg-main), transparent);
}

/* ============================================
   Responsive Breakpoints
   ============================================ */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .testimonial-card {
    width: 320px;
  }
}

@media (min-width: 769px) {
  .mobile-nav-toggle {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }
}

/* ============================================
   Floating WhatsApp Button
   ============================================ */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background-color: var(--section-dark-bg);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 999;
}

.whatsapp-float:hover {
  background-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(249, 115, 22, 0.4);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .whatsapp-float svg {
    width: 24px;
    height: 24px;
  }
}
