/* 
 * PicsHub - Clean & Minimal Photo Gallery
 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #333;
  background-color: #fff;
  line-height: 1.6;
}

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

.skip-link {
  position: absolute;
  top: -45px;
  left: 6px;
  background: #007bff;
  color: white;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.3s;
  z-index: 1000;
}
.skip-link:focus {
  top: 6px;
}

.header {
  background: #fff;
  border-bottom: 1px solid #e1e5e9;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}
.header .container {
  max-width: none;
  padding: 0 24px;
}
.header__content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  position: relative;
}
.header__logo {
  font-size: 24px;
  font-weight: 600;
  color: #007bff;
  margin: 0;
  position: absolute;
  left: 24px;
}
.header__logo a {
  text-decoration: none;
  color: inherit;
}
.header__nav {
  display: flex;
  gap: 0;
}

.nav__button {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
  border-radius: 8px;
}
.nav__button:hover {
  background: #f8f9fa;
  color: #333;
}
.nav__button--active {
  color: #007bff;
  font-weight: 500;
}

.page {
  display: none;
  padding: 32px 0;
}
.page--active {
  display: block;
}

.category-header {
  margin-bottom: 24px;
}

.category-title {
  font-size: 32px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e1e5e9;
}

.filter-btn {
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 14px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}
.filter-btn--active {
  background: #343a40;
  color: white;
  border-color: #343a40;
}
.filter-btn--active:hover {
  background: #495057;
}
.filter-btn svg {
  width: 14px;
  height: 14px;
}

.gallery__grid {
  column-count: 4;
  column-gap: 10px;
}
@media (max-width: 1200px) {
  .gallery__grid {
    column-count: 3;
  }
}
@media (max-width: 768px) {
  .gallery__grid {
    column-count: 2;
    column-gap: 8px;
  }
}
@media (max-width: 480px) {
  .gallery__grid {
    column-count: 1;
  }
}

.gallery-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 6px;
  break-inside: avoid;
  cursor: pointer;
  transition: transform 0.2s;
}
.gallery-item:hover {
  transform: translateY(-2px);
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: all 0.3s;
}
.gallery-item:hover img {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}
.loading-state .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e1e5e9;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.error-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}
.error-state h3 {
  margin-bottom: 8px;
  color: #333;
}
.error-state p {
  margin-bottom: 20px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn--primary {
  background: #007bff;
  color: white;
}
.btn--primary:hover {
  background: #0056b3;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}
.lightbox__close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.2s;
  backdrop-filter: blur(10px);
}
.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}
.lightbox__content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 300px;
  min-height: 200px;
}
.lightbox__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 200px;
}
.lightbox__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: lightbox-spin 1s linear infinite;
}
.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: opacity 0.3s ease;
}
.lightbox__image.loaded {
  opacity: 1;
}

@keyframes lightbox-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@media (max-width: 768px) {
  .header__content {
    height: 56px;
  }
  .header__logo {
    font-size: 20px;
    left: 16px;
  }
  .header .container {
    padding: 0 16px;
  }
  .container {
    padding: 0 16px;
  }
  .nav__button {
    padding: 8px 16px;
    font-size: 15px;
  }
  .page {
    padding: 24px 0;
  }
  .category-title {
    font-size: 28px;
  }
  .category-filters {
    gap: 8px;
  }
  .filter-btn {
    font-size: 13px;
    padding: 6px 14px;
  }
  .lightbox__close {
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .lightbox__loading {
    width: 250px;
    height: 150px;
  }
  .lightbox__spinner {
    width: 32px;
    height: 32px;
    border-width: 2px;
  }
  .lightbox__image {
    border-radius: 4px;
  }
}
@media (max-width: 480px) {
  .header__logo {
    left: 12px;
    font-size: 18px;
  }
  .header__nav {
    display: flex;
    gap: 4px;
  }
  .nav__button {
    padding: 6px 12px;
    font-size: 14px;
  }
  .category-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 20px;
  }
  .category-filters::-webkit-scrollbar {
    display: none;
  }
  .filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
}
