/* Base styles and typography */
:root {
  --font-sans: 'Inter var', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
  
  /* Light theme colors */
  --color-bg: #ffffff;
  --color-text: #1a202c;
  --color-text-muted: #4a5568;
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-secondary: #10b981;
  --color-accent: #8b5cf6;
  --color-border: #e2e8f0;
  --color-card-bg: #f8fafc;
  
  /* Dark theme colors */
  --color-bg-dark: #1a202c;
  --color-text-dark: #f7fafc;
  --color-text-muted-dark: #a0aec0;
  --color-primary-dark: #60a5fa;
  --color-primary-hover-dark: #3b82f6;
  --color-secondary-dark: #34d399;
  --color-accent-dark: #a78bfa;
  --color-border-dark: #2d3748;
  --color-card-bg-dark: #2d3748;
}

/* Base styles */
html {
  font-size: 16px;
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  font-family: var(--font-sans);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: color 0.3s ease, background-color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-primary-hover);
}

/* Layout and Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header */
.site-header {
  background-color: var(--color-bg);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text-muted);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--color-primary);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.theme-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-text-muted);
}

/* Hero section */
.hero {
  text-align: center;
  padding: 4rem 0;
  background-color: var(--color-card-bg);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

/* Buttons */
.cta-button,
.github-link {
  display: inline-block;
  background-color: var(--color-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.cta-button:hover,
.github-link:hover {
  background-color: var(--color-primary-hover);
  color: white;
}

/* Projects section */
.projects {
  padding: 4rem 0;
}

.search-sort {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

#search-projects {
  width: 100%;
  max-width: 300px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 1rem;
}

.sort-buttons {
  display: flex;
  gap: 1rem;
}

.sort-buttons button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}

.sort-buttons button:hover {
  color: var(--color-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--color-card-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-card h3 {
  font-size: 1.25rem;
  margin: 1rem;
}

.project-card p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 1rem 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 1rem 1rem;
}

.tag {
  font-size: 0.75rem;
  background-color: var(--color-accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}

.project-links {
  display: flex;
  justify-content: space-between;
  margin: 1rem;
}

.project-links a {
  font-size: 0.875rem;
  font-weight: 600;
}

.project-stars {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 1rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.project-stars svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* Loading spinner */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Load more button */
.load-more {
  text-align: center;
  margin-top: 2rem;
}

#load-more-button {
  background-color: var(--color-secondary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#load-more-button:hover {
  background-color: var(--color-secondary-dark);
}

/* About section */
.about {
  background-color: var(--color-card-bg);
  padding: 4rem 0;
  text-align: center;
}

.about p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

/* Footer */
.site-footer {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

/* Offline notification */
.offline-notification {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  z-index: 1000;
  display: none;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--color-primary);
  color: white;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.back-to-top:hover {
  background-color: var(--color-primary-hover);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Dark mode styles */
.dark-theme {
  --color-bg: var(--color-bg-dark);
  --color-text: var(--color-text-dark);
  --color-text-muted: var(--color-text-muted-dark);
  --color-primary: var(--color-primary-dark);
  --color-primary-hover: var(--color-primary-hover-dark);
  --color-secondary: var(--color-secondary-dark);
  --color-accent: var(--color-accent-dark);
  --color-border: var(--color-border-dark);
  --color-card-bg: var(--color-card-bg-dark);
}

/* Responsive styles */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .search-sort {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  #search-projects {
    max-width: none;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .site-footer .container {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

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

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }

.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

.transition { transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform; }
.transition-colors { transition-property: background-color, border-color, color, fill, stroke; }
.duration-300 { transition-duration: 300ms; }

.hover\:bg-gray-100:hover { background-color: #f7fafc; }
.hover\:text-primary:hover { color: var(--color-primary); }

/* Print styles */
@media print {
  .no-print { display: none !important; }
  body { font-size: 12pt; }
  a[href]:after { content: " (" attr(href) ")"; }
}

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

/* Focus styles */
:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

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

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

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

/* End of styles.css */

