/* ============================================================
   ProTab – Options Page Styles
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #6366f1;
  --primary-h: #4f46e5;
  --accent:    #06b6d4;
  --success:   #10b981;
  --danger:    #ef4444;
  --bg:        #0c0c1e;
  --surface:   #14142a;
  --surface2:  #1e1e38;
  --surface3:  #252545;
  --border:    rgba(99,102,241,.2);
  --txt:       #e2e8f0;
  --txt-m:     #94a3b8;
  --txt-d:     #475569;
  --radius:    12px;
  --t:         .2s ease;
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-icon { font-size: 22px; }
.brand-name {
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-list {
  list-style: none;
  padding: 12px 10px;
  flex: 1;
}
.nav-list li { margin-bottom: 2px; }

.nav-link {
  display: block;
  border-radius: 10px;
  color: var(--txt-m);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  text-decoration: none;
  transition: all var(--t);
}
.nav-link:hover  { background: var(--surface2); color: var(--txt); }
.nav-link.active { background: rgba(99,102,241,.15); color: var(--primary); }

.sidebar-footer {
  padding: 16px 20px;
  font-size: 11px;
  color: var(--txt-d);
  border-top: 1px solid var(--border);
}

/* ── Content ── */
.content {
  flex: 1;
  padding: 32px 40px;
  max-width: 800px;
  overflow-y: auto;
}

/* ── Sections ── */
.settings-section { display: none; }
.settings-section.active { display: block; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--txt);
  letter-spacing: -.4px;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--txt-m);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
}

.danger-card { border-color: rgba(239,68,68,.3); }
.danger-card .card-title.danger { color: var(--danger); }

/* ── Form elements ── */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-m);
  margin-bottom: 6px;
}

.hint { color: var(--txt-d); font-weight: 400; }

.form-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--t);
  width: 100%;
}
.form-input.small { width: auto; min-width: 80px; }
.form-input::placeholder { color: var(--txt-d); }
.form-input:focus { border-color: var(--primary); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  font-size: 13px;
  font-family: 'Courier New', monospace;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  width: 100%;
  transition: border-color var(--t);
}
.form-textarea:focus { border-color: var(--primary); }

/* ── Toggle / Checkbox ── */
.toggle-list { display: flex; flex-direction: column; gap: 4px; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
  font-size: 13px;
  color: var(--txt-m);
  user-select: none;
  gap: 10px;
}
.toggle-row:hover { background: var(--surface2); }
.toggle-row.big { padding: 14px 12px; font-size: 14px; font-weight: 600; }

.toggle-cb { display: none; }

.toggle-slider {
  width: 42px;
  height: 24px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-shrink: 0;
  position: relative;
  transition: background var(--t);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--txt-d);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all var(--t);
}

.toggle-cb:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle-cb:checked + .toggle-slider::after {
  transform: translateX(18px);
  background: #fff;
}

/* ── Wallpaper Grid ── */
.wallpaper-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wp-swatch {
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  height: 60px;
  width: 100px;
  position: relative;
  overflow: hidden;
  transition: all var(--t);
}
.wp-swatch span {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,.8);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.wp-swatch:hover  { transform: scale(1.04); }
.wp-swatch.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.3); }

/* ── Hint text ── */
.hint-text {
  color: var(--txt-d);
  font-size: 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.hint-text code {
  background: var(--surface3);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  color: var(--accent);
}

/* ── Quick Links ── */
.ql-list { margin-bottom: 14px; }

.ql-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--surface2);
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
}
.ql-item:last-child { margin-bottom: 0; }

.ql-icon-disp { font-size: 18px; flex-shrink: 0; }
.ql-info { flex: 1; overflow: hidden; }
.ql-title { font-size: 13px; font-weight: 600; }
.ql-url   { font-size: 11px; color: var(--txt-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ql-del-btn {
  background: none;
  border: none;
  color: var(--txt-d);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 5px;
  border-radius: 5px;
  transition: all var(--t);
}
.ql-del-btn:hover { background: var(--danger); color: #fff; }

.add-ql-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.add-ql-row .form-input { flex: 1; min-width: 100px; }
.add-ql-row .form-input.small { flex: 0 0 60px; }

.add-btn {
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  transition: opacity var(--t);
  white-space: nowrap;
}
.add-btn:hover { opacity: .85; }

/* ── Buttons ── */
.save-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 28px;
  transition: opacity var(--t), transform var(--t);
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.save-btn:hover { opacity: .9; transform: translateY(-1px); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.secondary-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt-m);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  transition: all var(--t);
}
.secondary-btn:hover { border-color: var(--primary); color: var(--primary); }

.danger-btn {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 8px;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  transition: all var(--t);
}
.danger-btn:hover { background: rgba(239,68,68,.2); }

/* ── About ── */
.about-card { text-align: center; padding: 32px 24px; }
.about-logo  { font-size: 48px; margin-bottom: 8px; }
.about-name  { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.about-version { color: var(--txt-d); font-size: 13px; margin-bottom: 16px; }
.about-desc {
  color: var(--txt-m);
  line-height: 1.7;
  max-width: 500px;
  margin: 0 auto 20px;
}

.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 500px;
  margin: 0 auto 20px;
  text-align: left;
}
.feature-item {
  background: var(--surface2);
  border-radius: 8px;
  font-size: 12px;
  padding: 8px 12px;
  color: var(--txt-m);
}

.about-links { display: flex; gap: 8px; justify-content: center; align-items: center; }
.about-link { color: var(--primary); font-size: 13px; text-decoration: none; }
.about-link:hover { text-decoration: underline; }
.sep { color: var(--txt-d); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  animation: fadein .2s ease;
}
.toast.hidden { display: none; }

@keyframes fadein {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
