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

body {
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
}

/* ─── PUBLIC PAGE ─────────────────────────────── */
.page-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.page-card {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.page-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.2);
}

.page-logo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.page-name {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.page-bio {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  text-align: center;
}

.page-links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  width: 100%;
}

.page-link:hover {
  transform: translateY(-2px);
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.page-link:active { transform: scale(0.97); }

/* button styles */
.btn-rounded  { border-radius: 12px; border: none; }
.btn-square   { border-radius: 4px; border: none; }
.btn-pill     { border-radius: 999px; border: none; }
.btn-outline  { border-radius: 12px; background: transparent !important; border: 2px solid; }

.page-admin-link {
  margin-top: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}
.page-admin-link:hover { color: rgba(255,255,255,0.8); }

/* ─── ADMIN PANEL ─────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #0f0f13;
  color: #e8e8f0;
}

.admin-sidebar {
  width: 300px;
  min-width: 300px;
  background: #18181f;
  border-right: 1px solid #2a2a35;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.admin-sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid #2a2a35;
}

.admin-sidebar-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.admin-sidebar-header p {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.admin-sections {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-section-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #999;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.admin-section-btn:hover { background: #22222c; color: #e0e0f0; }
.admin-section-btn.active { background: #6B21A8; color: #fff; }

.admin-section-btn .icon { font-size: 16px; width: 20px; text-align: center; }

.admin-preview-btn {
  margin: 16px;
  padding: 10px;
  border-radius: 8px;
  background: #6B21A8;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background 0.15s;
}

.admin-preview-btn:hover { background: #7c3aed; }

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-topbar {
  padding: 16px 24px;
  border-bottom: 1px solid #2a2a35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #18181f;
}

.admin-topbar h2 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.save-btn {
  padding: 8px 20px;
  border-radius: 8px;
  background: #6B21A8;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.save-btn:hover { background: #7c3aed; }
.save-btn:active { transform: scale(0.97); }

.save-btn.saved {
  background: #15803d;
}

.admin-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ─── FORM ELEMENTS ─────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.field-group label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-group input[type="text"],
.field-group input[type="url"],
.field-group textarea,
.field-group select {
  background: #22222c;
  border: 1px solid #2e2e3d;
  border-radius: 8px;
  color: #e8e8f0;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: #6B21A8;
}

.field-group textarea { resize: vertical; min-height: 72px; }

.field-group select option { background: #22222c; }

.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-row input[type="color"] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  padding: 2px;
}

.color-row span {
  font-size: 13px;
  color: #888;
}

/* ─── BUTTON STYLE PICKER ─────────────────────────── */
.btn-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-style-option {
  padding: 12px;
  border: 2px solid #2e2e3d;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  color: #888;
  background: #22222c;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-style-option:hover { border-color: #6B21A8; color: #e0e0f0; }
.btn-style-option.active { border-color: #6B21A8; background: #2a1540; color: #c084fc; }

.btn-preview {
  width: 80px;
  height: 30px;
  background: #6B21A8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-preview.p-rounded  { border-radius: 8px; }
.btn-preview.p-square   { border-radius: 2px; }
.btn-preview.p-pill     { border-radius: 999px; }
.btn-preview.p-outline  { background: transparent; border: 2px solid #6B21A8; border-radius: 8px; }

/* ─── LINKS LIST ─────────────────────────────── */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item {
  background: #22222c;
  border: 1px solid #2e2e3d;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-item-handle {
  color: #444;
  cursor: grab;
  font-size: 18px;
  user-select: none;
}

.link-item-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.link-row {
  display: flex;
  gap: 8px;
}

.link-emoji-input {
  width: 52px !important;
  text-align: center;
  font-size: 18px !important;
}

.link-delete-btn {
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.link-delete-btn:hover { color: #ef4444; background: #2d1010; }

.add-link-btn {
  width: 100%;
  padding: 12px;
  border: 2px dashed #2e2e3d;
  border-radius: 10px;
  background: transparent;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}

.add-link-btn:hover { border-color: #6B21A8; color: #c084fc; background: #1e1228; }

/* ─── LOGO UPLOAD ─────────────────────────────── */
.logo-upload-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2e2e3d;
  background: #22222c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-preview img { width: 100%; height: 100%; object-fit: cover; }

.logo-upload-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo-upload-btn label {
  padding: 8px 16px;
  background: #22222c;
  border: 1px solid #2e2e3d;
  border-radius: 8px;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
  transition: all 0.15s;
}

.logo-upload-btn label:hover { border-color: #6B21A8; color: #c084fc; }

.logo-remove-btn {
  background: transparent;
  border: none;
  color: #555;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.logo-remove-btn:hover { color: #ef4444; }

#logo-input { display: none; }

/* ─── BACKGROUND TYPE TOGGLE ─────────────────────── */
.toggle-row {
  display: flex;
  gap: 4px;
  background: #22222c;
  border-radius: 8px;
  padding: 4px;
}

.toggle-opt {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-opt.active { background: #6B21A8; color: #fff; }

/* ─── DIVIDER ─────────────────────────────── */
.divider {
  height: 1px;
  background: #2a2a35;
  margin: 8px 0 20px;
}

/* ─── TOAST ─────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: #15803d;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.3s;
  z-index: 9999;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ─── PANEL SECTION (show/hide) ─────────────────── */
.panel-section { display: none; }
.panel-section.active { display: block; }

/* ─── LINK WRAPPER (logo acima do botão) ─────────── */
.link-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-decoration: none;
}

.link-logo-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
}

/* ─── LINK LOGO ADMIN ──────────────────────────── */
.link-logo-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2e2e3d;
  margin-bottom: 2px;
}

.link-logo-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #1a1a24;
  border: 1px solid #2e2e3d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
}

.link-logo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.link-logo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.link-logo-actions label {
  padding: 5px 10px;
  background: #1a1a24;
  border: 1px solid #2e2e3d;
  border-radius: 6px;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
}

.link-logo-actions label:hover { border-color: #6B21A8; color: #c084fc; }

.link-logo-remove {
  padding: 5px 8px;
  background: transparent;
  border: 1px solid #2e2e3d;
  border-radius: 6px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.link-logo-remove:hover { color: #ef4444; border-color: #7f1d1d; }

/* ─── BG IMAGE PREVIEW ────────────────────────── */
.bg-img-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #2e2e3d;
  background: #22222c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
}
