/* Import modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&family=Poppins:wght@400;500;600&display=swap');

/* CSS Reset and Base Styles */
:root {
  /* Color variables */
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #06d6a0;
  --background: #f8f9fa;
  --surface: #ffffff;
  --text: #333333;
  --text-secondary: #6c757d;
  --error: #ef476f;
  --success: #06d6a0;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
}

body.lightbox-open {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

/* Header Styles - Complete Fix */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: padding 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

header.scrolled {
  justify-content: flex-start;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.logo {
  display: block;
  max-width: 90%;
  width: 200px;
  height: auto;
  padding: 10px 0;
  transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

header.scrolled .logo {
  width: 125px;
  padding: 5px 0;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  header {
    padding: 1.5rem 0.8rem;
  }
  
  header.scrolled {
    padding: 0.6rem 0.8rem;
  }
  
  .logo {
    width: 180px;
  }
  
  header.scrolled .logo {
    width: 75px;
  }
}

/* Search and Controls - Hidden for now 
.controls {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background-color: var(--surface);
  margin: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.sort-options {
  display: flex;
  gap: 0.5rem;
}

.sort-button {
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-button:hover {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.sort-button.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}
*/

/* Loading Indicator */
#loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.skeleton-loader {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.skeleton-card {
  background-color: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  height: 280px;
}

.skeleton-image {
  height: 200px;
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
}

.skeleton-content {
  padding: 1rem;
}

.skeleton-title {
  height: 20px;
  width: 80%;
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.skeleton-text {
  height: 15px;
  width: 60%;
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
  border-radius: 4px;
}

@keyframes shine {
  to {
    background-position-x: -200%;
  }
}

/* Gallery Grid */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-card {
  background-color: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px var(--shadow);
}

.gallery-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-card:hover img {
  transform: scale(1.05);
}

/* Hidden elements for now 
.card-content {
  padding: 1rem;
}

.card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.vote-stats {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
*/

/* Lightbox */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#lightbox.visible {
  visibility: visible;
  opacity: 1;
}

.lightbox-container {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#close {
  position: absolute;
  top: -40px;
  right: -40px;
  font-size: 2rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

#close:hover {
  color: var(--secondary);
}

/* Navigation Arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border: none;
}

.nav-arrow:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

#prev-image {
  left: -80px;
}

#next-image {
  right: -80px;
}

/* Vote Container */
#vote-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.5rem;
}

#thumbs-up {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 0.6rem 1.2rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

#thumbs-up:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

#thumbs-up:active {
  transform: translateY(0);
}

#thumbs-up:disabled {
  background-color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.thumb-icon {
  font-size: 1.2rem;
}

#vote-count {
  font-weight: 600;
}

#vote-message {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  height: 20px;
  text-align: center;
}

#vote-message.success {
  color: var(--success);
}

#vote-message.error {
  color: var(--error);
}

/* Share buttons - Hidden for now
.share-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.share-btn:hover {
  transform: scale(1.1);
}

.share-twitter {
  background-color: #1DA1F2;
}

.share-facebook {
  background-color: #4267B2;
}

.share-link {
  background-color: var(--secondary);
}
*/

/* Error Toast */
#error-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--error);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 1000;
  transition: opacity 0.3s, transform 0.3s;
}

#error-toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  .nav-arrow {
    width: 40px;
    height: 40px;
  }

  #prev-image {
    left: -60px;
  }

  #next-image {
    right: -60px;
  }
}

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .nav-arrow {
    top: auto;
    bottom: -60px;
    transform: none;
  }

  #prev-image {
    left: 30%;
  }

  #next-image {
    right: 30%;
  }
  
  #vote-container {
    margin-top: 3rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0.8rem;
  }
  
  .logo {
    height: 32px;
  }
  
  header h1 {
    font-size: 1.2rem;
  }
  
  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8rem;
    padding: 0.8rem;
  }
  
  .gallery-card img {
    height: 140px;
  }
  
  .card-content {
    padding: 0.8rem;
  }
  
  #prev-image, #next-image {
    width: 36px;
    height: 36px;
  }
  
  #prev-image {
    left: 20%;
  }

  #next-image {
    right: 20%;
  }
}