/* =============================================
   IndiWorlds Images — Dark Theme Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:          #0a0a0f;
  --bg2:         #111118;
  --bg3:         #1a1a24;
  --border:      #2a2a3a;
  --border2:     #3a3a4f;
  --accent:      #6c63ff;
  --accent2:     #8b83ff;
  --accent-glow: rgba(108, 99, 255, 0.15);
  --text:        #e8e8f0;
  --text2:       #9090a8;
  --text3:       #5a5a72;
  --success:     #22c55e;
  --error:       #ef4444;
  --warning:     #f59e0b;
  --radius:      10px;
  --radius2:     6px;
  --font-mono:   'Space Mono', monospace;
  --font-sans:   'DM Sans', sans-serif;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow2:     0 2px 8px rgba(0,0,0,0.3);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Layout ---- */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.container--wide { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.header {
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: var(--radius2);
  transition: all 0.2s;
}
.nav a:hover { color: var(--text); background: var(--bg3); }
.nav .btn-sm { color: var(--text); background: var(--bg3); border: 1px solid var(--border2); }
.nav .btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius2);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(108,99,255,0.4); }
.btn--ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn--ghost:hover { color: var(--text); border-color: var(--border2); background: var(--bg3); }
.btn--danger { background: var(--error); color: #fff; }
.btn--danger:hover { background: #dc2626; }
.btn--sm { padding: 6px 14px; font-size: 0.825rem; }
.btn--full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- Cards ---- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card--inset { background: var(--bg3); }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 10px 14px;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text3); }
.form-select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 10px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.form-select:focus { border-color: var(--accent); }
.form-hint { font-size: 0.8rem; color: var(--text3); margin-top: 4px; }

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--bg2);
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.upload-zone.dragover { transform: scale(1.01); }
.upload-zone__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
}
.upload-zone__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.upload-zone__sub { color: var(--text2); font-size: 0.875rem; }
.upload-zone__sub span { color: var(--accent); font-weight: 500; }
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* ---- Upload Tabs ---- */
.upload-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.upload-tab {
  padding: 8px 18px;
  border-radius: var(--radius2);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.upload-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.upload-tab-content { display: none; }
.upload-tab-content.active { display: block; }

/* ---- Resize Options ---- */
.resize-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.resize-option {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 0.825rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s;
}
.resize-option:hover { border-color: var(--accent); color: var(--accent); }
.resize-option.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---- Queue ---- */
.queue { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.queue-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.queue-item__thumb {
  width: 48px; height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.queue-item__info { flex: 1; min-width: 0; }
.queue-item__name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-item__meta { font-size: 0.775rem; color: var(--text2); margin-top: 2px; }
.queue-item__status { font-size: 0.775rem; font-weight: 500; }
.queue-item__status--pending { color: var(--text3); }
.queue-item__status--uploading { color: var(--warning); }
.queue-item__status--done { color: var(--success); }
.queue-item__status--error { color: var(--error); }
.queue-item__remove {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 1.1rem; padding: 4px;
  border-radius: 4px; transition: color 0.2s;
}
.queue-item__remove:hover { color: var(--error); }

/* ---- Progress bar ---- */
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}

/* ---- Results ---- */
.result-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.result-card__img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: var(--bg);
  display: block;
}
.result-card__body { padding: 20px; }
.result-card__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.link-row__label {
  font-size: 0.775rem;
  color: var(--text2);
  width: 90px;
  flex-shrink: 0;
  font-weight: 500;
}
.link-row__input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.775rem;
  padding: 7px 10px;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text2);
  font-size: 0.775rem;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }

/* ---- Image View Page ---- */
.img-view { padding: 40px 0; }
.img-view__image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg2);
  display: block;
  margin-bottom: 24px;
}
.img-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.img-meta__item { font-size: 0.825rem; color: var(--text2); }
.img-meta__item strong { color: var(--text); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
.td-thumb {
  width: 40px; height: 40px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg3);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge--file { background: rgba(108,99,255,0.15); color: var(--accent2); }
.badge--url  { background: rgba(34,197,94,0.15);  color: var(--success); }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius2);
  font-size: 0.875rem;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert--error   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.alert--success { background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.3);  color: #86efac; }
.alert--info    { background: rgba(108,99,255,0.1); border-color: rgba(108,99,255,0.3); color: var(--accent2); }

/* ---- Login Page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
}
.login-box { width: 100%; max-width: 400px; }
.login-logo {
  text-align: center;
  margin-bottom: 32px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
}
.login-logo span { color: var(--accent); }

/* ---- Page header ---- */
.page-header { padding: 32px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.page-header h1 { font-size: 1.5rem; font-weight: 600; }
.page-header p { color: var(--text2); margin-top: 4px; font-size: 0.9rem; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.page-btn {
  padding: 6px 12px;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 0.825rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.page-btn:hover, .page-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Admin sidebar ---- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px 0; min-height: calc(100vh - 60px); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius2);
  color: var(--text2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.admin-nav a:hover { color: var(--text); background: var(--bg3); }
.admin-nav a.active { color: var(--accent); background: var(--accent-glow); }

/* ---- Misc ---- */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted { color: var(--text2); }
.text-sm { font-size: 0.825rem; }
.text-mono { font-family: var(--font-mono); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .admin-layout { grid-template-columns: 1fr; }
  .upload-zone { padding: 40px 20px; }
  .img-meta { gap: 12px; }
  .link-row { flex-wrap: wrap; }
  .link-row__label { width: 100%; }
}
