/* Square UI Inspired Custom Styles */

:root {
  /* Color Palette - Modern and Clean */
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-secondary: #8b5cf6;
  --color-accent: #ec4899;

  --color-bg-light: #ffffff;
  --color-bg-gray: #f9fafb;
  --color-bg-dark: #1f2937;
  --color-bg-darker: #111827;

  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;

  --color-border: #e5e7eb;
  --color-border-dark: #374151;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Spacing */
  --spacing-unit: 0.25rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
.dark {
  --color-bg-light: #1f2937;
  --color-bg-gray: #111827;
  --color-bg-dark: #030712;
  --color-bg-darker: #000000;

  --color-text-primary: #f9fafb;
  --color-text-secondary: #d1d5db;
  --color-text-muted: #9ca3af;

  --color-border: #374151;
  --color-border-dark: #4b5563;
}

/* Custom Component Styles */

/* Repository Card Hover Effect */
.repo-card {
  transition: all var(--transition-base);
  border: 1px solid var(--color-border);
}

.repo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.dark .repo-card {
  border-color: var(--color-border-dark);
  background-color: var(--color-bg-light);
}

.dark .repo-card:hover {
  border-color: var(--color-primary);
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.badge-primary {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
}

.badge-topic {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--color-secondary);
  cursor: pointer;
}

.badge-topic:hover {
  background-color: rgba(139, 92, 246, 0.2);
}

.badge-language {
  background-color: rgba(236, 72, 153, 0.1);
  color: var(--color-accent);
}

/* Custom Tag Input */
.tag-input {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-gray);
  transition: all var(--transition-fast);
}

.tag-input:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-gray) 25%,
    #e5e7eb 50%,
    var(--color-bg-gray) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.dark .skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-light) 25%,
    var(--color-border-dark) 50%,
    var(--color-bg-light) 75%
  );
  background-size: 200% 100%;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-sm);
}

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

/* Filter Chip */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  background-color: var(--color-primary-dark);
}

.filter-chip button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.filter-chip button:hover {
  opacity: 1;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.5rem;
  background-color: var(--color-bg-darker);
  color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: toast-slide-in var(--transition-base);
  z-index: 1000;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  background-color: #10b981;
}

.toast-error {
  background-color: #ef4444;
}

.toast-warning {
  background-color: #f59e0b;
}

/* Focus Styles for Accessibility */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Responsive Grid Utilities */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .repo-grid {
    gap: 2rem;
  }
}
