/**
 * IPXOR Portfolio - Global Stylesheet
 * File: assets/css/styles.css
 * Features: Glassmorphism, Particles, 3D Tilt, Magnetic Buttons, Typewriter, Conic Gradients
 */

:root {
  --primary-dark: #050811;
  --cyan: #00d4ff;
  --purple: #a855f7;
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --glass-hover: rgba(255,255,255,0.08);
  --font-main: 'Cairo', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--primary-dark);
  color: #e2e8f0;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ===================== ANIMATED GRADIENT MESH ===================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(0,212,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(168,85,247,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0,212,255,0.04) 0%, transparent 60%);
  animation: meshPulse 12s ease-in-out infinite alternate;
}

@keyframes meshPulse {
  0% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.1) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(-2deg); opacity: 0.8; }
}

/* ===================== PARTICLE CANVAS ===================== */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ===================== MOUSE SPOTLIGHT ===================== */
#cursor-spotlight {
  position: fixed;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: left 0.1s ease, top 0.1s ease;
  mix-blend-mode: screen;
}

/* ===================== MODE TOGGLE BAR ===================== */
.mode-toggle-bar {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 8px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: slideDown 0.6s ease-out;
}
@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-30px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.toggle-inner { display: flex; align-items: center; gap: 12px; }
.toggle-label { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
.mode-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 30px;
  color: #94a3b8;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.mode-btn:hover { color: #fff; }
.mode-btn.active {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #000;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(0,212,255,0.3);
}

/* ===================== VIEW SECTIONS ===================== */
.view-section { display: none; }
.view-section.active { display: block; }

/* ===================== GLASS CARD ===================== */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}
.glass-card:hover { background: var(--glass-hover); border-color: rgba(255,255,255,0.15); }

/* ===================== SECTION STYLING ===================== */
.section-glass { padding: 100px 0; position: relative; }
.section-glass-dark { padding: 100px 0; position: relative; background: rgba(5,8,17,0.5); }
.section-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 1.5rem; color: #fff; }
.section-text { color: #94a3b8; line-height: 1.8; font-size: 1.05rem; }

/* ===================== CLASSIC MODE ===================== */
.hero-classic {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; position: relative;
}
.hero-content { z-index: 2; padding: 2rem; }
.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 50%, var(--purple) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #94a3b8;
  max-width: 700px; margin: 0 auto 2rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; animation: fadeInUp 1s ease-out 0.4s both; }

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

/* Classic Buttons */
.btn-glass {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-glass-primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #000;
}
.btn-glass-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,212,255,0.3); }
.btn-glass-outline {
  background: transparent;
  border-color: var(--glass-border);
  color: #e2e8f0;
}
.btn-glass-outline:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-glass-sm { padding: 0.5rem 1.5rem; font-size: 0.85rem; }

/* Classic Carousel */
.classic-carousel { position: relative; overflow: hidden; }
.carousel-track { display: flex; transition: transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.carousel-slide { min-width: 100%; padding: 1rem; opacity: 0.3; transition: opacity 0.6s; }
.carousel-slide.active { opacity: 1; }
.carousel-dots { display: flex; gap: 8px; justify-content: center; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--glass-border);
  cursor: pointer;
  transition: all 0.3s;
}
.dot.active { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

/* Project Card Classic */
.project-card-classic { text-align: center; max-width: 600px; margin: 0 auto; }
.project-img { width: 100%; height: 250px; object-fit: cover; border-radius: 12px; }
.project-img-placeholder {
  width: 100%; height: 250px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03); border-radius: 12px;
  font-size: 3rem; color: var(--glass-border);
}
.project-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.project-desc { color: #94a3b8; margin-bottom: 1.5rem; }

/* Service Card */
.service-card { transition: transform 0.3s ease; }
.service-card:hover { transform: translateY(-8px); }
.service-icon { font-size: 2.5rem; color: var(--cyan); }
.price-tag {
  display: inline-block;
  background: rgba(0,212,255,0.1);
  color: var(--cyan);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem; font-weight: 600;
}

/* Counter Row Classic */
.counter-row { display: flex; gap: 3rem; margin-top: 2rem; }
.counter-item { text-align: center; }
.counter-num {
  font-size: 3rem; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.counter-label { display: block; color: #94a3b8; font-size: 0.9rem; margin-top: 0.3rem; }

/* About Image */
.about-img-wrapper { padding: 2rem; display: flex; align-items: center; justify-content: center; }
.about-img-placeholder {
  width: 100%; height: 300px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,212,255,0.05), rgba(168,85,247,0.05));
  border: 1px dashed var(--glass-border);
}

/* ===================== INTERACTIVE MODE ===================== */
.hero-interactive {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.floating-logo {
  position: absolute;
  top: 15%; right: 15%;
  font-size: 6rem;
  color: rgba(0,212,255,0.08);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}
.hero-interactive-content { text-align: center; z-index: 2; padding: 2rem; }
.typewriter-text {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--cyan);
  min-height: 1.2em;
  text-shadow: 0 0 30px rgba(0,212,255,0.3);
}
.typewriter-text::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--purple);
}
@keyframes blink { 50% { opacity: 0; } }
.hero-sub-interactive {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #94a3b8;
  max-width: 700px; margin: 1rem auto 2rem;
}
.hero-cta-interactive { display: flex; gap: 1rem; justify-content: center; }

/* Counter Card Interactive */
.counter-card-interactive { border: 1px solid transparent; }
.counter-glow {
  font-size: 4rem; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(0,212,255,0.2);
}

/* 3D Tilt Cards */
.tilt-card-wrapper { perspective: 1000px; }
.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
  overflow: hidden;
}
.tilt-card-border {
  position: absolute; inset: -2px;
  border-radius: 18px;
  background: conic-gradient(from 0deg, var(--cyan), var(--purple), var(--cyan));
  z-index: -1;
  animation: rotateBorder 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}
.tilt-card:hover .tilt-card-border { opacity: 1; }
@keyframes rotateBorder {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.tilt-card-img { width: 100%; height: 180px; object-fit: cover; border-radius: 12px 12px 0 0; }
.tilt-card-placeholder {
  width: 100%; height: 180px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,212,255,0.03);
  font-size: 3rem; color: var(--cyan);
}
.tilt-card-content { padding: 1.5rem; }

/* Magnetic Buttons */
.btn-magnetic {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-magnetic-cyan {
  background: linear-gradient(135deg, var(--cyan), #0099cc);
  color: #000;
  box-shadow: 0 4px 20px rgba(0,212,255,0.3);
}
.btn-magnetic-purple {
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.btn-magnetic:hover { transform: scale(1.05); }
.btn-magnetic.btn-sm { padding: 0.5rem 1.5rem; font-size: 0.85rem; }

/* ===================== CONTACT FORM ===================== */
.form-control-glass {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.form-control-glass:focus {
  background: rgba(255,255,255,0.06);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(0,212,255,0.1);
}
.form-control-glass::placeholder { color: #64748b; }

/* ===================== SOCIAL ICONS ===================== */
.social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #94a3b8;
  margin-right: 0.5rem;
  transition: all 0.3s;
  text-decoration: none;
}
.social-icon:hover {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
  transform: translateY(-3px);
}

/* ===================== FOOTER ===================== */
.site-footer { padding: 2rem 0; border-top: 1px solid var(--glass-border); margin-top: 2rem; }

/* ===================== PROJECT MODAL ===================== */
.project-modal {
  position: fixed; inset: 0;
  z-index: 10000;
  display: none; align-items: center; justify-content: center;
}
.project-modal.active { display: flex; }
.project-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5,8,17,0.9);
  backdrop-filter: blur(8px);
}
.project-modal-content {
  position: relative;
  max-width: 800px; width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2.5rem;
  z-index: 1;
  animation: modalIn 0.4s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.project-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none;
  color: #94a3b8; font-size: 1.5rem;
  cursor: pointer; transition: color 0.3s;
}
.project-modal-close:hover { color: #fff; }
.modal-project-img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; margin-bottom: 1.5rem; }
.modal-tech-badges { margin: 1rem 0; }
.modal-tech-badges .badge {
  background: rgba(0,212,255,0.1);
  color: var(--cyan);
  border: 1px solid rgba(0,212,255,0.2);
  margin-right: 0.5rem; margin-bottom: 0.5rem;
  padding: 0.4rem 0.8rem; border-radius: 20px;
  font-size: 0.8rem;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .hero-cta, .hero-cta-interactive { flex-direction: column; }
  .counter-row { flex-direction: column; gap: 1.5rem; }
  .mode-toggle-bar { width: 90%; }
  .section-glass, .section-glass-dark { padding: 60px 0; }
  .section-title { font-size: 1.8rem; }
}
