/* ============================================
   CUSTOM STYLES - Portfolio Website
   ============================================ */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --transition-speed: 0.3s;
  --border-radius-sm: 0.75rem;
  --border-radius-md: 1rem;
  --border-radius-lg: 1.5rem;
}

/* ===== LOADING SCREEN ===== */
.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-block;
  border-top: 4px solid #3b82f6;
  border-right: 4px solid transparent;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

.loader::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border-bottom: 4px solid #8b5cf6;
  border-left: 4px solid transparent;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== NAVBAR ===== */
#navbar {
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.dark #navbar.scrolled {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Nav Links */
.nav-link {
  position: relative;
  color: #6b7280;
  transition: color var(--transition-speed);
}

.dark .nav-link {
  color: #9ca3af;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #3b82f6, #8b5cf6);
  transition: width var(--transition-speed);
  border-radius: 1px;
}

.nav-link:hover,
.nav-link.active {
  color: #3b82f6;
}

.dark .nav-link:hover,
.dark .nav-link.active {
  color: #60a5fa;
}

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

/* Mobile Nav */
#mobile-menu {
  transition: all 0.3s ease;
}

#mobile-menu.show {
  display: block;
}

.mobile-nav-link {
  color: #6b7280;
  transition: color var(--transition-speed);
}

.dark .mobile-nav-link {
  color: #9ca3af;
}

.mobile-nav-link:hover {
  color: #3b82f6;
}

.dark .mobile-nav-link:hover {
  color: #60a5fa;
}

/* ===== TYPING EFFECT ===== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.animate-blink {
  animation: blink 1s step-end infinite;
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ===== FLOATING ANIMATIONS FOR HERO ORBS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

@keyframes float-delayed {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-20px) scale(1.1); }
}

.animate-float {
  animation: float 8s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float-delayed 10s ease-in-out infinite;
}

/* ===== GLASSMORPHISM ===== */
.glassmorphism-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  transition: all 0.4s ease;
}

.dark .glassmorphism-card {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glassmorphism-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

.dark .glassmorphism-card:hover {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
  border-color: rgba(96, 165, 250, 0.15);
}

.glassmorphism {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.dark .glassmorphism {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glassmorphism-light {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===== PROGRESS BARS ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.dark .progress-bar {
  background: #1f2937;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.animated {
  /* Width set by JS via data-width attribute */
}

/* ===== SERVICE CARDS ===== */
.service-card:hover {
  transform: translateY(-8px);
}

/* ===== PROJECT CARDS ===== */
.project-card:hover {
  transform: translateY(-8px);
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* ===== FORM ELEMENTS ===== */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #f9fafb inset !important;
  -webkit-text-fill-color: #111827 !important;
}

.dark input:-webkit-autofill,
.dark textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #111827 inset !important;
  -webkit-text-fill-color: #f3f4f6 !important;
}

/* ===== FOCUS RING ===== */
input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* ===== SMOOTH TRANSITIONS ===== */
* {
  scroll-margin-top: 80px;
}

/* ===== RESPONSIVE FINE-TUNING ===== */
@media (max-width: 640px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (max-width: 768px) {
  .counter {
    font-size: 3rem;
  }
}

/* ===== SELECTION STYLING ===== */
::selection {
  background: #3b82f6;
  color: white;
}

.dark ::selection {
  background: #60a5fa;
  color: #0f172a;
}

/* ===== BACK TO TOP BUTTON ===== */
#back-to-top.show {
  opacity: 1;
  visibility: visible;
}
