/* ── LinkVista — Frontend CSS ──────────────────────────────────────────── */

.lv-dashboard {
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Profil header */
.lv-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.lv-avatar-wrap { position: relative; flex-shrink: 0; }
.lv-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.lv-avatar-edit {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #4f46e5;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.lv-username { font-size: 1.2rem; font-weight: 700; color: #1a202c; margin-bottom: 4px; }
.lv-page-link { font-size: 0.85rem; color: #4f46e5; text-decoration: none; display: block; margin-bottom: 6px; }
.lv-page-link:hover { text-decoration: underline; }

/* Badges */
.lv-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.lv-badge-premium { background: #fef3c7; color: #92400e; }
.lv-badge-free    { background: #f1f5f9; color: #475569; }

/* Sections */
.lv-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.lv-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.lv-section-header h3 { font-size: 1rem; font-weight: 700; color: #1a202c; }

/* Boutons */
.lv-btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.lv-btn:hover { opacity: 0.85; }
.lv-btn-primary   { background: #4f46e5; color: #fff; }
.lv-btn-secondary { background: #f1f5f9; color: #475569; }
.lv-btn-ghost     { background: transparent; color: #718096; }
.lv-btn-icon      { background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.lv-btn-icon:hover { background: #f1f5f9; }

/* Formulaire */
.lv-form-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.lv-form-box h4 { margin-bottom: 12px; font-size: 0.95rem; color: #374151; }
.lv-form-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.lv-input {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.lv-input:focus { border-color: #4f46e5; }
.lv-form-actions { display: flex; gap: 10px; }

/* Message */
.lv-message { font-size: 0.85rem; margin-top: 8px; padding: 8px 12px; border-radius: 6px; }
.lv-error   { background: #fee2e2; color: #b91c1c; }
.lv-success { background: #dcfce7; color: #166534; }

/* Liste des liens */
.lv-links-list { display: flex; flex-direction: column; gap: 10px; }
.lv-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.lv-drag-handle { color: #cbd5e1; cursor: grab; font-size: 1.1rem; }
.lv-link-info { flex: 1; min-width: 0; }
.lv-link-info strong { display: block; font-size: 0.9rem; color: #1a202c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-link-info span   { font-size: 0.78rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.lv-link-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Stats table */
.lv-stats-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.lv-stats-table th, .lv-stats-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; }
.lv-stats-table th { color: #64748b; font-weight: 600; }

/* Upgrade box */
.lv-upgrade-box {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
}
.lv-upgrade-box h3 { font-size: 1.2rem; margin-bottom: 8px; }
.lv-upgrade-box p  { opacity: 0.85; margin-bottom: 20px; font-size: 0.95rem; }
.lv-upgrade-box .lv-btn-primary { background: #fff; color: #4f46e5; }

/* Empty state */
.lv-empty { color: #94a3b8; font-size: 0.9rem; text-align: center; padding: 20px 0; }

/* ── Personnalisation ───────────────────────────────────────────────────────── */

/* Grille des thèmes */
.lv-themes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.lv-theme-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.lv-theme-chip:hover { transform: translateY(-1px); }
.lv-theme-chip.lv-theme-active { border-color: #fff; box-shadow: 0 0 0 3px #4f46e5; }

/* Couleurs custom */
.lv-colors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.lv-color-field { display: flex; flex-direction: column; gap: 6px; }
.lv-color-field label { font-size: 0.8rem; color: #64748b; font-weight: 600; }
.lv-color-row { display: flex; gap: 8px; align-items: center; }

input[type="color"] {
    width: 48px;
    height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

.lv-select {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #fff;
    color: #374151;
    flex: 1;
}

/* Aperçu bouton */
.lv-preview-wrap { margin-top: 20px; }
.lv-preview-wrap #lv-btn-preview-area {
    border-radius: 12px;
    transition: background 0.3s;
    margin-top: 8px;
}

/* Image de fond */
.lv-bg-image-section { margin-bottom: 20px; }
.lv-upload-zone {
    display: block;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    color: #64748b;
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s;
}
.lv-upload-zone:hover { border-color: #4f46e5; background: #f8f9ff; }

.lv-bg-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.lv-bg-preview img {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.lv-btn-danger { background: #fee2e2; color: #b91c1c; }
.lv-btn-danger:hover { background: #fecaca; }
.lv-btn-white { background: #fff; color: #4f46e5; }

/* Label et hint */
.lv-label { font-size: 0.85rem; font-weight: 600; color: #374151; margin-bottom: 10px; }
.lv-hint  { font-weight: 400; color: #94a3b8; }

/* ── Emoji picker ───────────────────────────────────────────────────────────── */

.lv-emoji-field { position: relative; flex-shrink: 0; }

.lv-input-emoji {
    width: 64px !important;
    text-align: center;
    font-size: 1.2rem;
    cursor: pointer;
    caret-color: transparent;
}

.lv-form-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.lv-input-grow { flex: 1; }

.lv-emoji-picker {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    width: 240px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.lv-emoji-picker.lv-picker-open { display: flex; }
.lv-emoji-picker-inline { display: none; }
.lv-emoji-picker-inline[style*="block"] { display: flex; flex-wrap: wrap; }

.lv-emoji-opt {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}
.lv-emoji-opt:hover { background: #f1f5f9; }

.lv-emoji-clear {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    width: 100%;
    margin-top: 4px;
}
.lv-emoji-clear:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

.lv-link-emoji-wrap { position: relative; flex-shrink: 0; }

/* ── Icônes réseaux sociaux ─────────────────────────────────────────────────── */

.lv-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

/* Badge réseau dans le dashboard */
.lv-network-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Snapchat : texte noir car fond jaune */
.lv-link-btn[style*="FFFC00"] .lv-link-icon svg,
.lv-link-btn[style*="fffc00"] .lv-link-icon svg {
    fill: #000 !important;
}

/* ── Drag & Drop (SortableJS) ───────────────────────────────────────────────── */

.lv-drag-handle {
    color: #cbd5e1;
    cursor: grab;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    user-select: none;
    flex-shrink: 0;
}
.lv-drag-handle:hover {
    color: #94a3b8;
    background: #f1f5f9;
}
.lv-drag-handle:active {
    cursor: grabbing;
}

/* Élément fantôme pendant le drag */
.lv-sortable-ghost {
    opacity: 0.35;
    background: #e0e7ff !important;
    border: 2px dashed #6366f1 !important;
}

/* Élément sélectionné */
.lv-sortable-chosen {
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.2) !important;
    border-color: #a5b4fc !important;
    background: #fff !important;
}

/* Élément en cours de drag */
.lv-sortable-drag {
    opacity: 1 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
    transform: rotate(1deg);
}

/* Animation d'entrée lors du réordonnancement */
.lv-link-item {
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

/* ── Profil : bio + titre ───────────────────────────────────────────────────── */

.lv-textarea {
    width: 100%;
    resize: vertical;
    line-height: 1.5;
    font-family: inherit;
}

.lv-char-counter {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: right;
    margin-top: 4px;
}

/* Aperçu mini du profil */
.lv-profile-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.lv-preview-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e2e8f0;
}

.lv-profile-preview strong {
    display: block;
    font-size: 0.95rem;
    color: #1a202c;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lv-profile-preview span {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Section abonnement ─────────────────────────────────────────────────────── */

.lv-subscription-section h3 { margin-bottom: 20px; }

.lv-sub-info {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 20px;
}

.lv-sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.lv-sub-row:last-child { border-bottom: none; }

.lv-sub-label {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.lv-sub-value {
    font-size: 0.88rem;
    color: #1a202c;
    font-weight: 400;
    text-align: right;
}

.lv-sub-active  { color: #16a34a; font-weight: 600; }
.lv-sub-warning { color: #d97706; font-weight: 600; }

/* Actions abonnement */
.lv-sub-actions { display: flex; flex-direction: column; gap: 10px; }

.lv-sub-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-top: 4px;
}

.lv-btn-danger-solid {
    background: #ef4444;
    color: #fff;
    border: none;
}
.lv-btn-danger-solid:hover { background: #dc2626; }

/* Notice d'annulation programmée */
.lv-cancel-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.lv-cancel-notice p { font-size: 0.88rem; color: #92400e; line-height: 1.5; }

/* Boîte de confirmation */
.lv-cancel-confirm {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 16px 18px;
    margin-top: 12px;
}
.lv-cancel-confirm p { font-size: 0.88rem; color: #991b1b; line-height: 1.5; }

/* ── Responsive renforcé (mobile-first) ─────────────────────────────────────── */

/* Tablette (≤ 768px) */
@media (max-width: 768px) {
  .lv-dashboard {
    padding: 16px !important;
  }

  .lv-section {
    padding: 20px 16px !important;
    border-radius: 14px !important;
  }

  .lv-section-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .lv-profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }

  .lv-stats-table th,
  .lv-stats-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .lv-sub-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .lv-sub-value { text-align: left !important; }

  .lv-form-row {
    flex-direction: column;
  }

  .lv-theme-chips {
    flex-wrap: wrap;
    gap: 8px;
  }

  .lv-colors-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile (≤ 480px) */
@media (max-width: 480px) {
  .lv-section-header > div,
  .lv-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .lv-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Boutons stats + export sur mobile */
  #wplt-stats-period,
  #lv-export-csv-btn {
    width: 100%;
  }

  /* Plans subscription */
  .lv-plans-grid {
    grid-template-columns: 1fr !important;
  }

  /* Upgrade box */
  .lv-upgrade-box {
    padding: 24px 16px !important;
    text-align: center;
  }

  /* Abonnement */
  .lv-sub-actions .lv-btn {
    width: 100%;
  }

  /* Sélecteur de langue */
  .lv-lang-switcher {
    font-size: 0.78rem;
  }

  /* Page publique */
  .lv-card {
    padding: 32px 16px !important;
    border-radius: 0 !important;
    min-height: 100vh;
  }

  .lv-link-btn {
    font-size: 0.88rem !important;
    padding: 14px 16px !important;
  }
}

/* Très petits écrans (≤ 360px) */
@media (max-width: 360px) {
  .lv-avatar-wrap img {
    width: 64px !important;
    height: 64px !important;
  }

  h1, h2, h3 {
    font-size: clamp(1rem, 4vw, 1.3rem) !important;
  }
}

/* Accessibilité : respect du mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* RTL : non applicable pour nos 5 langues (toutes LTR) */
