/* =========================================================
   SOCIAL SHARES - Frontend Styles
   Módulo de envío de contenido social para Loyalty Points
   ========================================================= */

:root {
  --social-primary: #dc2626;
  --social-primary-dark: #b91c1c;
  --social-secondary: #0ea5e9;
  --social-success: #10b981;
  --social-warning: #f59e0b;
  --social-bg: #f8fafc;
  --social-card: #ffffff;
  --social-text: #0f172a;
  --social-text-muted: #64748b;
  --social-border: #e2e8f0;
  --social-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --social-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --social-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --social-radius: 12px;
  --social-radius-lg: 16px;
}

/* ================ CONTENEDOR PRINCIPAL ================ */
.slv-social-shares {
  background: var(--social-card);
  border-radius: var(--social-radius-lg);
  box-shadow: var(--social-shadow-lg);
  overflow: hidden;
  margin: 40px 0;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================ HERO IMAGE ================ */
.slv-social-hero {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--social-primary) 0%, var(--social-primary-dark) 100%);
}

.slv-social-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ================ INFO SECTION ================ */
.slv-social-info {
  padding: 32px;
  background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--social-border);
}

.slv-social-info h3 {
  margin: 0 0 12px;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--social-text);
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.slv-social-info p {
  margin: 0 0 16px;
  font-size: 1.0625rem;
  color: var(--social-text-muted);
  line-height: 1.6;
}

.slv-social-info p:last-of-type {
  margin-bottom: 0;
}

/* ================ CONTADOR ================ */
.slv-social-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border-radius: var(--social-radius);
  border: 2px solid var(--social-border);
  font-size: 1rem;
  color: var(--social-text);
  margin-top: 8px;
}

.slv-social-counter strong {
  color: var(--social-primary);
  font-weight: 700;
  font-size: 1.125rem;
}

/* ================ MENSAJES ================ */
.slv-social-msg {
  margin: 24px 32px;
  padding: 16px 20px;
  border-radius: var(--social-radius);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slv-social-msg a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.slv-social-msg a:hover {
  text-decoration: none;
}

/* Estados de mensaje */
.slv-social-msg.slv-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: var(--social-primary);
}

.slv-social-msg.slv-success {
  background: #f0fdf4;
  color: #166534;
  border-color: var(--social-success);
}

.slv-social-msg.slv-warning {
  background: #fffbeb;
  color: #92400e;
  border-color: var(--social-warning);
}

/* ================ FORMULARIO ================ */
.slv-social-form {
  padding: 32px;
  border-bottom: 1px solid var(--social-border);
}

.slv-form-group {
  margin-bottom: 24px;
}

.slv-form-group:last-of-type {
  margin-bottom: 0;
}

.slv-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--social-text);
}

.slv-form-group input[type="url"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--social-border);
  border-radius: var(--social-radius);
  background: white;
  font-size: 1rem;
  color: var(--social-text);
  transition: all 0.2s ease;
  font-family: inherit;
}

.slv-form-group input[type="url"]:focus {
  outline: none;
  border-color: var(--social-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.slv-form-group input[type="url"]:hover {
  border-color: var(--social-text-muted);
}

.slv-form-group small {
  display: block;
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--social-text-muted);
}

/* ================ BOTONES ================ */
.slv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--social-text-muted);
  color: white;
  border: none;
  border-radius: var(--social-radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: var(--social-shadow-sm);
  font-family: inherit;
}

.slv-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--social-shadow);
}

.slv-btn:active {
  transform: translateY(0);
}

.slv-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.3);
}

.slv-btn-primary {
  background: var(--social-primary);
}

.slv-btn-primary:hover {
  background: var(--social-primary-dark);
}

.slv-btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

/* ================ HISTORIAL ================ */
.slv-social-history {
  padding: 32px;
}

.slv-social-history h4 {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--social-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.slv-social-history h4::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--social-primary);
  border-radius: 2px;
}

/* ================ TABLA ================ */
.slv-social-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--social-border);
  border-radius: var(--social-radius);
  overflow: hidden;
  background: white;
}

.slv-social-table thead {
  background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
}

.slv-social-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--social-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--social-border);
}

.slv-social-table tbody tr {
  border-bottom: 1px solid var(--social-border);
  transition: background 0.15s ease;
}

.slv-social-table tbody tr:last-child {
  border-bottom: none;
}

.slv-social-table tbody tr:hover {
  background: var(--social-bg);
}

.slv-social-table td {
  padding: 16px;
  font-size: 0.9375rem;
  color: var(--social-text);
}

.slv-social-table td a {
  color: var(--social-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.slv-social-table td a:hover {
  color: var(--social-primary);
  text-decoration: underline;
}

/* ================ STATUS BADGES ================ */
.slv-status-pending,
.slv-status-approved,
.slv-status-rejected {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.slv-status-pending {
  background: #fef3c7;
  color: #92400e;
}

.slv-status-approved {
  background: #dcfce7;
  color: #166534;
}

.slv-status-rejected {
  background: #fef2f2;
  color: #991b1b;
}

/* ================ UTILIDADES ================ */
.slv-muted {
  color: var(--social-text-muted);
  font-style: italic;
}

/* ================ RESPONSIVE ================ */
@media (max-width: 768px) {
  .slv-social-hero {
    height: 200px;
  }

  .slv-social-info {
    padding: 24px 20px;
  }

  .slv-social-info h3 {
    font-size: 1.5rem;
  }

  .slv-social-form {
    padding: 24px 20px;
  }

  .slv-social-history {
    padding: 24px 20px;
  }

  .slv-social-msg {
    margin: 20px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  /* Tabla responsive */
  .slv-social-table {
    font-size: 0.875rem;
  }

  .slv-social-table thead {
    display: none;
  }

  .slv-social-table tbody tr {
    display: block;
    margin-bottom: 16px;
    border: 1px solid var(--social-border);
    border-radius: var(--social-radius);
  }

  .slv-social-table td {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--social-border);
  }

  .slv-social-table td:last-child {
    border-bottom: none;
  }

  .slv-social-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--social-text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }
}

@media (max-width: 480px) {
  .slv-social-hero {
    height: 150px;
  }

  .slv-social-counter {
    width: 100%;
    justify-content: center;
  }

  .slv-btn {
    width: 100%;
  }
}

/* ================ DARK MODE ================ */
@media (prefers-color-scheme: dark) {
  :root {
    --social-bg: #0f172a;
    --social-card: #1e293b;
    --social-text: #f1f5f9;
    --social-text-muted: #94a3b8;
    --social-border: #334155;
  }

  .slv-social-info {
    background: linear-gradient(to bottom, #1e293b 0%, #334155 100%);
  }

  .slv-social-counter {
    background: #1e293b;
  }

  .slv-form-group input[type="url"] {
    background: #1e293b;
    color: var(--social-text);
  }

  .slv-social-table {
    background: #1e293b;
  }

  .slv-social-table thead {
    background: linear-gradient(to bottom, #1e293b 0%, #334155 100%);
  }

  .slv-social-table tbody tr:hover {
    background: #0f172a;
  }
}

/* ================ ACCESIBILIDAD ================ */
@media (prefers-reduced-motion: reduce) {
  .slv-social-shares,
  .slv-social-msg,
  .slv-btn {
    animation: none;
    transition: none;
  }
}

/* Focus visible para navegación por teclado */
*:focus-visible {
  outline: 2px solid var(--social-primary);
  outline-offset: 2px;
}