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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

/* Customer-facing pages get feminine styling */
body.customer-page {
  background: linear-gradient(135deg, #f5e6e8 0%, #d4b5a8 100%);
  font-family: Georgia, 'Times New Roman', serif;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

/* Customer container styling */
body.customer-page .container {
  background: #fdfbf7;
  box-shadow: 0 10px 40px rgba(212, 181, 168, 0.3);
  border: 1px solid #e8d5cc;
}

h1 {
  color: #333;
  margin-bottom: 30px;
  text-align: center;
}

/* Customer page h1 styling */
body.customer-page h1 {
  font-family: 'Dancing Script', 'Brush Script MT', cursive;
  color: #c9969e;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(201, 150, 158, 0.1);
}

h2 {
  color: #555;
  margin-bottom: 20px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

h3 {
  color: #333;
  margin-bottom: 10px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.header h1 {
  margin: 0;
}

.error {
  background: #fee;
  color: #c33;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
}

/* Customer page error styling */
body.customer-page .error {
  background: #f9e8ea;
  color: #c9969e;
  border: 1px solid #e8c8cc;
}

.access-form, .gallery-form {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.access-form label, .gallery-form label {
  font-weight: 600;
  color: #555;
}

/* Customer page label styling */
body.customer-page .access-form label {
  font-family: 'Dancing Script', 'Brush Script MT', cursive;
  font-size: 24px;
  color: #b08a8f;
  font-weight: 400;
}

.access-form input, .gallery-form input {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s;
}

/* Customer page input styling */
body.customer-page .access-form input {
  border: 2px solid #e8d5cc;
  background: white;
  color: #6b5858;
  font-size: 18px;
  text-align: center;
  letter-spacing: 2px;
}

body.customer-page .access-form input:focus {
  outline: none;
  border-color: #c9969e;
  box-shadow: 0 0 0 3px rgba(201, 150, 158, 0.1);
}

.access-form input:focus, .gallery-form input:focus {
  outline: none;
  border-color: #667eea;
}

button, .btn {
  padding: 12px 24px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

/* Customer page button styling */
body.customer-page button,
body.customer-page .btn-download-all,
body.customer-page .btn-download {
  background: linear-gradient(135deg, #d4a5ae 0%, #c9969e 100%);
  color: white;
  border-radius: 25px;
  padding: 14px 32px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(201, 150, 158, 0.3);
  transition: all 0.3s;
}

body.customer-page button:hover,
body.customer-page .btn-download-all:hover,
body.customer-page .btn-download:hover {
  background: linear-gradient(135deg, #c9969e 0%, #b08a8f 100%);
  box-shadow: 0 6px 20px rgba(201, 150, 158, 0.4);
  transform: translateY(-2px);
}

button:hover, .btn:hover {
  background: #5568d3;
}

.admin-link {
  text-align: center;
  margin-top: 20px;
}

.admin-link a {
  color: #667eea;
  text-decoration: none;
}

/* Customer page admin link styling */
body.customer-page .admin-link a {
  color: #b08a8f;
  font-style: italic;
  font-size: 14px;
}

body.customer-page .admin-link a:hover {
  color: #c9969e;
}

.admin-link a:hover {
  text-decoration: underline;
}

.section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #eee;
}

.section:last-child {
  border-bottom: none;
}

.gallery-item {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
}

.gallery-info {
  margin-bottom: 15px;
}

.gallery-info p {
  margin: 8px 0;
  color: #666;
}

.code {
  background: #fff3cd;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  color: #856404;
}

.gallery-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.upload-form {
  display: flex;
  gap: 10px;
  flex: 1;
  align-items: center;
}

.upload-form input[type="file"] {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.upload-form button {
  padding: 10px 20px;
  font-size: 14px;
}

.btn-view {
  background: #28a745;
}

.btn-view:hover {
  background: #218838;
}

.btn-delete {
  background: #dc3545;
}

.btn-delete:hover {
  background: #c82333;
}

.btn-edit {
  background: #ff9800;
}

.btn-edit:hover {
  background: #e68900;
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
}

.customer-name {
  text-align: center;
  color: #666;
  font-size: 18px;
  margin-bottom: 30px;
}

/* Customer page customer name styling */
body.customer-page .customer-name {
  font-family: 'Dancing Script', 'Brush Script MT', cursive;
  color: #b08a8f;
  font-size: 28px;
  font-style: italic;
}

.download-all {
  text-align: center;
  margin-bottom: 30px;
}

.btn-download-all {
  background: #28a745;
  padding: 15px 30px;
  font-size: 18px;
}

.btn-download-all:hover {
  background: #218838;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.photo-item {
  background: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

/* Customer page photo items */
body.customer-page .photo-item {
  background: white;
  border: 1px solid #e8d5cc;
  box-shadow: 0 2px 8px rgba(201, 150, 158, 0.15);
}

body.customer-page .photo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(201, 150, 158, 0.25);
}

.photo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.photo-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.photo-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-name {
  color: #333;
  font-size: 14px;
  word-break: break-word;
}

/* Customer page photo name */
body.customer-page .photo-name {
  color: #6b5858;
  font-style: italic;
  text-align: center;
}

.btn-download {
  background: #667eea;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-download:hover {
  background: #5568d3;
}

/* Form styling */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}

.help-text {
  display: block;
  color: #888;
  font-size: 13px;
  margin-top: 5px;
}

.gallery-form input {
  width: 100%;
}

/* Upload form full width */
.upload-form-full {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.upload-form-full input[type="file"] {
  flex: 1;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  min-width: 250px;
}

.upload-form-full button {
  padding: 12px 24px;
}

/* Photo management */
.photo-management {
  margin-top: 20px;
}

.selection-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Photo grid for management */
.photo-grid-manage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.photo-item-manage {
  position: relative;
}

.photo-item-manage input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  z-index: 10;
  cursor: pointer;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.photo-item-manage label {
  display: block;
  cursor: pointer;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid transparent;
  transition: all 0.3s;
}

.photo-item-manage input[type="checkbox"]:checked + label {
  border-color: #667eea;
  box-shadow: 0 0 0 2px #667eea;
}

.photo-item-manage label img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  pointer-events: none;
}

.photo-item-manage input[type="checkbox"]:checked + label .photo-overlay {
  background: rgba(102, 126, 234, 0.6);
}

.checkmark {
  color: white;
  font-size: 48px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s;
}

.photo-item-manage input[type="checkbox"]:checked + label .checkmark {
  opacity: 1;
  transform: scale(1);
}

.photo-name-small {
  padding: 8px;
  background: #f9f9f9;
  font-size: 12px;
  color: #333;
  word-break: break-word;
  text-align: center;
}

.photo-item-manage:hover label {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Upload progress styles */
#uploadProgress {
  margin-top: 30px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

#uploadProgress h3 {
  margin-bottom: 20px;
  color: #667eea;
  font-size: 18px;
}

.progress-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.progress-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.progress-label {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  font-weight: 500;
  word-break: break-word;
}

.progress-bar-container {
  width: 100%;
  height: 24px;
  background: #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 12px;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 2s infinite;
}

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

.progress-percent {
  font-size: 14px;
  color: #667eea;
  font-weight: 600;
  text-align: right;
}

/* Success message */
.success {
  background: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
  border: 1px solid #c3e6cb;
}

/* ZIP upload form */
.zip-upload-form {
  max-width: 600px;
  margin: 0 auto;
}

.help-text-large {
  color: #666;
  font-size: 15px;
  margin-bottom: 25px;
  line-height: 1.6;
}

.zip-upload-form label[for] {
  display: block;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}

.zip-upload-form input[type="radio"] {
  margin-right: 8px;
  margin-left: 0;
}

.zip-upload-form label {
  display: inline-block;
  margin-right: 20px;
  margin-bottom: 10px;
  font-weight: normal;
  cursor: pointer;
}

.zip-upload-form select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  background: white;
  cursor: pointer;
}

.zip-upload-form select:focus {
  outline: none;
  border-color: #667eea;
}

.zip-upload-form input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 2px dashed #ddd;
  border-radius: 5px;
  background: #f9f9f9;
  cursor: pointer;
}

.zip-upload-form input[type="file"]:hover {
  border-color: #667eea;
  background: #f0f0ff;
}

.btn-large {
  padding: 15px 40px;
  font-size: 18px;
  width: 100%;
  margin-top: 10px;
}

.tips-list {
  list-style: none;
  padding: 0;
}

.tips-list li {
  padding: 12px 15px;
  margin-bottom: 10px;
  background: #f9f9f9;
  border-left: 4px solid #667eea;
  border-radius: 4px;
  color: #555;
}

.tips-list li:before {
  content: "\1F4A1";
  margin-right: 8px;
}

/* Gallery thumbnail cursor */
.gallery-thumb {
  cursor: zoom-in;
  transition: opacity 0.3s;
}

.gallery-thumb:hover {
  opacity: 0.85;
}

/* Lightbox overlay */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

/* Lightbox content box */
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Main lightbox image */
#lightbox-img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.25s ease;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* Close button */
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 30px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 36px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
  z-index: 10000;
}

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

/* Prev/Next buttons */
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10000;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.3);
}

/* Lightbox footer */
.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 15px;
  padding: 0 5px;
  gap: 20px;
}

#lightbox-name {
  color: #ddd;
  font-size: 14px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#lightbox-counter {
  color: #aaa;
  font-size: 14px;
  white-space: nowrap;
}

/* Lightbox download button */
.lightbox-download-btn {
  background: linear-gradient(135deg, #d4a5ae 0%, #c9969e 100%);
  color: white;
  padding: 10px 22px;
  border-radius: 25px;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(201, 150, 158, 0.4);
}

.lightbox-download-btn:hover {
  background: linear-gradient(135deg, #c9969e 0%, #b08a8f 100%);
  transform: translateY(-2px);
}

/* ── ZIP upload progress bar ───────────────────────── */
.upload-progress-wrapper {
  margin: 1.2rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #333;
}

.progress-bar-track {
  width: 100%;
  background: #e0e0e0;
  border-radius: 6px;
  height: 18px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90d9, #357abd);
  border-radius: 6px;
  transition: width 0.25s ease;
}

/* Animated stripe during server-side extraction */
.progress-bar-processing {
  background-size: 30px 30px;
  background-image: linear-gradient(
    45deg,
    rgba(255,255,255,0.2) 25%, transparent 25%,
    transparent 50%, rgba(255,255,255,0.2) 50%,
    rgba(255,255,255,0.2) 75%, transparent 75%, transparent
  );
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  from { background-position: 0 0; }
  to   { background-position: 30px 0; }
}

.progress-sub-text {
  font-size: 0.82rem;
  color: #666;
  margin: 0.3rem 0 0;
}


@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  body.customer-page h1 {
    font-size: 36px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .photo-item img {
    height: 150px;
  }

  .photo-grid-manage {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .photo-item-manage label img {
    height: 120px;
  }

  .selection-controls {
    flex-direction: column;
  }

  .selection-controls .btn {
    width: 100%;
  }

  .gallery-actions {
    flex-direction: column;
  }

  .gallery-actions .btn,
  .gallery-actions form {
    width: 100%;
  }

  .gallery-actions .btn {
    text-align: center;
  }

  .upload-form {
    width: 100%;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 28px;
  }

  #lightbox-img {
    max-height: 70vh;
  }

  .lightbox-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
