/*
 * Styles for the Gallery Page
 */

:root {
  --g-gap: 1rem;
  --g-bg: #0b1324;
  --g-card-bg: #0f1a33;
  --g-border: rgba(255, 255, 255, 0.08);
  --g-text: #e7edf7;
  --g-subtle: #b9c3d6;
  --brand: #3aa4ff;
  --brand-2: #2dd4bf;
}

body.gallery-body {
  background: radial-gradient(1200px 800px at 10% -10%, rgba(21, 161, 255, 0.08), transparent 60%),
    radial-gradient(1200px 800px at 110% 10%, rgba(45, 212, 191, 0.08), transparent 60%),
    linear-gradient(180deg, #0a1020, #0b1222 20%, #0b1324 100%);
  color: var(--g-text);
  min-height: 100vh;
}

.gallery-body .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.gallery-body .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--g-border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
  background: linear-gradient(180deg, rgba(11, 19, 36, 0.7), rgba(11, 19, 36, 0.4));
  z-index: 10;
}

.gallery-body .page-header h1 {
  font-size: clamp(1.25rem, 2vw + 1rem, 2rem);
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0;
}

.gallery-body .actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gallery-body .upload-card {
  margin: 1.25rem 0 0.75rem;
  border: 1px dashed var(--g-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  border-radius: 14px;
  padding: 1rem;
}

.gallery-body .uploader {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 640px) {
  .gallery-body .uploader {
    grid-template-columns: 1fr;
  }
}

.gallery-body .file-drop {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--g-border);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.gallery-body .file-drop.dragover {
  border-color: rgba(58, 164, 255, 0.6);
  background: rgba(58, 164, 255, 0.06);
}

.gallery-body .file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.gallery-body .file-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gallery-body .file-meta .title {
  font-weight: 600;
}
.gallery-body .file-meta .hint {
  color: var(--g-subtle);
  font-size: 0.9rem;
}

.gallery-body .btn-primary {
  appearance: none;
  border: 0;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  color: #02101f;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px rgba(58, 164, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.2s ease;
}
.gallery-body .btn-primary:disabled {
  filter: grayscale(0.5) brightness(0.8);
  cursor: not-allowed;
}
.gallery-body .btn-primary:active {
  transform: translateY(1px);
}

.gallery-body .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
  flex-wrap: wrap;
}

.gallery-body .search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--g-border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  width: 100%;
  max-width: 360px;
}

.gallery-body .search-box input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--g-text);
  width: 100%;
  font-size: 0.95rem;
}

.gallery-body .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--g-gap);
}

.gallery-body .card {
  position: relative;
  border: 1px solid var(--g-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  border-radius: 14px;
  overflow: hidden;
}

.gallery-body .thumb {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 */
  background: #0c1a2c;
}

.gallery-body .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-body .card-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-top: 1px solid var(--g-border);
}

.gallery-body .label {
  font-size: 0.9rem;
  color: var(--g-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-body .btn-icon {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--g-text);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.08s ease;
}
.gallery-body .btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}
.gallery-body .btn-icon:active {
  transform: translateY(1px);
}

.gallery-body .empty {
  border: 1px dashed var(--g-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--g-subtle);
}

.gallery-body .toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  background: #0a1a2a;
  color: #e6f0ff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}
.gallery-body .toast.show {
  transform: translateY(0);
  opacity: 1;
}

.gallery-body .muted {
  color: var(--g-subtle);
  font-size: 0.9rem;
}
.gallery-body .flex-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gallery-body a.btn-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}