/* ============================================
    Portfolio Website Styles
    Author: Muhammad Iqbal
   ============================================ */

/* CSS Variables */
:root {
  --bg: #0a0f1e;
  --bg2: #0e152b;
  --card: #0f172e;
  --ring: #202b50;
  --muted: #aeb6c9;
  --text: #e7eaf1;
  --primary: #9ab6ff;
  --accent: #7cf5c5;
  --gridAlpha: 0.045;
}

/* Base Styles */
html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  position: relative;
}

/* Noise Effect */
.noise:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.03"/></svg>');
}

/* Grid Lines Background */
.grid-lines {
  background-image: linear-gradient(rgba(255, 255, 255, var(--gridAlpha)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, var(--gridAlpha)) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(80% 60% at 50% 40%, #000 60%, transparent 100%);
}

/* Aurora Effect */
.aurora {
  position: absolute;
  inset: -10% -20% auto -20%;
  height: 95vh;
  pointer-events: none;
  filter: blur(8px);
  opacity: 0.95;
  background: radial-gradient(700px 320px at 15% 20%, rgba(154, 182, 255, 0.28), transparent 60%),
    radial-gradient(800px 360px at 85% 5%, rgba(124, 245, 197, 0.22), transparent 60%);
}

/* Glass Effect */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(12px);
}

/* Buttons */
.btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #0b1220;
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-outline {
  border: 1px solid var(--ring);
}

/* Shadows */
.shadow-soft {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(154, 182, 255, 0.14);
}

/* Border Gradient */
.border-gradient {
  position: relative;
}

.border-gradient:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(135deg, rgba(154, 182, 255, 0.45), rgba(124, 245, 197, 0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.show {
  opacity: 1;
  transform: none;
}

.reveal-stagger > [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}

.reveal-stagger > [data-reveal].show {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Tilt Effect */
.tilt {
  transform-style: preserve-3d;
  perspective: 800px;
}

.tilt > * {
  transform: translateZ(25px);
}

/* Social Links */
a.social {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.75rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  overflow-y: auto;
  padding: 1rem;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-images {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  border-radius: 1.5rem 1.5rem 0 0;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  opacity: 0;
  transition: opacity 0.5s;
}

.modal-image.active {
  opacity: 1;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
}

.modal-nav button {
  pointer-events: all;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-nav button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.modal-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.modal-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-dot.active {
  background: var(--primary);
  width: 1.5rem;
  border-radius: 0.25rem;
}

/* Tech Tags */
.tech-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(154, 182, 255, 0.15);
  border: 1px solid rgba(154, 182, 255, 0.3);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  margin: 0.25rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .modal-images {
    height: 250px;
  }

  .modal-nav button {
    width: 2.5rem;
    height: 2.5rem;
  }
}