/* Modern Gallery 2026 - Light Theme */
:root {
  --primary-color: #4361ee;
  --primary-light: #eef2ff;
  --secondary-color: #3a0ca3;
  --accent-color: #7209b7;
  --text-color: #333333;
  --text-light: #666666;
  --text-lighter: #888888;
  --bg-color: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f9;
  --border-color: #e0e0e0;
  --border-light: #f0f0f0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Password Protection Screen */
.password-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.password-container {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 450px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.password-header {
  margin-bottom: 30px;
}

.password-header i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.password-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 10px;
}

.password-subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
}

.password-input-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#passwordInput {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
}

#passwordInput:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.password-input-container .btn {
  white-space: nowrap;
  padding: 16px 24px;
}

.password-error {
  color: #e74c3c;
  font-size: 0.95rem;
  min-height: 24px;
  margin-bottom: 20px;
  font-weight: 500;
}

.password-hint {
  background-color: var(--primary-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 20px;
  border: 1px solid rgba(67, 97, 238, 0.2);
}

.password-hint p {
  color: var(--primary-color);
  font-size: 0.95rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.password-hint i {
  font-size: 1.2rem;
}

.gallery-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.gallery-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-content h1 .year {
  color: var(--primary-color);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-content h1 i {
  color: var(--primary-color);
  font-size: 2.2rem;
}

.subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
  font-weight: 400;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.selection-info {
  background-color: var(--primary-light);
  color: var(--primary-color);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid rgba(67, 97, 238, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.btn i {
  font-size: 1.1rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-primary:disabled {
  background-color: var(--text-lighter);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Gallery Grid */
.gallery-main {
  flex: 1;
  position: relative;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 8px 0 40px;
}

/* Responsive grid sizing */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
  
  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .password-input-container {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  .password-container {
    padding: 30px 20px;
  }
}

/* Image Card */
.image-card {
  position: relative;
  background-color: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 300px; /* Fixed height for consistency */
}

.image-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.image-card.selected {
  border: 3px solid var(--primary-color);
  position: relative;
}

.image-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}

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

/* Checkbox */
.image-checkbox {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.image-checkbox:hover {
  background-color: white;
  border-color: var(--primary-color);
}

.image-checkbox.checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.image-checkbox.checked::after {
  content: '✓';
  color: white;
  font-weight: bold;
  font-size: 14px;
}

/* Image Info */
.image-info {
  padding: 18px 16px;
  background-color: white;
  border-top: 1px solid var(--border-light);
}

.image-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-info p {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 400;
}

/* Loading */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  font-size: 1.2rem;
  color: var(--text-color);
  font-weight: 500;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(10px);
}

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

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.lightbox-controls {
  position: absolute;
  top: -50px;
  left: 0;
  display: flex;
  gap: 10px;
}

.lightbox-select {
  background-color: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease;
  backdrop-filter: blur(5px);
}

.lightbox-select:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.lightbox-select.selected {
  background-color: var(--primary-color);
}

.lightbox-select.selected i {
  content: '\\f14a';
}

.lightbox-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.lightbox-nav {
  background-color: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  transition: background-color 0.2s ease;
  pointer-events: all;
  backdrop-filter: blur(5px);
}

.lightbox-nav:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.lightbox-image-container {
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image-container img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lightbox-caption {
  margin-top: 20px;
  color: white;
  text-align: center;
  font-size: 1.1rem;
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 800px;
  padding: 0 20px;
}

#lightboxFilename {
  font-weight: 600;
}

#lightboxCounter {
  color: rgba(255, 255, 255, 0.7);
}

/* Footer */
.gallery-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-light);
  font-size: 0.95rem;
}

.gallery-footer p {
  margin-bottom: 8px;
}

.footer-note {
  font-size: 0.9rem;
  color: var(--text-lighter);
}

/* Selection States */
.image-card.selected .image-checkbox {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.image-card.selected .image-checkbox::after {
  content: '✓';
  color: white;
}

/* Focus states for accessibility */
button:focus,
.image-checkbox:focus,
#passwordInput:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-lighter);
}