/* ── Reset & Variables ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #5a9a30;
  --primary-dark: #3a7a20;
  --primary-glow: rgba(90, 154, 48, 0.35);
  --accent: #b8d88a;
  --surface: rgba(12, 28, 10, 0.75);
  --surface-hover: rgba(18, 40, 16, 0.85);
  --text: #f0f5ec;
  --text-muted: #8aaa78;
  --border: rgba(120, 180, 80, 0.12);
  --border-hover: rgba(120, 180, 80, 0.3);
  --danger: #c0392b;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background: #0e1f0e;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background ── */
.bg-gradient {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(170deg, #0a1a0a 0%, #142e14 25%, #1e4420 50%, #2a5a28 70%, #3a6e2e 100%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 70% 10%, rgba(180, 220, 80, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(60, 140, 50, 0.06) 0%, transparent 45%);
}

/* ── Page layout ── */
.page {
  position: relative; z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
  min-height: 100vh;
}

/* ── Back link ── */
.back-link {
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ── Hub page ── */
.hub-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.5rem; font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.hub-sub {
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 3.5rem;
  letter-spacing: 0.03em;
}

.hub-cards {
  display: flex; gap: 2rem;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.hub-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s, background 0.3s;
}
.hub-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 6px 40px rgba(60, 120, 40, 0.12);
  transform: translateY(-4px);
  background: var(--surface-hover);
}

.hub-card-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  line-height: 1;
}
.hub-card h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}
.hub-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.hub-card-arrow {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
}

/* ── Staging hub link ── */
.staging-hub-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 700px;
  margin: 0 auto 3rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.3s, background 0.3s;
}
.staging-hub-link:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.staging-hub-icon { font-size: 1.5rem; flex-shrink: 0; }
.staging-hub-link span:nth-child(2) {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem; font-weight: 700;
  letter-spacing: 0.06em;
}
.staging-hub-sub {
  font-size: 0.8rem !important;
  font-weight: 400 !important;
  color: var(--text-muted);
  margin-left: auto;
  letter-spacing: 0.02em !important;
}

.hub-footer {
  text-align: center;
  font-size: 0.72rem;
  color: #2a4a2a;
  letter-spacing: 0.08em;
  margin-top: auto;
  padding-top: 3rem;
}

/* ── Project page header ── */
.project-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2rem;
}
.project-icon { font-size: 2.5rem; line-height: 1; }
.project-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2rem; font-weight: 700;
  letter-spacing: 0.08em;
}

/* ── Tabs ── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.tab {
  flex: 1;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  text-align: center;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fade-in 0.3s ease; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  transition: border-color 0.3s, background 0.3s;
  cursor: pointer;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(90, 154, 48, 0.05);
}
.upload-zone-inner { pointer-events: none; }
.upload-zone label { pointer-events: all; }
.upload-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-zone p {
  font-size: 0.95rem; color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.upload-link {
  color: var(--accent); cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.upload-hint {
  font-size: 0.75rem; color: #4a6a4a;
  letter-spacing: 0.03em;
}

/* ── Upload progress ── */
.upload-progress {
  margin-bottom: 2rem;
}
.progress-bar {
  height: 4px;
  background: rgba(120, 180, 80, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}
.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Gallery grid ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.video-gallery {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.gallery-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.gallery-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.gallery-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.gallery-item img {
  width: 100%; height: 110px;
  object-fit: cover;
  display: block;
}
.gallery-item video {
  width: 100%; height: auto;
  display: block;
  max-height: 160px;
}
.gallery-item-actions {
  display: flex; justify-content: flex-end;
  padding: 0.35rem 0.5rem;
  gap: 0.5rem;
}
.dl-btn {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  background: none; border: none;
  cursor: pointer; padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
  text-decoration: none;
}
.dl-btn:hover { background: rgba(120, 180, 80, 0.1); }

/* ── Empty state ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { font-size: 0.95rem; }

/* ── Tweet submission ── */
.tweet-submit {
  margin-bottom: 2rem;
}
.tweet-input-wrap {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
  margin-bottom: 0.5rem;
}
.tweet-input-wrap:focus-within {
  border-color: rgba(90, 154, 48, 0.4);
  box-shadow: 0 0 20px rgba(60, 120, 40, 0.08);
}
.tweet-input {
  flex: 1;
  padding: 0.9rem 1.2rem;
  background: rgba(8, 20, 8, 0.9);
  border: none;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  outline: none;
}
.tweet-input::placeholder { color: #3d5e3d; }
.tweet-submit-btn {
  padding: 0.9rem 1.8rem;
  background: var(--primary);
  color: white; border: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s;
}
.tweet-submit-btn:hover { background: var(--primary-dark); }
.tweet-submit-btn:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.tweet-hint {
  font-size: 0.75rem; color: #4a6a4a;
  letter-spacing: 0.03em;
}

/* ── Tweet embeds container — compact grid ── */
.tweets-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.tweet-embed-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.25rem;
  overflow: hidden;
}
/* Fit Twitter embeds snugly in their cards */
.tweet-embed-wrap twitter-widget,
.tweet-embed-wrap .twitter-tweet-rendered,
.tweet-embed-wrap iframe {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}
/* Delete button */
.tweet-delete-btn {
  position: absolute; top: 6px; right: 6px; z-index: 5;
  width: 24px; height: 24px;
  background: rgba(192, 57, 43, 0.7);
  border: none; border-radius: 50%;
  color: white; font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.tweet-embed-wrap:hover .tweet-delete-btn { opacity: 1; }
.tweet-delete-btn:hover { background: rgba(231, 76, 60, 0.9); }

/* ── Toast / notification ── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text);
  backdrop-filter: blur(10px);
  z-index: 100;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.error { border-color: rgba(192, 57, 43, 0.4); color: #e74c3c; }
.toast.success { border-color: rgba(90, 154, 48, 0.4); color: var(--accent); }

/* ── Media delete button (photos & videos) ── */
.media-delete-btn {
  position: absolute; top: 6px; right: 6px; z-index: 5;
  width: 26px; height: 26px;
  background: rgba(192, 57, 43, 0.7);
  border: none; border-radius: 50%;
  color: white; font-size: 15px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.gallery-item:hover .media-delete-btn { opacity: 1; }
.media-delete-btn:hover { background: rgba(231, 76, 60, 0.9); }

/* ── Article cards ── */
.articles-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.article-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.article-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.article-link {
  flex: 1;
  text-decoration: none;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}
.article-link:hover { color: var(--text); }
.article-domain {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.article-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}
.article-delete-btn {
  width: 26px; height: 26px;
  background: rgba(192, 57, 43, 0.5);
  border: none; border-radius: 50%;
  color: white; font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
  flex-shrink: 0;
}
.article-card:hover .article-delete-btn { opacity: 1; }
.article-delete-btn:hover { background: rgba(231, 76, 60, 0.9); }

/* ── Staging page ── */
.staging-desc {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}
.staging-desc strong { color: var(--accent); font-weight: 600; }

.staging-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.staging-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.staging-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.staging-card-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.staging-card-info {
  flex: 1;
  min-width: 0;
}
.staging-card-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.25rem;
}
.staging-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.staging-card-sep { opacity: 0.4; }
.staging-card-expires { color: var(--accent); }
.staging-card-expires.expiring-soon { color: #e67e22; }

.staging-card-actions {
  flex-shrink: 0;
}
.staging-dl-btn {
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
}
.staging-dl-btn:hover {
  background: rgba(120, 180, 80, 0.1);
  border-color: var(--border-hover);
}

.staging-delete-btn {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px;
  background: rgba(192, 57, 43, 0.5);
  border: none; border-radius: 50%;
  color: white; font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.staging-card:hover .staging-delete-btn { opacity: 1; }
.staging-delete-btn:hover { background: rgba(231, 76, 60, 0.9); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .page { padding: 1.5rem 1.25rem 2rem; }
  .hub-cards { flex-direction: column; gap: 1.25rem; }
  .hub-card { padding: 2rem 1.5rem; }
  .hub-title { font-size: 2rem; }
  .project-header { margin-bottom: 1.5rem; }
  .project-title { font-size: 1.5rem; }
  .tab { padding: 0.8rem 1rem; font-size: 0.85rem; }
  .upload-zone { padding: 2rem 1.5rem; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; }
  .gallery-item img { height: 90px; }
  .tweet-input-wrap { flex-direction: column; }
  .tweet-submit-btn { border-radius: 0 0 7px 7px; }
}
