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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #000000;
  color: #ffffff;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 85%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation */
.navbar {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 0;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: #27272a;
  border-radius: 8px;
  color: #a1a1aa;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: #3f3f46;
  color: #ffffff;
}

.nav-link.active {
  background-color: #3f3f46;
  color: #ffffff;
}

.nav-link i {
  font-size: 1.25rem;
}

/* Favorites Section */
.favorites-section {
  margin-bottom: 1rem;
}

.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.favorites-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

.favorites-toolbar {
  display: flex;
  gap: 0.5rem;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  background-color: #27272a;
  border: none;
  border-radius: 6px;
  color: #a1a1aa;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background-color: #3f3f46;
  color: #ffffff;
}

.toolbar-btn.danger:hover {
  background-color: #7f1d1d;
  color: #fecaca;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.favorites-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #71717a;
  font-size: 0.875rem;
}

.favorite-card {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
  transition: transform 0.2s ease;
}

.favorite-card:hover {
  transform: scale(1.02);
}

.favorite-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorite-card .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.favorite-card:hover .remove-btn {
  opacity: 1;
}

/* Grid Layouts */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Service Cards */
.services-section {
  padding: 1rem 0;
}

.services-row {
  margin-bottom: 1rem;
}

.services-row-3 {
  margin-bottom: 2rem;
}

.service-card {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  background-color: #000000;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #27272a;
}

.service-card:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.service-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
}

.service-card .card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
}

/* Favorite Button */
.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background-color: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #a1a1aa;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.favorite-btn:hover {
  background-color: rgba(0, 0, 0, 0.7);
  color: #ef4444;
}

.favorite-btn.active {
  color: #ef4444;
}

/* Return to Top Button */
.return-top-section {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}

.return-top-btn {
  padding: 0.75rem 2rem;
  background-color: #27272a;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.return-top-btn:hover {
  background-color: #3f3f46;
}

/* Footer Spacing */
.footer-spacing {
  height: 2rem;
}

/* Hidden file input */
.hidden-input {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .container {
    max-width: 95%;
  }

  .favorites-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .favorites-toolbar {
    flex-wrap: wrap;
  }
}

/* Drag and drop styles */
.dragging {
  opacity: 0.5;
}

.drag-over {
  border: 2px dashed #3f3f46;
}
