/* ============================================
   OPTIONAL VISUAL ENHANCEMENTS
   Uncomment sections you want to use
   ============================================ */

/* Smooth Page Load Animation */
body {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Enhanced Focus Styles for Accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Smooth Transitions for Theme Changes */
body,
.page-bg,
.card,
.header-image img,
input,
textarea,
button {
  transition-property: background-color, color, border-color, opacity;
  transition-duration: 200ms;
  transition-timing-function: ease;
}

/* Selection Styling */
::selection {
  background: var(--accent);
  color: white;
}

::-moz-selection {
  background: var(--accent);
  color: white;
}

/* Scrollbar Styling (Webkit browsers) */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--surface-border);
  border-radius: 5px;
}

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

/* Dark theme scrollbar */
.theme-dark ::-webkit-scrollbar-track {
  background: var(--bg);
}

.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print Styles */
@media print {
  .theme-toggle,
  .expand-btn,
  .page-bg {
    display: none !important;
  }
  
  .card-description p {
    display: block !important;
    -webkit-line-clamp: unset !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Subtle Animation on Card Hover */
.card {
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  opacity: 0;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.03),
    rgba(37, 99, 235, 0.01)
  );
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

/* Enhanced Link Underline Effect */
.links a {
  position: relative;
  text-decoration: none;
}

.links a:hover {
  text-decoration: none;
}

/* Subtle Badge/Pill Style for Tech Tags */
.tech-list li {
  position: relative;
  overflow: hidden;
}

.tech-list li::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.tech-list li:hover::before {
  left: 100%;
}

/* Floating Animation for Profile Image (Optional - Subtle) */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Uncomment to enable floating effect
.header-image img {
  animation: float 6s ease-in-out infinite;
}
*/

/* Status Indicator Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.form-status.success,
.form-status.error {
  animation: pulse 1.5s ease-in-out;
}

/* Gradient Text Effect for Heading (Optional) */
/* Uncomment to use
h1 {
  background: linear-gradient(135deg, var(--fg), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
*/

/* Mobile Navigation Enhancement (if you add a menu) */
@media (max-width: 768px) {
  .links {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  
  .links a {
    font-size: 0.95rem;
  }
}

/* Improve code/monospace readability */
code,
pre {
  font-family: var(--font-mono);
  background: var(--surface);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Enhanced Button States */
button:active {
  transform: scale(0.98);
}

.contact-form button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Improved Image Loading State */
img {
  background: var(--surface);
}

img[src=""],
img:not([src]) {
  opacity: 0;
}

/* Dark Mode Specific Adjustments */
.theme-dark {
  /* Slightly increase contrast for better readability */
  --fg: #f0f0f0;
}

.theme-dark .card-links a:hover {
  color: var(--accent-hover);
}

/* Add subtle glow to accent elements in dark mode */
.theme-dark .expand-btn:hover {
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* Light Theme Specific Adjustments */
.theme-slate .header-image img {
  /* Slightly warmer shadow in light mode */
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.02);
}

/* Improve text readability in light mode */
.theme-slate {
  --fg: #1a1a1a;
}