:root {
  color-scheme: dark;

  --bg-primary: #1a1a2e;
  --bg-secondary: rgba(25, 25, 45, 0.8);
  --bg-card: rgba(35, 35, 60, 0.6);
  --text-primary: #f5f5f5;
  --text-secondary: #ffeb3b;
  --text-muted: #fdd835;
  --accent-primary: #ffeb3b;
  --accent-secondary: #ffc107;
  --accent-orange: #ff9800;
  --accent-gold: #ffd700;
  --border-color: rgba(255, 235, 59, 0.4);
  --shadow-color: rgba(255, 235, 59, 0.5);
  --navbar-bg: rgba(26, 26, 46, 0.95);
}

body.light-mode {
  --bg-primary: #fffde7;
  --bg-secondary: rgba(255, 255, 255, 0.9);
  --bg-card: rgba(255, 253, 231, 0.85);
  --text-primary: #1a1a1a;
  --text-secondary: #f57f17;
  --text-muted: #f9a825;
  --accent-primary: #fbc02d;
  --accent-secondary: #f57f17;
  --accent-orange: #ef6c00;
  --accent-gold: #f9a825;
  --border-color: rgba(251, 192, 45, 0.4);
  --shadow-color: rgba(251, 192, 45, 0.3);
  --navbar-bg: rgba(255, 255, 255, 0.95);
}

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

body {
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition:
    background 0.4s,
    color 0.4s;
}

#canvas3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.4;
}

body.light-mode #canvas3d {
  opacity: 0.2;
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  z-index: 1000;
  padding: 20px 40px;
  box-shadow: 0 2px 20px var(--shadow-color);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.4s;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-orange),
    var(--accent-gold)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  z-index: 1001;
  letter-spacing: 1px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--accent-primary);
  transition: all 0.3s;
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 35px;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.3s;
  border-radius: 6px;
  position: relative;
  display: block;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link:hover {
  color: var(--accent-primary);
  background: rgba(255, 235, 59, 0.1);
}

.dropdown {
  position: relative;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--navbar-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 0;
  min-width: max-content;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px var(--shadow-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  list-style: none;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: 12px 24px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.dropdown-link:hover {
  color: var(--accent-primary);
  background: rgba(255, 235, 59, 0.15);
  padding-left: 30px;
}

.hero {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 150px 20px 80px;
  z-index: 10;
}

.hero h1 {
  font-size: 5rem;
  font-weight: 900;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-orange),
    var(--accent-gold)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  letter-spacing: 2px;
  animation: fadeInDown 1s ease;
}

.hero p {
  font-size: 1.4rem;
  color: var(--text-secondary);
  animation: fadeInUp 1s ease 0.2s both;
}

.gallery-section {
  position: relative;
  padding: 80px 5% 120px;
  z-index: 10;
}

.section-header h2 {
  text-align: center;
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-orange)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
}

.section-header p {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 50px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.view-btn,
.tab-btn {
  padding: 12px 30px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
  position: relative;
  z-index: 100;
}

.view-btn:hover,
.tab-btn:hover {
  background: rgba(255, 235, 59, 0.2);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px var(--shadow-color);
}

.view-btn.active,
.tab-btn.active {
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  border-color: transparent;
  color: #1a1a1a;
  box-shadow: 0 8px 25px var(--shadow-color);
}

.gallery-container {
  display: none;
}

.gallery-container.active {
  display: block;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.gallery-masonry {
  columns: 3;
  column-gap: 30px;
}

.gallery-masonry .gallery-item {
  break-inside: avoid;
  margin-bottom: 30px;
}

.gallery-carousel {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-item {
  min-width: 100%;
  flex-shrink: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  color: #1a1a1a;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
}

.carousel-btn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 10px 30px var(--shadow-color);
}

.carousel-prev {
  left: 20px;
}
.carousel-next {
  right: 20px;
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.indicator {
  width: 12px;
  height: 12px;
  background: var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
}

.indicator.active {
  background: var(--accent-primary);
  transform: scale(1.3);
}

.gallery-slideshow {
  max-width: 1200px;
  margin: 0 auto;
}

.slideshow-main {
  position: relative;
  margin-bottom: 30px;
}

.slideshow-item {
  display: none;
}

.slideshow-item.active {
  display: block;
}

.slideshow-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.thumbnail {
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s;
  opacity: 0.6;
}

.thumbnail.active {
  border-color: var(--accent-primary);
  opacity: 1;
  transform: scale(1.05);
}

.thumbnail:hover {
  opacity: 1;
  transform: scale(1.05);
}

.gallery-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  min-height: 250px;
}

.gallery-item:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 60px var(--shadow-color);
}

.gallery-item::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 235, 59, 0.3) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}

.gallery-item:hover img {
  transform: scale(1.15);
}

.item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  transform: translateY(100%);
  transition: transform 0.4s;
}

.gallery-item:hover .item-overlay {
  transform: translateY(0);
}

.item-overlay h3 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.item-overlay p {
  color: var(--accent-gold);
  font-size: 0.95rem;
}

.zoom-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 50px;
  height: 50px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s;
}

.gallery-item:hover .zoom-icon {
  opacity: 1;
  transform: scale(1);
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  z-index: 3000;
  touch-action: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 3001;
}

.lb-btn {
  width: 50px;
  height: 50px;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  color: #1a1a1a;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 20px var(--shadow-color);
}

.lb-close {
  background: #ff5252;
  font-size: 2rem;
  width: 60px;
  height: 60px;
}

.lb-close:hover {
  transform: rotate(90deg) scale(1.1);
}

.lightbox-content {
  max-width: 90%;
  max-height: 90vh;
  text-align: center;
  touch-action: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 15px;
  box-shadow: 0 30px 100px var(--shadow-color);
  transition: transform 0.2s;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.lightbox img.zoom-active {
  cursor: grab;
}

.lightbox img.zoom-active:active {
  cursor: grabbing;
}

.lightbox-info {
  margin-top: 25px;
  color: #fff;
}

.lightbox-info h3 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: var(--accent-primary);
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 70px;
  height: 70px;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  color: #1a1a1a;
  font-size: 2.5rem;
  cursor: pointer;
  transition: all 0.3s;
}

.lb-nav:hover {
  transform: translateY(-50%) scale(1.1);
}

.lb-prev {
  left: 30px;
}
.lb-next {
  right: 30px;
}

footer {
  padding: 60px 5% 30px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  z-index: 10;
  position: relative;
}

.footer-logo {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-orange)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

footer p {
  color: var(--text-muted);
  margin: 10px 0;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .gallery-masonry {
    columns: 1;
  }

  .slideshow-thumbnails {
    grid-template-columns: repeat(3, 1fr);
  }

  .controls {
    flex-direction: column;
  }

  .view-btn,
  .tab-btn {
    width: 100%;
  }

  .lb-nav {
    width: 50px;
    height: 50px;
    font-size: 2rem;
  }

  .carousel-btn {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
  }

  .lightbox img {
    cursor: default;
  }

  .lightbox-controls {
    top: 10px;
    right: 10px;
  }

  .lb-btn {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .lb-close {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}
