@layer utilities {
  .bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
  }
  .bg-gradient-to-b {
    background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
  }
  .from-indigo-500 { --tw-gradient-from: #6366f1; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(99, 102, 241, 0)); }
  .via-violet-500 { --tw-gradient-to: rgba(139, 92, 246, 0); --tw-gradient-stops: var(--tw-gradient-from), #8b5cf6, var(--tw-gradient-to); }
  .to-fuchsia-500 { --tw-gradient-to: #d946ef; }
  .from-sky-500 { --tw-gradient-from: #0ea5e9; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(14, 165, 233, 0)); }
  .via-cyan-500 { --tw-gradient-to: rgba(6, 182, 212, 0); --tw-gradient-stops: var(--tw-gradient-from), #06b6d4, var(--tw-gradient-to); }
  .to-emerald-500 { --tw-gradient-to: #10b981; }
  .from-amber-500 { --tw-gradient-from: #f59e0b; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(245, 158, 11, 0)); }
  .via-orange-500 { --tw-gradient-to: rgba(249, 115, 22, 0); --tw-gradient-stops: var(--tw-gradient-from), #f97316, var(--tw-gradient-to); }
  .to-rose-500 { --tw-gradient-to: #f43f5e; }
  .from-green-500 { --tw-gradient-from: #22c55e; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(34, 197, 94, 0)); }
  .via-lime-500 { --tw-gradient-to: rgba(132, 204, 22, 0); --tw-gradient-stops: var(--tw-gradient-from), #84cc16, var(--tw-gradient-to); }
  .to-yellow-400 { --tw-gradient-to: #facc15; }

  .fade-in {
    animation: fadeIn 0.3s ease-in-out;
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .slide-in {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes slideIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
  }
  .modal-enter {
    animation: modalEnter 0.3s ease-out;
  }
  @keyframes modalEnter {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --primary: 222.2 47.4% 11.2%;
  --border: 214.3 31.8% 91.4%;
}

[data-theme="dark"] {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --primary: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-muted { background-color: hsl(var(--muted)); }
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.border { border-color: hsl(var(--border)); }
.bg-primary { background-color: hsl(var(--primary)); }

.select-wrapper {
  position: relative;
}

.select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 50;
  display: none;
  max-height: 200px;
  overflow-y: auto;
}

.select-dropdown.open {
  display: block;
}

.select-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.select-item:hover {
  background-color: hsl(var(--muted));
}

.project-card {
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-2px);
}

/* Анимация появления карточек убрана для быстрого переключения */
.project-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-overlay {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
}

.modal-content {
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.5));
}

/* Стили для изображений с размытым фоном */
.image-with-blur-bg {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.image-with-blur-bg::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(20px);
  z-index: 1;
}

.image-with-blur-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.image-with-blur-bg img {
  position: relative;
  z-index: 3;
  object-fit: contain;
  width: 100%;
  height: 100%;
}

/* Fullscreen Gallery Styles */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
}

.gallery-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 110;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.gallery-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 110;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

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

.gallery-nav:disabled:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%);
}

.gallery-nav-prev {
  left: 20px;
}

.gallery-nav-next {
  right: 20px;
}

.gallery-content {
  position: absolute;
  inset: 80px 80px;
  z-index: 105;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-image-wrapper {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.gallery-image {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  display: block;
}

/* Gallery animations */
@keyframes galleryFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes galleryImageSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#gallery-modal:not(.hidden) {
  animation: galleryFadeIn 0.3s ease-out;
}

#gallery-modal:not(.hidden) .gallery-image-wrapper {
  animation: galleryImageSlideIn 0.3s ease-out;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .gallery-content {
    inset: 60px 20px;
  }
  
  .gallery-nav {
    padding: 12px;
  }
  
  .gallery-nav-prev {
    left: 10px;
  }
  
  .gallery-nav-next {
    right: 10px;
  }
  
  .gallery-close {
    top: 10px;
    right: 10px;
  }
  
  .gallery-counter {
    top: 10px;
  }
  
  .gallery-image {
    max-height: calc(100vh - 120px);
  }
}

/* Курсор для кликабельных скриншотов */
.screenshot-clickable {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.screenshot-clickable:hover {
  transform: scale(1.02);
}

/* Стильный переключатель режимов просмотра */
.view-mode-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* padding: 6px; */
  /* background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.08) 100%); */
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50px;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */
  backdrop-filter: blur(10px);
}

.view-mode-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  color: hsl(var(--foreground));
  overflow: hidden;
  z-index: 1;
}

.view-mode-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #000000 0%, #333333 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  border-radius: 50px;
}

.view-mode-btn:hover::before {
  opacity: 0.1;
}

.view-mode-btn.active {
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.view-mode-btn.active::before {
  opacity: 1;
}

.view-mode-btn:not(.active):hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.02);
}

.view-mode-btn svg {
  transition: transform 0.3s ease;
}

.view-mode-btn.active svg {
  transform: rotate(5deg) scale(1.1);
}

.view-mode-btn:active {
  transform: scale(0.98);
}

/* Анимация при загрузке */
@keyframes switcherPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  }
}

.view-mode-switcher {
  animation: switcherPulse 2s ease-in-out infinite;
}

