* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.page {
  max-width: 1400px;
  margin: 0 auto;
}

.page__head {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.page__nav {
  text-align: left;
  margin-bottom: 20px;
}

.back-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page__title {
  font-size: 28px;
  color: #333;
  margin-bottom: 10px;
}

.page__subtitle {
  font-size: 20px;
  color: #666;
  margin-bottom: 10px;
}

.page__lead {
  font-size: 16px;
  color: #888;
}

.toolbar {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 15px 20px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.tool-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.loader {
  font-size: 14px;
  color: #667eea;
  font-weight: bold;
}

.projects-container.grid-view .projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 10px;
}

.projects-container.grid-view .thumb {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
}

.projects-container.grid-view .thumb:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.projects-container.grid-view .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.projects-container.list-view .projects-grid {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 0;
  margin: 0;
}

.projects-container.list-view .thumb {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
}

.projects-container.list-view .thumb:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.projects-container.list-view .thumb img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.projects-container.list-view .projects-grid *,
.projects-container.list-view .thumb * {
  max-width: 100%;
  box-sizing: border-box;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.lightbox.is-open {
  visibility: visible;
  opacity: 1;
}

.lightbox__toolbar {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 15px;
  z-index: 1001;
}

.lightbox__close,
.lightbox__ctrl {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox__close:hover,
.lightbox__ctrl:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.lightbox__nav {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  z-index: 1001;
}

.lightbox__nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 40px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox__nav-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.lightbox__counter {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 16px;
}

.lightbox__img {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 10px;
}

.page__footer {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  margin-top: 30px;
  text-align: center;
  color: #666;
}

.muted {
  font-size: 12px;
  color: #999;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .projects-container.grid-view .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }
  
  .projects-container.list-view .thumb img {
    aspect-ratio: 4 / 3;
  }
  
  .page__title {
    font-size: 20px;
  }
  
  .toolbar {
    flex-direction: column;
  }
  
  .lightbox__nav-btn {
    width: 40px;
    height: 40px;
    font-size: 25px;
  }
}