/* Светлая и тёмная тема */
:root {
  --bg-primary: 249 250 251;
  --bg-secondary: 255 255 255;
  --bg-tertiary: 243 244 246;
 --text-primary: 15 23 42;
  --text-secondary: 71 85 105;
  --text-muted: 100 116 139;
  --border-color: 226 232 240;
}

.dark {
  --bg-primary: 2 6 23;
  --bg-secondary: 15 23 42;
  --bg-tertiary: 30 41 59;
  --text-primary: 248 250 252;
  --text-secondary: 203 213 225;
  --text-muted: 148 163 184;
 --border-color: 51 65 85;
}

.grain {
  position: fixed;
  pointer-events: none;
 inset: 0;
  opacity: 0.02;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='noStitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
  z-index: 50;
}

.dark .grain {
  opacity: 0.05;
}

.floating-dot {
  animation: float 9s ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translate3d(0,0,0); }
 to { transform: translate3d(0,-18px,0); }
}

.soft-scrollbar::-webkit-scrollbar { height: 6px; width: 6px; }
.soft-scrollbar::-webkit-scrollbar-track { background: transparent; }
.soft-scrollbar::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.4); border-radius: 999px; }
.dark .soft-scrollbar::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.6); }

.dark .light-hidden { display: inline !important; }
.dark .dark-hidden { display: none !important; }

body {
  background-color: rgb(var(--bg-primary));
  color: rgb(var(--text-primary));
}

.card-base {
  background-color: rgb(var(--bg-secondary));
  border-color: rgb(var(--border-color));
}

.input-base {
  background-color: rgb(var(--bg-tertiary));
  border-color: rgb(var(--border-color));
  color: rgb(var(--text-primary));
}

.input-base::placeholder {
  color: rgb(var(--text-muted));
}

/* Gallery Modal Styles */
#gallery-modal {
  display: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.4);
}

#gallery-modal.active {
  display: flex;
}

/* Hall Card Styles */
.hall-card {
  transition: all 0.2s ease;
}

.hall-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Gallery Images */
.gallery-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.5rem;
  transition: transform 0.3s ease;
}

.gallery-image:hover {
  transform: scale(1.05);
}

/* Gallery Item */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  aspect-ratio: 1 / 1;
}

/* Gallery Modal */
#gallery-modal {
  z-index: 60; /* Higher than other elements */
}

/* Glassmorphism effect for modal content */
#gallery-modal .bg-white,
#gallery-modal .dark\\:bg-gray-800 {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark #gallery-modal .dark\\:bg-gray-800 {
  background: rgba(31, 41, 55, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hall Info Section */
.hall-info {
  transition: all 0.2s ease;
}

.hall-info p {
  line-height: 1.5;
}

.hall-info .font-medium {
  font-weight: 500;
}

/* VK Button */
.hall-info a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hall-info a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Gallery Layout Fix */
#gallery-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Photos Grid */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .photos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .photos-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Gallery Modal Content Adjustments */
#gallery-modal .bg-white,
#gallery-modal .dark\:bg-gray-800 {
  max-height: 90vh;
  overflow-y: auto;
}

/* Override HTML grid classes for gallery content */
#gallery-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
}

/* Full-size Image Modal */
#image-modal {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(0, 0, 0, 0.7);
}

#image-modal.active {
  display: flex;
  opacity: 1;
}

#image-modal-content {
  transition: transform 0.3s ease;
}

#close-image-modal,
#prev-image,
#next-image {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#prev-image:hover,
#next-image:hover {
  transform: scale(1.1);
}