/* =========================
   THEME VARIABLES
   ========================= */
:root {
  --bg-gradient-from: #ebf4ff;
  --bg-gradient-to: #e0e7ff;
  --text: #111827;
  --card-bg: #ffffff;
  --shadow: rgba(15, 23, 42, 0.08);

  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --title: #312e81;
  --subtitle: #4f46e5;

  --border-soft: #e5e7eb;
  --border-drop: #cbd5f5;
  --drop-bg: #f9fafb;
  --drop-bg-active: #eef2ff;

  --muted: #6b7280;
  --hint: #6b7280;

  --found-bg: #f9fafb;
  --found-border: #d1fae5;

  --footer-text: #6b7280;
  --link: #4f46e5;

  --pin-bg: #eef2ff;
  --pin-label: #4f46e5;
  --pin-code: #312e81;

  --btn-bg: #e5e7eb;
  --btn-text: #111827;
  --ghost-text: #6b7280;
}

body.dark {
  --bg-gradient-from: #020617;
  --bg-gradient-to: #020617;
  --text: #e5e7eb;
  --card-bg: #020617;
  --shadow: rgba(15, 23, 42, 0.7);

  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --title: #e5e7eb;
  --subtitle: #a5b4fc;

  --border-soft: #1f2937;
  --border-drop: #334155;
  --drop-bg: #020617;
  --drop-bg-active: #020617;

  --muted: #9ca3af;
  --hint: #9ca3af;

  --found-bg: #020617;
  --found-border: #065f46;

  --footer-text: #6b7280;
  --link: #60a5fa;

  --pin-bg: #020617;
  --pin-label: #a5b4fc;
  --pin-code: #e5e7eb;

  --btn-bg: #111827;
  --btn-text: #e5e7eb;
  --ghost-text: #9ca3af;
}

/* =========================
   GLOBAL
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-from), var(--bg-gradient-to));
  color: var(--text);
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

/* =========================
   HEADER
   ========================= */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.title {
  margin: 0;
  font-size: 24px;
  color: var(--title);
}

.subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--subtitle);
}

/* =========================
   LAYOUT
   ========================= */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 800px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================
   CARDS
   ========================= */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px var(--shadow);
}

.card-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.card-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

/* =========================
   DROP ZONE
   ========================= */
.drop-zone {
  border: 2px dashed var(--border-drop);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s ease;
  background: var(--drop-bg);
}

.drop-zone.drag {
  border-color: var(--primary);
  background: var(--drop-bg-active);
}

.drop-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.highlight {
  color: var(--primary);
  font-weight: 600;
}

.hint {
  font-size: 11px;
  color: var(--hint);
}

/* =========================
   FILE LIST
   ========================= */
.file-list {
  margin-top: 10px;
  max-height: 180px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--card-bg);
}

.file-list.small {
  max-height: 140px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}

.file-row:last-child {
  border-bottom: none;
}

.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.file-size {
  font-size: 11px;
  color: var(--muted);
}

/* =========================
   BUTTONS
   ========================= */
.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:active {
  background: var(--primary-dark);
}

.btn.full {
  width: 100%;
  margin-top: 12px;
}

.btn.ghost {
  background: transparent;
  color: var(--ghost-text);
}

.btn.small {
  padding: 4px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* =========================
   PIN DISPLAY
   ========================= */
.pin-box {
  margin-top: 16px;
  padding: 12px;
  background: var(--pin-bg);
  border-radius: 12px;
  text-align: center;
}

.pin-label {
  font-size: 12px;
  color: var(--pin-label);
}

.pin-code {
  font-size: 26px;
  letter-spacing: 0.3em;
  margin: 6px 0;
  font-weight: 700;
  color: var(--pin-code);
}

/* =========================
   INPUTS
   ========================= */
.input-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 6px;
}

.code-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 8px 10px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.4em;
  background: var(--card-bg);
  color: var(--text);
}

.error {
  margin-top: 4px;
  font-size: 12px;
  color: #f97373; /* error stays red-ish for both themes */
}

.hidden {
  display: none;
}

/* =========================
   FOUND BOX
   ========================= */
.found-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--found-bg);
  border: 1px solid var(--found-border);
}

.found-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}

/* =========================
   INFO TEXT
   ========================= */
.info {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text);
}

.info h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.info ol {
  padding-left: 18px;
  margin: 0 0 6px;
}

.note {
  font-size: 11px;
  color: var(--muted);
}

/* =========================
   FOOTER
   ========================= */
.footer {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--footer-text);
}

.footer a {
  color: var(--link);
  text-decoration: none;
}

/* =========================
   FOLLOW ME SECTION
   ========================= */
.follow-me {
  margin-top: 30px;
  text-align: center;
}

.follow-me h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--title);
}

.follow-icons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.follow-item {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--link);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 3px 12px var(--shadow);
  transition: 0.2s ease;
}

.follow-item:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.icon {
  font-size: 18px;
}
