/* Custom Styles for Portfolio */

/* Dark Modern Color Variables */
:root {
  --dark-primary: #0f172a;
  --dark-secondary: #1e293b;
  --dark-accent: #334155;
  --accent-blue: #3b82f6;
  --text-light: #f8fafc;
  --bg-dark: #0f172a;
  --bg-darker: #0a0e27;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
}

/* Dark Mode Styles */
html.dark,
html.dark body {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

html.dark section {
  background-color: inherit;
  color: inherit;
}

html.dark {
  color-scheme: dark;
}

/* Light Mode Styles (fallback) */
body {
  background-color: #0f172a;
  color: #f8fafc;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Header & Navigation Styles */
html.dark #header {
  background-color: rgba(15, 23, 42, 0.9);
}

/* Navigation Scrolled State */
#header.scrolled {
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

html.dark #header.scrolled {
  background-color: rgba(15, 23, 42, 0.98);
}

/* Active Navigation Link */
.nav-link.active {
  color: #60a5fa;
  font-weight: 600;
}

/* Fade In Animation */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll to Top Button Visible State */
#scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Skill Card Hover Effect */
.skill-card {
  position: relative;
  overflow: hidden;
  background: var(--dark-accent);
  border: 1px solid rgba(148, 163, 184, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
  transition: left 0.5s;
}

.skill-card:hover::before {
  left: 100%;
}

/* Project Card Hover Effect */
.project-card {
  position: relative;
  overflow: hidden;
  background: var(--dark-accent);
  border: 1px solid rgba(148, 163, 184, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.02));
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover::after {
  opacity: 1;
}

/* Mobile Menu Animation */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

#mobile-menu.active {
  max-height: 500px;
  display: block;
}

/* Custom Scrollbar - Dark Theme */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 6px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Ensure dark mode scrollbar */
html.dark::-webkit-scrollbar-track {
  background: #0f172a;
}

html.dark::-webkit-scrollbar-thumb {
  background: #475569;
}

html.dark::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Hero Section Gradient Animation - More Subtle */
#hero {
  background-size: 200% 200%;
  animation: subtleGradient 20s ease infinite;
}

@keyframes subtleGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Keep original gradientShift for compatibility */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Responsive Typography */
@media (max-width: 640px) {
  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.5rem;
  }
}

/* Print Styles */
@media print {
  header,
  #scroll-top,
  #theme-toggle,
  #mobile-menu-button {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  section {
    page-break-inside: avoid;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.dark a:focus,
.dark button:focus {
  outline-color: #60a5fa;
}

/* Selection Color */
::selection {
  background-color: #3b82f6;
  color: white;
}

.dark ::selection {
  background-color: #60a5fa;
  color: #1f2937;
}

/* Loading Animation (optional, for future use) */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card Shine Effect (optional) */
@keyframes shine {
  0% {
    background-position: -200px;
  }
  40%, 100% {
    background-position: 200px;
  }
}

.shine {
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: shine 3s ease-in-out infinite;
}
