/* ==========================================================================
   HASSAN KHALID PORTFOLIO - MAIN STYLESHEET
   Deep Black Theme with Electric Blue, Cyan & Purple Glow accents
   ========================================================================== */

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

:root {
  --bg-dark: #050507;
  --bg-card: rgba(18, 18, 24, 0.5);
  --bg-card-hover: rgba(28, 28, 38, 0.7);
  
  --accent-blue: #0066FF;
  --accent-cyan: #00F2FE;
  --accent-purple: #9D4EDD;
  --accent-pink: #F72585;

  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-glow: rgba(0, 102, 255, 0.3);

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

html {
  scroll-behavior: initial;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Hide default cursor on desktop devices for magnetic cursor only when activated */
@media (pointer: fine) {
  body.custom-cursor-active, 
  body.custom-cursor-active a, 
  body.custom-cursor-active button, 
  body.custom-cursor-active input, 
  body.custom-cursor-active textarea {
    cursor: none !important;
  }
}

/* Noise overlay */
.bg-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 2;
  opacity: 0.8;
}

/* Three.js Canvas Container */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Custom Magnetic Cursor
   -------------------------------------------------------------------------- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent-cyan), 0 0 20px var(--accent-blue);
  transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(0, 242, 254, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out, width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

body.custom-cursor-active .cursor-dot,
body.custom-cursor-active .cursor-ring {
  opacity: 1;
}

.cursor-hover .cursor-ring {
  width: 65px;
  height: 65px;
  border-color: rgba(157, 78, 221, 0.8);
  background: rgba(0, 102, 255, 0.08);
  backdrop-filter: blur(2px);
}

.cursor-hover .cursor-dot {
  width: 12px;
  height: 12px;
  background-color: var(--accent-purple);
  box-shadow: 0 0 15px var(--accent-purple);
}

/* --------------------------------------------------------------------------
   Typography & Glow Text
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
}

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

.text-gradient-primary {
  background: linear-gradient(135deg, #FFFFFF 0%, #00F2FE 50%, #0066FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, #00F2FE 0%, #9D4EDD 50%, #F72585 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-glow-blue {
  text-shadow: 0 0 20px rgba(0, 102, 255, 0.6), 0 0 40px rgba(0, 242, 254, 0.4);
}

.text-glow-cyan {
  text-shadow: 0 0 20px rgba(0, 242, 254, 0.6);
}

/* --------------------------------------------------------------------------
   Glassmorphism Cards
   -------------------------------------------------------------------------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 102, 255, 0.15);
  transform: translateY(-5px);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 6px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.glass-pill:hover {
  background: rgba(0, 102, 255, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

/* Glowing Border Effect */
.glow-border {
  position: relative;
}

.glow-border::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan), var(--accent-purple));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glow-border:hover::after {
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Preloader Styles
   -------------------------------------------------------------------------- */
#preloader {
  position: fixed;
  inset: 0;
  background-color: var(--bg-dark);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 3.5rem;
  letter-spacing: -2px;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #ffffff 0%, #00F2FE 50%, #9D4EDD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.preloader-bar-bg {
  width: 260px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.preloader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 15px var(--accent-cyan);
  transition: width 0.1s linear;
}

.preloader-counter {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* --------------------------------------------------------------------------
   Hero Section & Video Background
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8rem 2rem 4rem 2rem;
  z-index: 10;
}

.hero-video-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
  filter: brightness(0.65) contrast(1.15) saturate(1.1);
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(5, 5, 7, 0.4) 0%, rgba(5, 5, 7, 0.85) 75%, var(--bg-dark) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
}

/* Typewriter & Rotating Title */
.typewriter-text {
  border-right: 3px solid var(--accent-cyan);
  white-space: nowrap;
  animation: blinkCursor 0.75s step-end infinite;
}

@keyframes blinkCursor {
  from, to { border-color: transparent }
  50% { border-color: var(--accent-cyan) }
}

/* Magnetic Buttons */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.2rem;
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0044BB 100%);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px -5px rgba(0, 102, 255, 0.5), 0 0 20px rgba(0, 242, 254, 0.3);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.btn-primary:hover {
  box-shadow: 0 15px 35px -5px rgba(0, 242, 254, 0.6), 0 0 35px rgba(157, 78, 221, 0.5);
  transform: translateY(-3px) scale(1.02);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary span, .btn-primary svg {
  position: relative;
  z-index: 1;
}

.btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.2rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid var(--border-glass);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.25);
  transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   Timeline Section
   -------------------------------------------------------------------------- */
.timeline-container {
  position: relative;
  padding-left: 2.5rem;
}

.timeline-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 0%;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple));
  box-shadow: 0 0 12px var(--accent-cyan);
  border-radius: 3px;
}

.timeline-node {
  position: absolute;
  left: -8px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan);
  transition: all 0.3s ease;
}

.timeline-card {
  margin-bottom: 3.5rem;
  transform-origin: left center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Skills Grid & 3D Tilt Cards
   -------------------------------------------------------------------------- */
.skill-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.skill-card:hover {
  border-color: rgba(0, 242, 254, 0.4);
  background: rgba(0, 102, 255, 0.08);
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 242, 254, 0.2);
}

.skill-card .skill-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-cyan);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateZ(20px);
  transition: all 0.3s ease;
}

.skill-card:hover .skill-icon {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  box-shadow: 0 0 15px var(--accent-purple);
}

/* --------------------------------------------------------------------------
   Bento Grid Projects
   -------------------------------------------------------------------------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.bento-col-12 { grid-column: span 12; }
.bento-col-8  { grid-column: span 8; }
.bento-col-7  { grid-column: span 7; }
.bento-col-6  { grid-column: span 6; }
.bento-col-5  { grid-column: span 5; }
.bento-col-4  { grid-column: span 4; }

@media (max-width: 1024px) {
  .bento-col-8, .bento-col-7, .bento-col-6, .bento-col-5, .bento-col-4 {
    grid-column: span 12;
  }
}

.project-card {
  height: 100%;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.project-img-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  filter: brightness(0.65) contrast(1.1);
}

.project-card:hover .project-img {
  transform: scale(1.08);
  filter: brightness(0.85) contrast(1.15);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.2) 0%, rgba(5, 5, 7, 0.85) 60%, rgba(5, 5, 7, 0.98) 100%);
  z-index: 1;
}

.project-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* --------------------------------------------------------------------------
   Testimonials Horizontal Track
   -------------------------------------------------------------------------- */
.testimonials-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.testimonials-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: scrollInfinite 35s linear infinite;
}

.testimonials-track:hover {
  animation-play-state: paused;
}

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

.testimonial-card {
  width: 420px;
  flex-shrink: 0;
  padding: 2rem;
  border-radius: 24px;
}

/* --------------------------------------------------------------------------
   Contact Form Controls
   -------------------------------------------------------------------------- */
.input-glass {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.input-glass:hover {
  background: #f3f4f6;
  color: #000000;
  border-color: var(--accent-cyan);
}

.input-glass:hover::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.input-glass:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25);
}

.input-glass::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(20px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}
