* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  color: #334155;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.1rem;
  color: #64748b;
}

.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.folder-select {
  padding: 0.5rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  background: white;
  font-size: 1rem;
  min-width: 200px;
  cursor: pointer;
}

.folder-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
  padding: 0.5rem 1rem;
  border: 2px solid #3b82f6;
  border-radius: 0.5rem;
  background: #3b82f6;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.btn-outline {
  background: white;
  color: #3b82f6;
}

.btn-outline:hover {
  background: #3b82f6;
  color: white;
}

.btn-outline.active {
  background: #3b82f6;
  color: white;
}

.image-counter {
  font-size: 0.9rem;
  color: #64748b;
}

/* Main Image Display */
.main-image-container {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.image-display {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.8;
}

.nav-btn:hover {
  opacity: 1;
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-btn-left {
  left: 1rem;
}

.nav-btn-right {
  right: 1rem;
}

.image-info {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.image-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.image-folder {
  font-size: 0.9rem;
  opacity: 0.8;
  text-transform: capitalize;
}

/* Thumbnail Grid */
.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.thumbnail {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.thumbnail:hover {
  border-color: #64748b;
}

.thumbnail.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.thumbnail.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(59, 130, 246, 0.2);
}

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

.navigation-hint {
  text-align: center;
  font-size: 0.9rem;
  color: #64748b;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #64748b;
}

.empty-state svg {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    justify-content: center;
  }

  .folder-select {
    min-width: auto;
    flex: 1;
  }

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

  .nav-btn {
    width: 2.5rem;
    height: 2.5rem;
  }

  .nav-btn-left {
    left: 0.5rem;
  }

  .nav-btn-right {
    right: 0.5rem;
  }
}
