/* Global Styles for JSDigital Agency */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Utility Classes */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

/* Custom Scrollbar Styles (for browsers that support it) */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: #262626;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #404040;
}

/* Light mode scrollbar */
html:not(.dark) ::-webkit-scrollbar-track {
  background: #f3f4f6;
}

html:not(.dark) ::-webkit-scrollbar-thumb {
  background: #d1d5db;
}

html:not(.dark) ::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Selection Styles */
::selection {
  background-color: #0ea5e9;
  color: white;
}

::-moz-selection {
  background-color: #0ea5e9;
  color: white;
}

/* Focus Styles for Accessibility */
*:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

/* Smooth Transitions */
a, button {
  transition: all 0.2s ease-in-out;
}

/* Image Loading */
img {
  max-width: 100%;
  height: auto;
}

/* Prevent layout shift */
img[loading="lazy"] {
  min-height: 200px;
}

/* Code Blocks */
code {
  font-family: 'Monaco', 'Courier New', monospace;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.dark code {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
}

/* 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;
  }
}
