/* =====================================================================
   File: /uploader/style.css
   Purpose: Global dark-theme styles for Secure File Uploader
   – 100 % offline, no external resources
   – Material-you inspired, mobile-first
   – Accent blue (#2196F3) with darker hover (#1976D2)
===================================================================== */

/* ---------- COLOR SYSTEM ------------------------------------------ */
:root {
  /* Surfaces */
  --bg:        #121212;   /* page background                  */
  --card:      #1a1a1a;   /* cards / containers               */

  /* Text & icons */
  --text:      #e0e0e0;   /* primary text on dark bg          */

  /* Accent (primary) */
  --accent:    #2196F3;   /* blue-500                         */
  --accent2:   #1976D2;   /* blue-700 for hover/pressed       */

  /* Feedback */
  --error:     #e53935;   /* red-600 for errors               */
  --toast-bg:  rgba(30,30,30,.95);
  --toast-text:#fff;

  /* Shape & shadow */
  --radius:    12px;      /* universal border-radius          */
  --shadow:    0 4px 12px rgba(0,0,0,.6);
}

/* ---------- RESET ------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }

/* ---------- BASE LAYOUT ------------------------------------------ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}

/* ---------- CARD -------------------------------------------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 540px;
  margin: 16px auto;
  padding: 24px;
  position: relative;
}
@media (max-width: 600px) {
  .card { margin: 8px; padding: 16px; }
}

h3 { font-size: 1.5rem; margin-bottom: 16px; }

/* ---------- LINKS ------------------------------------------------- */
a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
a:hover { color: var(--accent2); }

/* ---------- FORM FIELDS ------------------------------------------ */
.field { margin-bottom: 16px; }

.field input[type="text"],
.field input[type="password"],
.field input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
}

/* ---------- DROP ZONE -------------------------------------------- */
#dropZone {
  border: 2px dashed var(--accent2);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  font-size: 1rem;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}
#dropZone.dragover {
  background: rgba(33,150,243,.25);   /* subtle blue overlay       */
  border-color: var(--accent);
}

/* custom file input label */
.custom-file-label {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: center;
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
}
#fileInfo { margin-top: 8px; font-size: 0.9rem; opacity: 0.9; }

/* hide native input */
input[type="file"] { display: none; }

/* ---------- TOGGLE SWITCH ---------------------------------------- */
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.switch {
  position: relative;
  width: 48px;
  height: 28px;
}
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: #555;
  border-radius: 28px;
  transition: 0.4s;
}
.slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: #ccc;
  border-radius: 50%;
  transition: 0.4s;
}
.switch input:checked + .slider {
  background: var(--accent);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* ---------- BUTTON + RIPPLE ------------------------------------- */
.button {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #000;
  font: 600 1rem inherit;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 8px;
}
.button:hover { background: var(--accent2); }

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(0,0,0,.25);
  animation: ripple 600ms linear;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- PROGRESS BAR ---------------------------------------- */
.progress-bar {
  display: none;                 /* visible only during upload */
  margin-top: 16px;
  height: 24px;
  background: #2a2a2a;
  border-radius: var(--radius);
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
  text-align: center;
  color: #000;
  line-height: 24px;
  font-size: 0.9rem;
  transition: width 0.2s;
}

/* ---------- SPINNER OVERLAY ------------------------------------- */
#spinnerOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: none;                 /* flex when active           */
  justify-content: center;
  align-items: center;
  border-radius: var(--radius);
}
.spinner {
  border: 4px solid #444;
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- RESULT PANEL ---------------------------------------- */
#uploadResult {
  display: none;
  border-left: 4px solid var(--accent);
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  margin: 24px 0 32px;
  animation: fadeIn 300ms ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

#uploadResult h3 { font-size: 1.25rem; margin-bottom: 12px; }
#uploadResult p  { margin: 8px 0; font-size: 1rem; line-height: 1.4; }

/* copy-link icon */
.copy-btn {
  margin-left: 8px;
  cursor: pointer;
  vertical-align: middle;
  fill: var(--accent);
  width: 20px;
  height: 20px;
  transition: fill 0.2s;
}
.copy-btn:hover { fill: var(--accent2); }

/* ---------- TOAST MESSAGE --------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
}
.toast.show { opacity: 1; }

/* ---------- ADMIN LIST ----------------------------------------- */
/* (admin.php already dark; minor tweaks left untouched)           */
.file-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #2a2a2a;
}
.file-row:last-child { border: none; }

.file-row .file-info {
  flex: 1;
  overflow: hidden;
}
.file-row .file-info b {
  font-size: 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.file-row .file-info small {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: #a7a7a7;
}

.icon-btn {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(33,150,243,.25); }

.icon-btn svg { width: 20px; height: 20px; fill: var(--text); }
