﻿body {
  font-family: Arial, sans-serif;
  max-width: 1280px; /* widened */
  margin: 2rem auto;
  line-height: 1.6;
  padding: 0 1rem; /* small side padding */
}

.menu {
  background: #f4f4f4;
  padding: 10px;
}

.menu a {
  margin-right: 15px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

.menu a:hover {
  color: #d33;
}

.gallery {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Each item is a 300x300 square */
.gallery-item {
  position: relative;
  width: 300px;
  height: 300px;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* fills the box, crops overflow */
  transition: transform 0.3s ease-in-out;
  display: block;
}

.rotatable {
  width: 100%;
  height: 100%;
  overflow: hidden;         /* crop to square */
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: transform 1s ease-in-out;
  transform-origin: 50% 50%;
  will-change: transform;   /* smoother animation */
}

.rotatable img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Buttons overlay, fixed at 10px/10px, always above */
.buttons {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 5px;
  z-index: 20;
}

.buttons button {
  background: rgba(255,255,255,0.85);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.buttons button:hover {
  background: #fff;
  border-color: #888;
}

/* Lightbox base (kept in DOM; hidden via opacity/pointer-events) */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;                   /* always flex; visibility via opacity */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  opacity: 0;                      /* hidden */
  pointer-events: none;            /* clicks pass through when hidden */
  transition: opacity .35s ease;   /* fade in/out backdrop */
  z-index: 999;
}

/* Open state */
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

/* Image enters with a subtle zoom & fade */
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  background: #fff;

  transform: scale(.94);           /* start slightly smaller */
  opacity: 0.85;
  transition: transform .35s ease, opacity .35s ease;
}

.lightbox.open img {
  transform: scale(1);             /* zoom up */
  opacity: 1;
}

/* Optional: prevent background scroll when open */
body.lb-open { overflow: hidden; }

/* Uploader */
.uploader { margin-top: 16px; }

.dropzone {
  border: 2px dashed #b8c2cc;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  background: #fafafa;
  transition: background .2s, border-color .2s;
}
.dropzone .pick-btn {
  margin-left: 6px;
  padding: 6px 10px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.dropzone .pick-btn:hover { border-color: #9fb3c8; }
.dropzone .hint { color: #6b7280; font-size: .9rem; margin-top: 6px; }

.dropzone.dragover {
  background: #eef6ff;
  border-color: #7aa7ff;
}

.progress-list { margin-top: 12px; display: grid; gap: 8px; }
.progress-item { display: flex; align-items: center; gap: 10px; }
.progress-item .name { min-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress {
  flex: 1;
  height: 8px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: #4caf50; /* will animate width */
  transition: width .2s linear;
}
.progress.error > span { background: #e53935; }



