/* ── NADAtäx Admin CMS styles ──────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --deep-blue: #0818a8;
  --water-blue: #4A90D9;
  --cream: #F5F0E8;
  --red: #C13A3A;
  --white: #fff;
  --dark: #222;
  --gray: #f5f5f5;
  --border: #ddd;
}

body {
  font-family: 'Courier New', Courier, monospace;
  color: var(--dark);
  background: var(--cream);
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ── Login ─────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--deep-blue);
}

.login-box {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.login-box h1 { margin-bottom: 0.5rem; color: var(--deep-blue); }
.login-box p { margin-bottom: 1rem; color: #666; font-size: 0.9rem; }

.login-box input {
  width: 100%;
  padding: 0.7rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  font-family: inherit;
}

.login-box input:focus { border-color: var(--water-blue); outline: none; }

.login-box button {
  width: 100%;
  padding: 0.7rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}

.login-box button:hover { background: var(--deep-blue); }
.login-hint { margin-top: 1rem; font-size: 0.8rem; color: #999; }

/* ── Admin layout ──────────────────────────── */
#admin-screen header {
  background: var(--deep-blue);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#admin-screen header h1 { font-size: 1.2rem; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.header-actions a,
.header-actions .btn-small { color: var(--dark); }
.header-actions a:hover,
.header-actions .btn-small:hover { color: var(--deep-blue); }

/* ── Tabs ──────────────────────────────────── */
.admin-nav {
  display: flex;
  gap: 0;
  background: var(--white);
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}

.admin-nav .tab {
  padding: 0.75rem 1.25rem;
  border: none;
  background: none;
  font-size: 0.95rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  color: #666;
  font-family: inherit;
}

.admin-nav .tab.active {
  border-bottom-color: var(--deep-blue);
  color: var(--deep-blue);
  font-weight: bold;
}

.admin-nav .tab:hover { background: var(--gray); }

.tab-panel {
  padding: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.tab-desc {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1rem;
}

.tab-desc code {
  background: var(--gray);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* ── Buttons ───────────────────────────────── */
.btn-primary {
  padding: 0.5rem 1rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover { background: var(--deep-blue); }

.btn-small {
  padding: 0.35rem 0.75rem;
  background: var(--gray);
  color: var(--dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-small:hover { background: var(--border); }

.btn-danger {
  padding: 0.35rem 0.75rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-danger:hover { opacity: 0.8; }

/* ── Editor ────────────────────────────────── */
.editor-panel { margin-top: 0.5rem; }

.editor-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.editor-help {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.editor-help code {
  background: var(--gray);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

.format-help {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.format-help li {
  margin-bottom: 0.4rem;
}

textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
}

textarea:focus { border-color: var(--water-blue); outline: none; }

/* ── Image grid ────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.image-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  aspect-ratio: 1;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-card .image-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-card .image-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.image-card:hover .image-delete { display: flex; }

/* FAQ preview — tall info-graphic images, show full */
.faq-preview {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.faq-preview .image-card {
  aspect-ratio: auto;
}

.faq-preview .image-card img {
  height: auto;
  object-fit: contain;
}

.upload-area { margin: 0; }

.upload-btn {
  display: inline-block;
  cursor: pointer;
}

/* ── Reviews list ──────────────────────────── */
.dates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

#reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.review-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--water-blue);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.review-card .review-text {
  flex: 1;
  font-style: italic;
  color: #555;
}

.review-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Designs toolbar ────────────────────────── */
.designs-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.add-group-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.add-group-row input {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  width: 160px;
}

/* ── Design groups ─────────────────────────── */
.design-group {
  margin-bottom: 1.5rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--gray);
  border-bottom: 1px solid var(--border);
}

.group-header h3 {
  font-size: 0.95rem;
  color: var(--deep-blue);
  margin: 0;
}

.group-count {
  font-weight: normal;
  color: #999;
  font-size: 0.85rem;
}

.group-actions {
  display: flex;
  gap: 0.35rem;
}

.group-dropzone {
  min-height: 80px;
  padding: 0.75rem;
  transition: background 0.2s;
}

.group-dropzone.drag-over {
  background: rgba(74, 144, 217, 0.1);
  outline: 2px dashed var(--water-blue);
  outline-offset: -4px;
}

.drop-hint {
  color: #ccc;
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem;
  pointer-events: none;
}

/* Drag styles */
.design-card[draggable] {
  cursor: grab;
}

.design-card[draggable]:active {
  cursor: grabbing;
}

.design-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

/* ── Copyright on design cards ─────────────── */
.copyright-bar {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.7);
  padding: 0.25rem 0.4rem;
  gap: 0.3rem;
}

.copyright-label {
  color: var(--white);
  font-size: 0.8rem;
  font-weight: bold;
  flex-shrink: 0;
  opacity: 0.9;
}

.copyright-select {
  flex: 1;
  padding: 0.15rem 0.3rem;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}

.copyright-select:focus { outline: 1px solid var(--water-blue); }

.copyright-select option {
  background: var(--white);
  color: var(--dark);
  font-size: 0.85rem;
}

/* Photographer pills */
.photographer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.photographer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.6rem 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.pill-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.15rem;
}

.pill-remove:hover { opacity: 0.7; }

.add-photographer-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.add-photographer-row input {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
}

/* ── Forms ─────────────────────────────────── */
#review-form {
  background: var(--white);
  border: 2px solid var(--water-blue);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

#review-form h3 {
  margin-bottom: 1rem;
  color: var(--deep-blue);
}

#review-form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: bold;
  color: #555;
}

#review-form input, #review-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ── Status messages ───────────────────────── */
.status {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.status.success { background: #e8f5e9; color: #2e7d32; }
.status.error, .error { color: var(--red); }
.status.error { background: #fce4ec; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 600px) {
  .tab-panel { padding: 1rem; }
  .admin-nav .tab { padding: 0.6rem 0.8rem; font-size: 0.85rem; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
