/* =============================================
   Private-Drop — Design System
   ============================================= */

:root {
  --bg:         #0f1117;
  --bg-card:    #1a1d27;
  --bg-input:   #232636;
  --border:     #2e3348;
  --accent:     #6c63ff;
  --accent-hov: #5a52e8;
  --green:      #22c55e;
  --yellow:     #f59e0b;
  --red:        #ef4444;
  --text:       #e2e8f0;
  --text-muted: #64748b;
  --radius:     10px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
}

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

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* ============ NAVBAR ============ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand { display: flex; align-items: center; gap: .5rem; }
.brand-icon { font-size: 1.4rem; }
.brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; color: var(--accent); }

.navbar-links { display: flex; align-items: center; gap: 1rem; }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: .9rem; transition: color .2s; }
.nav-link:hover { color: var(--text); }
.logout-form { margin: 0; }

/* ============ MAIN ============ */
.main-content { flex: 1; padding: 2rem 1rem; }
.container { max-width: 1100px; margin: 0 auto; }
.container-sm { max-width: 680px; margin: 0 auto; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ============ CARD ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-header h2 { font-size: 1rem; font-weight: 600; }

/* ============ STORAGE BAR ============ */
.storage-card { }

.storage-bar-wrapper {
  width: 100%;
  height: 14px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: .6rem;
}
.storage-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .5s ease;
}
.bar-ok      { background: linear-gradient(90deg, #22c55e, #16a34a); }
.bar-warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bar-danger  { background: linear-gradient(90deg, #ef4444, #b91c1c); }

.storage-info { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-muted); }
.storage-badge {
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}
.badge-ok      { background: rgba(34,197,94,.15); color: var(--green); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-danger  { background: rgba(239,68,68,.15); color: var(--red); }

/* ============ QUOTA MINI (upload page) ============ */
.quota-mini { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.quota-mini-bar { flex: 1; height: 8px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.quota-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.quota-mini-text { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

/* ============ TABLE ============ */
.table-wrapper { overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.file-table th {
  text-align: left;
  padding: .6rem .75rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.file-table td {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.file-table tr:last-child td { border-bottom: none; }
.file-table tr:hover td { background: rgba(255,255,255,.02); }
.row-expired td { opacity: .55; }

.filename-cell { display: flex; align-items: center; gap: .4rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { flex-shrink: 0; }
.code-badge {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .1rem .4rem;
  font-family: monospace;
  font-size: .8rem;
}
.badge-expired { background: rgba(239,68,68,.15); color: var(--red); border-radius: 999px; font-size: .7rem; padding: .1rem .4rem; }
.link-copy { color: var(--accent); cursor: pointer; text-decoration: none; font-size: .85rem; }
.link-copy:hover { text-decoration: underline; }
.text-danger { color: var(--red); }
.text-muted { color: var(--text-muted); }

.empty-state { text-align: center; padding: 2.5rem; color: var(--text-muted); }
.empty-state p { margin-bottom: 1rem; }

/* ============ QUICK ACTIONS ============ */
.quick-actions { margin-bottom: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; margin-bottom: .4rem; font-size: .875rem; font-weight: 500; color: var(--text-muted); }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: .6rem .9rem;
  font-size: .95rem;
  transition: border-color .2s;
  outline: none;
}
.form-control:focus { border-color: var(--accent); }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; display: block; }
.required { color: var(--red); }

/* File drop zone */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .2s, background .2s;
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(108,99,255,.06);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-zone-content { pointer-events: none; }
.drop-icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.drop-zone-content p { color: var(--text-muted); font-size: .9rem; }
.selected-file-name { color: var(--green); font-weight: 600; margin-top: .5rem; }

/* Progress */
.progress-wrapper { margin-bottom: 1rem; }
.progress-bar-outer {
  width: 100%;
  height: 12px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: .4rem;
}
.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-info { display: flex; gap: 1rem; font-size: .8rem; color: var(--text-muted); }

/* Share URL box */
.share-url-box { display: flex; gap: .5rem; margin-top: .75rem; }
.share-url-box .form-control { flex: 1; font-size: .85rem; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .2s, opacity .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover  { background: var(--accent-hov); }

.btn-outline  { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn-outline-sm { background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: .3rem .75rem; font-size: .8rem; }
.btn-outline-sm:hover { border-color: var(--text-muted); color: var(--text); }

.btn-warning  { background: rgba(245,158,11,.15); color: var(--yellow); border: 1px solid rgba(245,158,11,.3); }
.btn-warning:hover  { background: rgba(245,158,11,.25); }

.btn-danger-sm {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239,68,68,.35);
  padding: .25rem .65rem;
  font-size: .8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background .2s;
}
.btn-danger-sm:hover { background: rgba(239,68,68,.12); }

.btn-full { width: 100%; }

/* ============ AUTH / CENTERED CARD ============ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.download-card { max-width: 480px; }
.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-icon { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.auth-header h1 { font-size: 1.4rem; font-weight: 700; }
.auth-subtitle { color: var(--text-muted); font-size: .9rem; margin-top: .3rem; }
.auth-form { display: flex; flex-direction: column; gap: .5rem; }

/* File meta (download page) */
.file-meta { background: var(--bg-input); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.file-meta-row { display: flex; justify-content: space-between; font-size: .875rem; }
.meta-label { color: var(--text-muted); }
.meta-value { font-weight: 500; }
.filename-display { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.download-hint { text-align: center; font-size: .78rem; color: var(--text-muted); margin-top: 1rem; }

/* ============ ALERTS ============ */
.alert {
  padding: .85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .875rem;
  line-height: 1.5;
}
.alert p { margin-top: .3rem; }
.alert strong { display: block; margin-bottom: .2rem; }
.alert-error   { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; }

/* ============ FOOTER ============ */
.footer {
  text-align: center;
  padding: 1.25rem;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .file-table { font-size: .78rem; }
  .filename-cell { max-width: 140px; }
  .auth-card { padding: 1.75rem 1.25rem; }
}
