/* =============================================
   PHP Link Bio Clone - Stylesheet
   Organized: Base > Layout > Components > Admin
   ============================================= */

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --accent: #6366f1;
  --accent-light: #8b5cf6;
  --accent-cyan: #06b6d4;
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --border: #1e293b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ---- Layout ---- */
.page-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* ---- Scroll Animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Profile Hero ---- */
.profile-hero {
  text-align: center;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  border: 3px solid var(--accent);
  object-fit: cover;
}

.profile-heading {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 45%, var(--accent-light) 80%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-subheading {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  position: relative;
}

.profile-subheading::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  margin: 16px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 50%, var(--accent-cyan) 100%);
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  margin-right: 10px;
}

.profile-handle {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 20px;
  padding: 3px 12px;
  margin-right: 8px;
  vertical-align: middle;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #667eea 0%, #8b5cf6 100%);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
  vertical-align: middle;
}

/* ---- Social Row ---- */
.social-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.social-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--bg-secondary);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.social-chip svg {
  width: 24px;
  height: 24px;
}

.social-chip:hover {
  background-color: var(--accent);
}

/* ---- Trust & Contact ---- */
.trust-note {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 14px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.contact-line {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 14px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 40px;
}

a.contact-line {
  text-decoration: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

a.contact-line:hover {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--accent-cyan);
}

/* ---- Links Block ---- */
.links-block {
  margin-bottom: 32px;
}

.section-label {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

/* Pill Links */
.pill-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pill-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.pill-item:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
}

.pill-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  margin-right: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.pill-copy {
  flex: 1;
}

.pill-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.pill-description {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Card Links */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

.product-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.product-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.product-copy {
  padding: 16px;
}

.product-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-description {
  font-size: 14px;
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================================
   ADMIN STYLES
   ============================================= */

.admin-links {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

#create-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 2rem;
}

#create-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.pill-card {
  background: #ffffff;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.pill-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.form-control {
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-check-input {
  margin-right: 0.5rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-info {
  background: #3b82f6;
  color: white;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.admin-link-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.handle {
  cursor: grab;
  font-size: 1.5rem;
  color: #9ca3af;
  padding: 0.5rem 0.25rem;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

.handle:active {
  cursor: grabbing;
}

.admin-link-item .content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-link-item .content img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-link-item .content > div {
  flex: 1;
}

.admin-link-item .content h5 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  color: #111827;
}

.admin-link-item .content a {
  display: block;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.95rem;
  word-break: break-all;
}

.admin-link-item .content a:hover {
  color: #667eea;
}

.style-badge {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: #10b981;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Sortable */
.sortable-ghost {
  opacity: 0.4;
  background: #f3f4f6;
}

.sortable-chosen {
  transform: rotate(5deg);
}

/* ---- Admin Responsive ---- */
@media (max-width: 768px) {
  .admin-links {
    padding: 0;
  }

  .admin-link-item {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .admin-link-item .content {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .actions {
    flex-direction: row;
    justify-content: center;
  }

  .pill-card {
    padding: 1.25rem;
  }

  #create-btn {
    padding: 1.25rem;
  }
}
