/* Import Poppins Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-primary: 'Poppins', sans-serif;
  --color-primary: 99, 102, 241; /* Indigo */
  --color-secondary: 168, 85, 247; /* Purple */
  --color-accent: 236, 72, 153; /* Pink */
  
  /* Smooth theme transitions */
  --transition-speed: 0.4s;
  --transition-cubic: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-primary);
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  transition: background-color var(--transition-speed) var(--transition-cubic), 
              color var(--transition-speed) var(--transition-cubic);
}

/* --- Premium Loading Preloader --- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #0f172a; /* Dark theme default start */
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s var(--transition-cubic), visibility 0.6s var(--transition-cubic);
}
#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-secondary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  position: relative;
  letter-spacing: 2px;
}

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

.loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgb(var(--color-primary)), rgb(var(--color-accent)));
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

.loader-text {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-top: 0.75rem;
  font-weight: 500;
  letter-spacing: 1px;
}

/* --- Custom Custom Scrollbars --- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
.dark ::-webkit-scrollbar-track {
  background: #0b0f19;
}
.light ::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--color-primary), 0.3);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-primary), 0.7);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* --- Scroll Progress Bar --- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, rgb(var(--color-primary)), rgb(var(--color-secondary)), rgb(var(--color-accent)));
  width: 0%;
  z-index: 100000;
  transition: width 0.05s linear;
}

/* --- Custom Interactive Cursor --- */
.custom-cursor-dot,
.custom-cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.3s ease, transform 0.15s ease-out;
  opacity: 0;
}

.custom-cursor-dot {
  width: 8px;
  height: 8px;
  background-color: rgb(var(--color-primary));
}

.custom-cursor-outline {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(var(--color-primary), 0.4);
}

/* Hidden on touch devices */
@media (pointer: coarse) {
  .custom-cursor-dot,
  .custom-cursor-outline {
    display: none !important;
  }
}

/* --- Glassmorphism Helpers --- */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.light .glass {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.glass-navbar {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.light .glass-navbar {
  background: rgba(248, 250, 252, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- Premium Background Gradients & Mesh --- */
.bg-mesh-dark {
  background-color: #0f172a;
  background-image: 
    radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 10%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
}

.bg-mesh-light {
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 10%, rgba(168, 85, 247, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(236, 72, 153, 0.06) 0px, transparent 50%);
}

/* --- Floating Keyframe Shapes --- */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
  100% { transform: translateY(0px) rotate(360deg); }
}

@keyframes float-reverse {
  0% { transform: translateY(0px) rotate(360deg); }
  50% { transform: translateY(20px) rotate(180deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.animate-float-shape-1 {
  animation: float 25s infinite linear;
}

.animate-float-shape-2 {
  animation: float-reverse 30s infinite linear;
}

/* --- Button Ripple Effect --- */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.ripple-span {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  background-color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.light .ripple-span {
  background-color: rgba(0, 0, 0, 0.15);
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* --- Typing Cursor --- */
.typing-cursor {
  font-weight: 400;
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from, to { color: transparent }
  50% { color: rgb(var(--color-primary)); }
}

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.reveal-left {
  transform: translateX(-50px);
}

.reveal.reveal-right {
  transform: translateX(50px);
}

.reveal.reveal-scale {
  transform: scale(0.9);
}

.reveal.active {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* --- Timeline Layout --- */
.timeline-item::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgb(var(--color-primary));
  border: 4px solid #0f172a;
  top: 24px;
  z-index: 1;
  transition: all 0.3s ease;
}

.light .timeline-item::after {
  border-color: #f8fafc;
}

@media (min-width: 768px) {
  .timeline-item-left::after {
    right: -8px;
  }
  .timeline-item-right::after {
    left: -8px;
  }
}

@media (max-width: 767px) {
  .timeline-item::after {
    left: 12px;
  }
}

.timeline-item:hover::after {
  background-color: rgb(var(--color-accent));
  transform: scale(1.3);
}

/* --- Project Cards Filter Transition --- */
.project-card {
  transition: transform 0.4s var(--transition-cubic), opacity 0.4s ease, filter 0.4s ease;
}

.project-card.hide {
  transform: scale(0.85);
  opacity: 0;
  visibility: hidden;
  position: absolute;
  pointer-events: none;
}

/* --- Testimonials Slider Track --- */
.testimonial-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
}

.testimonial-slide {
  flex-shrink: 0;
  width: 100%;
}

/* --- Custom Form Focus States --- */
.form-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.light .form-input {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.form-input:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgb(var(--color-primary));
  box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.15);
}

.light .form-input:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgb(var(--color-primary));
  box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.1);
}

/* --- About Card Tabs --- */
.about-tab {
  position: relative;
}

.about-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background: rgb(var(--color-primary));
  transition: width 0.3s ease;
}

.about-tab.active-tab::after {
  width: 100%;
}
