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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0e0e10;
  color: #efeff1;
  min-height: 100vh;
}

a {
  color: #bf94ff;
}

/* ── Auth page ── */

.auth-container {
  max-width: 400px;
  margin: 80px auto;
  padding: 0 20px;
}

.auth-container h1 {
  text-align: center;
  margin-bottom: 24px;
  color: #bf94ff;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: #1f1f23;
  border: none;
  color: #adadb8;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab-btn:first-child {
  border-radius: 8px 0 0 8px;
}

.tab-btn:last-child {
  border-radius: 0 8px 8px 0;
}

.tab-btn.active {
  background: #bf94ff;
  color: #0e0e10;
  font-weight: 600;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-form.active {
  display: flex;
}

input[type="text"],
input[type="password"],
input[type="url"] {
  width: 100%;
  padding: 12px 14px;
  background: #1f1f23;
  border: 1px solid #303036;
  border-radius: 6px;
  color: #efeff1;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #bf94ff;
}

.btn {
  padding: 12px 20px;
  background: #bf94ff;
  color: #0e0e10;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #d4b4ff;
}

.btn-danger {
  background: #eb0400;
  color: #fff;
}

.btn-danger:hover {
  background: #ff3333;
}

.btn-secondary {
  background: #303036;
  color: #efeff1;
}

.btn-secondary:hover {
  background: #404048;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.error-msg {
  color: #eb0400;
  font-size: 13px;
  min-height: 20px;
}

/* ── Dashboard ── */

.dashboard {
  max-width: 700px;
  margin: 0 auto;
  padding: 30px 20px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.dashboard-header h1 {
  color: #bf94ff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #adadb8;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.btn-icon:hover {
  background: #303036;
  color: #efeff1;
}

.section {
  background: #1f1f23;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.section h2 {
  font-size: 16px;
  margin-bottom: 14px;
  color: #adadb8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.add-clip-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.add-clip-row input {
  flex: 1;
}

.clip-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.clip-list::-webkit-scrollbar {
  width: 6px;
}

.clip-list::-webkit-scrollbar-track {
  background: transparent;
}

.clip-list::-webkit-scrollbar-thumb {
  background: #404048;
  border-radius: 3px;
}

.clip-list::-webkit-scrollbar-thumb:hover {
  background: #bf94ff;
}

.clip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #303036;
  border-radius: 6px;
  cursor: grab;
  transition: background 0.15s;
}

.clip-item:active {
  cursor: grabbing;
}

.clip-item.dragging {
  opacity: 0.5;
  background: #404048;
}

.clip-item .drag-handle {
  color: #adadb8;
  font-size: 16px;
  user-select: none;
}

.clip-item .clip-info {
  flex: 1;
  overflow: hidden;
}

.clip-item .clip-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-item .clip-url {
  font-size: 12px;
  color: #adadb8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-item .btn-open {
  color: #adadb8;
  font-size: 16px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.clip-item .btn-open:hover {
  color: #4fc3f7;
  background: rgba(79, 195, 247, 0.15);
}

.clip-item .btn-delete {
  background: none;
  border: none;
  color: #adadb8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.clip-item .btn-delete:hover {
  color: #eb0400;
  background: rgba(235, 4, 0, 0.15);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-label {
  font-size: 14px;
  color: #efeff1;
}

.order-toggle {
  display: flex;
  background: #303036;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.order-btn {
  padding: 7px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #adadb8;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}

.order-btn:hover:not(.active) {
  background: #404048;
  color: #efeff1;
}

.order-btn.active {
  background: #bf94ff;
  color: #0e0e10;
  font-weight: 600;
}

.obs-url-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #303036;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  word-break: break-all;
  font-size: 13px;
  font-family: monospace;
  color: #bf94ff;
}

.obs-actions {
  display: flex;
  gap: 10px;
}

.import-export-row {
  display: flex;
  align-items: center;
  margin-top: 14px;
}

.row-left {
  display: flex;
  gap: 10px;
}


/* ── Section header with inline icon ── */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header h2 {
  margin-bottom: 0;
}

/* ── Settings modal ── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#confirm-overlay {
  z-index: 1100;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #1f1f23;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0;
}

.modal-title {
  font-size: 16px;
  color: #adadb8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-close {
  background: none;
  border: none;
  color: #adadb8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.18s, color 0.18s;
}

.modal-close:hover {
  background: #303036;
  color: #efeff1;
}

.modal-body {
  padding: 20px;
}

.danger-zone {
  border: 1px solid rgba(235, 4, 0, 0.25);
  border-radius: 8px;
  padding: 16px;
}

.danger-zone-title {
  font-size: 12px;
  font-weight: 600;
  color: #eb0400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.danger-zone-desc {
  font-size: 13px;
  color: #adadb8;
  margin-bottom: 14px;
}

.danger-zone-action {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-ghost-danger {
  align-self: flex-start;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(235, 4, 0, 0.4);
  border-radius: 6px;
  color: #eb0400;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.btn-ghost-danger:hover {
  background: rgba(235, 4, 0, 0.1);
  border-color: #eb0400;
}

.clear-confirm {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.clear-confirm-text {
  font-size: 13px;
  color: #efeff1;
}

.clear-confirm-btns {
  display: flex;
  gap: 8px;
}

.confirm-modal {
  max-width: 360px;
}

.confirm-message {
  font-size: 14px;
  color: #efeff1;
  margin-bottom: 16px;
  line-height: 1.5;
}

.confirm-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Sync modal ── */

.sync-modal {
  max-width: 480px;
}

.sync-backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sync-backup-label {
  font-size: 14px;
  color: #efeff1;
  margin-bottom: 2px;
}

.sync-backup-desc {
  font-size: 12px;
  color: #adadb8;
}

.sync-divider {
  height: 1px;
  background: #303036;
  margin: 16px 0;
}

.sync-list-label {
  font-size: 12px;
  font-weight: 600;
  color: #adadb8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.backup-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.backup-list::-webkit-scrollbar { width: 6px; }
.backup-list::-webkit-scrollbar-track { background: transparent; }
.backup-list::-webkit-scrollbar-thumb { background: #404048; border-radius: 3px; }
.backup-list::-webkit-scrollbar-thumb:hover { background: #bf94ff; }

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #303036;
  border-radius: 6px;
}

.backup-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.backup-date {
  font-size: 13px;
  color: #efeff1;
  white-space: nowrap;
}

.backup-clips {
  font-size: 12px;
  color: #adadb8;
  white-space: nowrap;
}

.backup-empty {
  font-size: 13px;
  color: #adadb8;
  padding: 12px 0;
  text-align: center;
}

.empty-msg {
  color: #adadb8;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}
