@import url('https://fonts.googleapis.com/css2?family=Anton&family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap');

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

:root {
  --gold: #FFCC00;
  --gold-dim: #e6b800;
  --black: #0a0a0a;
  --dark: #141414;
  --card: #1c1c1c;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --muted: #888;
  --danger: #FF0000;
}

body {
  background: var(--black);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* HEADER */
header {
  background: var(--dark);
  border-bottom: 2px solid var(--gold);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text {
  font-family: 'Anton', sans-serif;
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--text);
}

.logo-text span { color: var(--gold); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.settings-btn:hover { color: var(--gold); }

/* BUTTONS */
.btn {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: var(--gold-dim); }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn-outline:hover { background: var(--gold); color: var(--black); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); border-color: #444; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover { background: var(--danger); color: var(--text); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* MAIN */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-family: 'Anton', sans-serif;
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--gold);
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* FILTERS */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  flex: 1;
  min-width: 100px;
  min-height: 44px;
}

.filter-select:focus { outline: none; border-color: var(--gold); }

/* PROJECT LIST */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-list-header {
  display: grid;
  grid-template-columns: 1fr 120px 90px 70px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 120px 90px 70px;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.project-card:hover {
  border-color: var(--gold);
  background: #202020;
}

.project-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}

.project-name .date-part { color: var(--gold); margin-right: 6px; }

.project-creator { font-size: 13px; color: var(--muted); }

.project-stats {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-stats .count { color: var(--text); font-weight: 600; }

.project-size {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-new { background: #1a3a1a; color: #4caf50; }

/* GALLERY HEADER */
.gallery-header { margin-bottom: 20px; }

.gallery-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  font-family: 'Barlow', sans-serif;
  padding: 10px 18px;
  border-radius: 6px;
  min-height: 44px;
  transition: all 0.15s;
}

.back-btn:hover { color: var(--gold); border-color: var(--gold); }

.search-box {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  flex: 1;
  min-width: 140px;
  min-height: 44px;
}

.search-box::placeholder { color: var(--muted); }
.search-box:focus { outline: none; border-color: var(--gold); }

.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-tab {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  transition: all 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.filter-tab.active,
.filter-tab:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

/* UPLOAD ZONE */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 24px;
  transition: border-color 0.15s;
  cursor: pointer;
}

.upload-zone:hover { border-color: var(--gold); }

.upload-zone.dragover {
  border-color: var(--gold);
  background: rgba(255, 204, 0, 0.05);
}

.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.upload-limit { font-size: 12px; color: #555; margin-top: 8px; }

.upload-actions {
  margin: 14px 0 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-upload {
  background: #1a5c2a;
  color: #4cef6e;
  border: 1px solid #2a7a3a;
}

.btn-upload:hover { background: #237a35; }

.btn-cancel {
  background: #3a1a1a;
  color: #ef6e6e;
  border: 1px solid #5a2a2a;
}

.btn-cancel:hover { background: #4a2222; }

.upload-progress-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.upload-progress {
  background: var(--border);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 6px;
  width: 0%;
  transition: width 0.3s;
}

.upload-status {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.upload-status .uploading { color: var(--gold); font-weight: 600; }

/* FILE CHECKLIST */
.file-checklist {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-checklist-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.file-checklist-item label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}

.file-checklist-item label input { cursor: pointer; }

.file-checklist-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-checklist-item .file-type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.file-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

/* BULK BAR */
.bulk-bar {
  background: var(--gold);
  color: var(--black);
  padding: 10px 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 13px;
}

.bulk-bar .bulk-actions { display: flex; gap: 8px; }

.bulk-btn {
  background: var(--black);
  color: var(--gold);
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 40px;
}

.bulk-btn.delete-btn { color: var(--danger); }

/* PROJECT NOTE */
.project-note {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.project-note strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-note textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  resize: vertical;
  min-height: 40px;
  outline: none;
}

.project-note textarea::placeholder { color: #555; }

/* COLLAPSIBLE SECTIONS */
.collapsible-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  margin-bottom: 12px;
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
}

.collapsible-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
}

.collapsible-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.collapsible-toggle {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  transition: transform 0.2s, color 0.15s;
}

.collapsible-toggle:hover { color: var(--gold); }
.collapsible-toggle.open { transform: rotate(180deg); }

.collapsible-body {
  padding: 0 16px 12px;
}

.collapsible-body textarea {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 4px;
  resize: vertical;
  min-height: 60px;
  outline: none;
}

.collapsible-body textarea:focus { border-color: var(--gold); }

.collapsible-save {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.collapsible-preview {
  padding: 0 16px 12px;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

/* SECTION LABEL */
.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* GALLERY GRID */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.gallery-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s;
  aspect-ratio: 1;
}

.gallery-item:hover { border-color: var(--gold); }

.gallery-item.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gallery-thumb.photo { background: linear-gradient(135deg, #1a1a2e, #16213e); }
.gallery-thumb.video { background: linear-gradient(135deg, #1a0a0a, #2e1010); }
.gallery-thumb.edit { background: linear-gradient(135deg, #0a1a0a, #102e10); }

.thumb-icon { font-size: 36px; opacity: 0.6; }

.item-type-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-photo { background: #1a2a3a; color: #64b5f6; }
.type-video { background: #2a1a1a; color: #ef9a9a; }
.type-edit { background: #1a2a1a; color: #a5d6a7; }

.star-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 14px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

.select-check {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s;
}

.select-check:hover {
  border-color: var(--gold);
  transform: scale(1.15);
}

.gallery-item.selected .select-check {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
}

.item-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 16px 6px 6px;
  font-size: 10px;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CONTEXT MENU */
.context-menu {
  position: fixed;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 160px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.context-menu-item {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-menu-item:hover { background: var(--border); }
.context-menu-item.danger { color: var(--danger); }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
}

.modal-title {
  font-family: 'Anton', sans-serif;
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 6px;
  outline: none;
  min-height: 44px;
}

.form-input:focus { border-color: var(--gold); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* LOGIN */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-box {
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.login-logo-icon {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto 16px;
}

.login-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-title {
  font-family: 'Anton', sans-serif;
  font-size: 32px;
  letter-spacing: 3px;
  color: var(--text);
  margin-bottom: 32px;
}

.login-title span { color: var(--gold); }

.login-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: 6px;
  outline: none;
  margin-bottom: 14px;
  text-align: center;
  min-height: 48px;
}

.login-input:focus { border-color: var(--gold); }

.login-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  min-height: 20px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
}

/* ADMIN */
.admin-container {
  max-width: 440px;
  margin: 40px auto;
  padding: 0 16px;
}

.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.admin-message {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  text-align: center;
}

.admin-message.success {
  background: #1a3a1a;
  color: #4caf50;
}

.admin-message.error {
  background: #3a1a1a;
  color: var(--danger);
}

/* LOADING */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 14px;
}

.loading::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 12px auto 0;
  animation: spin 0.8s linear infinite;
}

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

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-title {
  font-family: 'Anton', sans-serif;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .project-list-header { display: none; }

  .project-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .project-col-hide { display: none; }

  .project-meta-mobile {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
  }

  .page-title { font-size: 22px; }

  .header-right .btn span.btn-text { display: none; }
}

@media (max-width: 400px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Hide on mobile */
@media (min-width: 601px) {
  .project-meta-mobile .project-creator { display: none; }
}

/* LIGHTBOX */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 400;
  display: flex;
  flex-direction: column;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lightbox-filename {
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 16px;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lightbox-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.lightbox-close:hover { color: var(--text); }

.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 38px; }

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.lightbox-content {
  max-width: 90%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.lightbox-nav {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 48px;
  cursor: pointer;
  padding: 20px;
  flex-shrink: 0;
  transition: color 0.15s;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover { color: var(--gold); }

.lightbox-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--dark);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .lightbox-nav { width: 40px; padding: 10px; font-size: 32px; }
  .lightbox-content { max-width: 100%; }
}
