/* ═══════════════════════════════════════════════════════════
   AAIBA DROP — Stylesheet
   Theme: Dark Editorial / Brutalist-Luxury
   Fonts: Bebas Neue (display) + DM Mono (body/UI)
═══════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:        #0a0a0a;
  --surface:   #111111;
  --surface-2: #181818;
  --border:    #2a2a2a;
  --border-2:  #333333;
  --text:      #f0ede8;
  --text-dim:  #666666;
  --text-mute: #3a3a3a;
  --accent:    #f5c400;
  --accent-2:  #e8b800;
  --danger:    #e8412a;
  --success:   #3ddc84;
  --radius:    4px;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--text); font-family: var(--font-mono); min-height: 100vh; }

/* ── Scanline overlay ─────────────────────────────────────── */
.scanline {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.04) 2px,
    rgba(0,0,0,0.04) 4px
  );
}

/* ════════════════════ LOGIN PAGE ════════════════════════════ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(245,196,0,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 80% 80%, rgba(245,196,0,0.02) 0%, transparent 70%),
    var(--bg);
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.login-shell {
  position: relative; z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-brand {
  display: flex; align-items: center; gap: 0.75rem;
  letter-spacing: 0.1em;
}

.brand-mark {
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  color: var(--text);
}

.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.login-card__header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.login-card__header h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--text);
}

.login-card__header p {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 500;
}

.field input {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  caret-color: var(--accent);
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,196,0,0.12);
}

.field input::placeholder { color: var(--text-mute); }

/* ── Primary button ───────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 0.5rem;
}

.btn-primary:hover:not(:disabled) { background: var(--accent-2); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

.error-msg {
  font-size: 0.75rem;
  color: var(--danger);
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.3s;
  min-height: 1.2em;
}

.login-footer {
  font-size: 0.6rem;
  color: var(--text-mute);
  letter-spacing: 0.15em;
}

/* ════════════════════ DASHBOARD PAGE ════════════════════════ */

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__left,
.site-header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.item-count {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.btn-logout {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-logout:hover {
  background: var(--danger);
  color: #fff;
}

/* ── Main layout ──────────────────────────────────────────── */
.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ── Composer ─────────────────────────────────────────────── */
.composer {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}

.composer__tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  padding: 0.8rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.tab:last-child { border-right: none; }
.tab:hover { color: var(--text); background: var(--surface-2); }

.tab.active {
  color: var(--accent);
  background: var(--surface-2);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}

.composer__panel { display: none; padding: 1.5rem; }
.composer__panel.active { display: flex; flex-direction: column; gap: 1rem; }

#text-input {
  width: 100%;
  min-height: 140px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 1rem;
  resize: vertical;
  outline: none;
  caret-color: var(--accent);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,196,0,0.10);
}

#text-input::placeholder { color: var(--text-mute); font-size: 0.82rem; }

.composer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.char-count {
  font-size: 0.65rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}

.composer__actions .btn-primary {
  padding: 0.55rem 1.4rem;
  font-size: 0.95rem;
  margin-top: 0;
}

/* ── Drop zone ────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(245,196,0,0.04);
}

#file-input { display: none; }

.drop-zone__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
  display: block;
}

.drop-zone__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.drop-zone__sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-family: var(--font-mono);
  font-size: 0.75rem; text-decoration: underline;
}

.upload-progress {
  margin-top: 1.25rem;
}

.upload-progress__bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.upload-progress__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.upload-progress span {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.hidden { display: none !important; }

/* ── Feed ─────────────────────────────────────────────────── */
.feed-section {}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.feed-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.1em;
  color: var(--text);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-dim);
  border-radius: var(--radius);
  width: 32px; height: 32px;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.btn-icon:hover { color: var(--text); border-color: var(--text-dim); }
.btn-icon.spinning { animation: spin 0.6s linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.feed { display: flex; flex-direction: column; gap: 0; }

.feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  color: var(--text-mute);
}

.feed-empty__icon {
  font-size: 2rem;
  animation: breathe 3s ease infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.7; }
}

.feed-empty p {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* ── Item card ────────────────────────────────────────────── */
.item-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  animation: slideIn 0.25s ease both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.item-card:last-child { border-bottom: none; }

.item-card__type {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--text-dim);
}

.item-card__type.file-type { color: var(--accent); }

.item-card__body { flex: 1; min-width: 0; }

.item-card__meta {
  font-size: 0.62rem;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.item-card__text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.item-card__text.long-text {
  max-height: 5.5rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.expand-btn {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-family: var(--font-mono);
  font-size: 0.65rem; letter-spacing: 0.08em;
  margin-top: 0.3rem; padding: 0;
  display: block;
}

.copy-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: color 0.15s, border-color 0.15s;
  display: inline-block;
}

.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}

.download-link:hover { opacity: 0.75; }
.download-link .file-size { color: var(--text-mute); font-size: 0.68rem; }

.item-card__actions { display: flex; align-items: flex-start; }

.delete-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.delete-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(232,65,42,0.08);
}

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error { border-left-color: var(--danger); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header { padding: 0 1rem; }
  .main { padding: 1.5rem 1rem 3rem; }
  .login-card { padding: 1.75rem; }
  .login-card__header h1 { font-size: 2.8rem; }
  .drop-zone { padding: 2rem 1rem; }
}
