/* ============================================================
   BOR-MASTEN.FROM.HR — gallery.css
   ============================================================ */

/* --- Gallery filters --- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  padding: 1.25rem 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.filter-group select,
.filter-group input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
  min-width: 160px;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary);
}

/* --- Photo grid --- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.photo-grid-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  cursor: pointer;
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.photo-grid-item:hover img {
  transform: scale(1.04);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  gap: 0.2rem;
}

.photo-grid-item:hover .photo-overlay {
  opacity: 1;
}

.photo-title  { color: #fff; font-weight: 600; font-size: 0.875rem; }
.photo-persons { color: #cbd5e1; font-size: 0.75rem; }
.photo-date   { color: #94a3b8; font-size: 0.75rem; }

/* Draft / private badges */
.photo-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  pointer-events: none;
}

.badge-draft   { background: rgba(220,38,38,0.85); color: #fff; }
.badge-private { background: rgba(37,99,235,0.85); color: #fff; }

/* Owner action buttons */
.photo-owner-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-grid-item:hover .photo-owner-actions {
  opacity: 1;
}

.owner-btn {
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.owner-btn:hover { background: #fff; }
.owner-btn-delete:hover { background: #fee2e2; }

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  display: flex;
  align-items: stretch;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 80px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.2); }

.lightbox-inner {
  display: flex;
  width: 100%;
  height: 100%;
}

.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 4.5rem 2rem;
  overflow: hidden;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}

.lightbox-info {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-dark2);
  padding: 4rem 1.5rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lightbox-info h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.lb-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lb-meta span {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.lb-desc {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.lb-comments h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.75rem;
}

.lb-comment {
  margin-bottom: 0.75rem;
}

.lb-comment strong { color: #fff; font-size: 0.8125rem; }
.lb-comment .text-muted { font-size: 0.75rem; margin-left: 0.5rem; }
.lb-comment p { color: #94a3b8; font-size: 0.8125rem; margin-top: 0.2rem; }

.lb-comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.lb-comment-form textarea {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  resize: none;
  outline: none;
}

.lb-comment-form textarea::placeholder { color: #64748b; }
.lb-comment-form textarea:focus { border-color: var(--primary); }

/* --- Upload page --- */
.upload-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  gap: 0.75rem;
  transition: background 0.2s;
}

.upload-dropzone.drag-over {
  background: var(--primary-light);
}

.upload-icon { font-size: 3rem; }
.upload-label { font-size: 1rem; color: var(--text-muted); }
.upload-hint { font-size: 0.8125rem; color: var(--text-light); }

.upload-settings {
  padding: 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: var(--bg);
}

.upload-setting-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.upload-setting-row label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.upload-setting-row select {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
}

.upload-setting-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.quality-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preview grid */
.preview-grid {
  margin-top: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.preview-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.preview-grid-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}

.preview-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.preview-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item-name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.25rem 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-item-size {
  position: absolute;
  top: 0.35rem; left: 0.35rem;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

.preview-remove {
  position: absolute;
  top: 0.35rem; right: 0.35rem;
  background: rgba(220,38,38,0.8);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Progress bar */
.progress-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 2rem 0 0.75rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

/* Meta forms */
.meta-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.meta-card-thumb img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
}

.meta-card-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.meta-card-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.save-status {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Persons tags */
.persons-input { display: flex; flex-direction: column; gap: 0.5rem; }
.persons-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.person-tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.625rem;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.person-tag button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0;
  line-height: 1;
}

.person-add-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
}
.person-add-input:focus { border-color: var(--primary); }

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2999;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 3001;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
}

.modal-header h3 { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; }
.modal-header button { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-muted); }

.modal-body { padding: 1.5rem; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .lightbox-inner { flex-direction: column; }
  .lightbox-info { width: 100%; padding: 1rem 1.25rem 2rem; }
  .lightbox-img-wrap { padding: 3.5rem 3.5rem 0; flex: none; height: 55vw; }
  .meta-card { grid-template-columns: 1fr; }
  .meta-card-thumb { max-width: 260px; }
}

@media (max-width: 600px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .gallery-filters { flex-direction: column; }
}
