/* style.css – SecureTransfer UI */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Sora:wght@400;500;600;700&display=swap');

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

:root {
  --bg:        #040d1a;
  --surface:   #0c1a2e;
  --border:    #1a3050;
  --accent:    #38bdf8;
  --accent2:   #818cf8;
  --danger:    #f43f5e;
  --success:   #22d3a0;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --radius:    12px;
  --font:      'Sora', sans-serif;
  --mono:      'JetBrains Mono', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── AUTH ── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 60% 20%, #0d2540 0%, #040d1a 70%);
}
.auth-card {
  width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0,0,0,.5);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}
.topbar-user {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .8rem;
  font-size: .9rem;
  justify-content: flex-end;
  max-width: 75%;
}
.role-badge {
  background: var(--accent2);
  color: #fff;
  border-radius: 4px;
  font-size: .7rem;
  padding: 2px 7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── NAV LINKS ── */
.nav-link {
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: .3rem .75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(56,189,248,.08);
  border-color: var(--border);
}
.nav-active {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
  background: rgba(56,189,248,.1);
}
.nav-signout {
  color: #fda4af !important;
  border-color: #7f1d1d !important;
  background: #4c0519;
}
.nav-signout:hover {
  background: #7f1d1d !important;
  color: #fff !important;
}

/* ── LAYOUT ── */
.container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
}
.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* ── FORMS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1.1rem;
}
.form-group label {
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
}
input[type="text"],
input[type="password"] {
  background: #0a1628;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: .95rem;
  padding: .65rem 1rem;
  transition: border-color .2s;
}
input:focus { outline: none; border-color: var(--accent); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  border-radius: 8px;
  padding: .55rem 1.1rem;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.btn:hover  { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #040d1a; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-block   { width: 100%; justify-content: center; padding: .75rem; }
.btn-sm      { font-size: .78rem; padding: .35rem .75rem; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
}
.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(56,189,248,.05);
}
.upload-zone svg { color: var(--accent); margin-bottom: .5rem; }
.upload-zone p   { font-size: .95rem; color: var(--text); }
.link-label { color: var(--accent); cursor: pointer; text-decoration: underline; }
.hint        { font-size: .78rem; }
.file-label  { font-size: .82rem; color: var(--accent); font-family: var(--mono); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  text-align: left;
  padding: .6rem 1rem;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid #0d2040; transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.02); }
tbody td { padding: .7rem 1rem; vertical-align: middle; }
.fname   { font-family: var(--mono); font-size: .83rem; color: var(--accent); }
.type-pill {
  display: inline-block;
  background: #0a2040;
  border-radius: 4px;
  font-size: .72rem;
  padding: 2px 7px;
  font-family: var(--mono);
  color: var(--accent2);
}
.actions { display: flex; gap: .5rem; }
.empty-msg { color: var(--muted); font-size: .9rem; text-align: center; padding: 2rem 0; }

/* ── ALERTS ── */
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-error   { background: rgba(244,63,94,.12); border-color: var(--danger); color: var(--danger); }
.alert-success { background: rgba(34,211,160,.12); border-color: var(--success); color: var(--success); }

/* ── BADGE ── */
.badge {
  background: var(--border);
  color: var(--muted);
  border-radius: 20px;
  font-size: .72rem;
  padding: 2px 9px;
}

/* ── Inline code in alerts ── */
.alert code {
  background: rgba(0,0,0,.3);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'Courier New', monospace;
  font-size: .85em;
}

/* ── Upload progress bar ── */
.progress-track {
  width: 100%;
  height: 8px;
  background: #0a1628;
  border-radius: 99px;
  overflow: hidden;
  margin: .8rem 0 .3rem;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width .2s ease;
}
.progress-meta {
  display: flex;
  gap: 1.2rem;
  font-size: .78rem;
  font-family: var(--mono);
  color: var(--muted);
  margin-bottom: .5rem;
}
#progressPct  { color: var(--accent); font-weight: 600; min-width: 2.8rem; }
#progressSpeed{ color: var(--text); }
#progressEta  { color: var(--muted); }

/* ── Disabled upload button state ── */
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* ── New row highlight animation ── */
tbody tr {
  transition: background .6s ease;
}

/* ── Upload zone — updated layout ── */
.upload-zone {
  cursor: pointer;
  user-select: none;
}
.upload-zone.has-file {
  border-color: var(--accent);
  background: rgba(56,189,248,.04);
}
.drop-text { font-size: .95rem; color: var(--text); margin: 0; }

/* ── Upload actions row (Browse + Upload + Clear) ── */
.upload-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .9rem 0 .6rem;
  flex-wrap: wrap;
}
.or-divider {
  color: var(--muted);
  font-size: .82rem;
  padding: 0 .2rem;
}

/* ── Selected file info bar ── */
.file-info-bar {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: #0a1628;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem 1rem;
  margin-bottom: .8rem;
  animation: slideDown .18s ease;
}
@keyframes slideDown {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0);    }
}
.file-type-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.file-info-text {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.file-name-txt {
  font-family: var(--mono);
  font-size: .88rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}
.file-meta-txt {
  font-size: .75rem;
  color: var(--muted);
  font-family: var(--mono);
}
