:root {
  /* Dark theme variables - these are now default */
  --primary-color: #333;
  --secondary-color: #666666; /* Dark grey color for buttons */
  --background-color: #121212;
  --text-color: #eee;
  --title-color: #666666;
  --spacing: 5px; /* Reduced spacing by 50% */
  --font-family: 'Helvetica Neue', sans-serif;
}

body.light-theme {
  /* Light theme variables - override dark theme defaults */
  --primary-color: #f0f0f0;
  --secondary-color: #666666;
  --background-color: #ffffff;
  --text-color: #333333;
  --title-color: #666666;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s, color 0.5s;
}

header {
  position: relative;
  background-color: var(--primary-color);
  color: var(--title-color);
  padding: var(--spacing) calc(var(--spacing) * 2);
  box-shadow: none;
  border-bottom: none;
  transition: background-color 0.5s, color 0.5s, border-color 0.5s;
}

nav {
  margin-top: var(--spacing);
  display: flex;
  gap: calc(var(--spacing) / 2);
}

button {
  padding: 8px 16px;
  background-color: transparent;
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
  font-size: 0.9rem;
}

button:hover {
  background-color: var(--secondary-color);
  color: var(--background-color);
}

main {
  padding: calc(var(--spacing) * 2);
}

.gallery {
  columns: 5 0;
  column-gap: calc(var(--spacing) * 1.5);
  line-height: 0;
  padding: 0;
}

.gallery-item {
  position: relative;
  display: inline-block;
  width: 100%;
  margin-bottom: calc(var(--spacing) * 1.5);
  line-height: 0;
  overflow: hidden;
  break-inside: avoid;
  background-color: transparent;
  transition: transform 0.3s, opacity 0.5s;
  opacity: 0;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.gallery-item.visible {
  opacity: 1;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s;
  cursor: pointer;
  border-radius: inherit;
}

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

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  padding: 20px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

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

.modal img {
  max-width: 95%;
  max-height: 95vh;
  object-fit: contain;
  cursor: default;
  animation: modalZoomIn 0.3s ease-out;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  border-radius: 5px;
}

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

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--primary-color);
  min-width: 100px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 5px;
  margin-top: 5px;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content a {
  color: #666666;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.dropdown-content a:hover {
  background-color: var(--secondary-color);
  color: var(--background-color);
}

.dropdown button {
  margin: 0;
}

@keyframes resizeAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.resizing {
  animation: resizeAnimation 0.3s ease-in-out;
}

/* Progress Bar Styles */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.progress-container.active {
  opacity: 1;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--secondary-color), #9c27b0, #e91e63);
  background-size: 200% 100%;
  animation: gradientShift 2s linear infinite;
  position: relative;
  transition: width 0.3s ease-out;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 2000px) {
  .gallery {
    columns: 4;
  }
}

@media (max-width: 1200px) {
  .gallery {
    columns: 3;
  }
}

@media (max-width: 768px) {
  .gallery {
    columns: 2;
  }
}

@media (max-width: 480px) {
  .gallery {
    columns: 1;
  }
}

#themeToggle {
  position: absolute;
  top: var(--spacing);
  right: calc(var(--spacing) * 2);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s;
}

#themeToggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--text-color);
  stroke-width: 2;
  transition: stroke 0.3s;
}

.moon-icon {
  display: none;
}

body.light-theme .moon-icon {
  display: none;
}

body.light-theme .sun-icon {
  display: inline-block;
}