/* ==========================================================================
   HoloPlaza Social — Estilos principales
   Paleta: #051518 fondo, #0d2327 card, #1a3a40 border, #FF8C42 accent
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables CSS
   -------------------------------------------------------------------------- */
:root {
  --hps-bg:           #051518;
  --hps-card-bg:      #0d2327;
  --hps-border:       #1a3a40;
  --hps-accent:       #FF8C42;
  --hps-accent-hover: #e87a35;
  --hps-text:         #e8f4f6;
  --hps-text-muted:   #7a9ea5;
  --hps-radius:       8px;
  --hps-danger:       #e74c3c;
  --hps-danger-hover: #c0392b;
  --hps-success:      #2ecc71;
  --hps-warning:      #f1c40f;
  --hps-shadow:       0 2px 12px rgba(0, 0, 0, 0.4);
  --hps-transition:   0.2s ease;
}

/* --------------------------------------------------------------------------
   Wrapper principal
   -------------------------------------------------------------------------- */
.hps-wrapper {
  font-family: sans-serif;
  color: var(--hps-text);
  background: var(--hps-bg);
  border-radius: var(--hps-radius);
  padding: 24px;
  min-height: 400px;
  position: relative;
}

/* --------------------------------------------------------------------------
   Tabs de navegación
   -------------------------------------------------------------------------- */
.hps-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--hps-border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hps-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--hps-text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 18px;
  margin-bottom: -2px;
  transition: color var(--hps-transition), border-color var(--hps-transition);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.hps-tab:hover {
  color: var(--hps-text);
}

.hps-tab--active {
  color: var(--hps-accent);
  border-bottom-color: var(--hps-accent);
}

/* --------------------------------------------------------------------------
   Contenido de pestañas
   -------------------------------------------------------------------------- */
.hps-tab-content {
  display: none;
}

.hps-tab-content--active {
  display: block;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.hps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  line-height: 1;
}

.hps-badge--count {
  background: var(--hps-border);
  color: var(--hps-text-muted);
}

.hps-badge--alert {
  background: var(--hps-danger);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.hps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--hps-radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  padding: 10px 18px;
  text-decoration: none;
  transition: background var(--hps-transition), color var(--hps-transition), opacity var(--hps-transition);
  white-space: nowrap;
}

.hps-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hps-btn--primary {
  background: var(--hps-accent);
  color: #fff;
}

.hps-btn--primary:hover:not(:disabled) {
  background: var(--hps-accent-hover);
}

.hps-btn--danger {
  background: var(--hps-danger);
  color: #fff;
}

.hps-btn--danger:hover:not(:disabled) {
  background: var(--hps-danger-hover);
}

.hps-btn--ghost {
  background: transparent;
  border: 1px solid var(--hps-border);
  color: var(--hps-text-muted);
}

.hps-btn--ghost:hover:not(:disabled) {
  border-color: var(--hps-text-muted);
  color: var(--hps-text);
}

.hps-btn--sm {
  font-size: 0.8rem;
  padding: 6px 12px;
}

.hps-btn--full {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Section header
   -------------------------------------------------------------------------- */
.hps-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.hps-section-header h3,
.hps-section-header h4 {
  color: var(--hps-text);
  font-size: 1.1rem;
  margin: 0;
}

.hps-section-header--mt {
  margin-top: 32px;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.hps-empty-state {
  color: var(--hps-text-muted);
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--hps-border);
  border-radius: var(--hps-radius);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */
.hps-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--hps-border);
}

.hps-avatar--sm {
  width: 32px !important;
  height: 32px !important;
}

/* --------------------------------------------------------------------------
   Grid de amigos
   -------------------------------------------------------------------------- */
.hps-friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.hps-friend-card {
  background: var(--hps-card-bg);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: border-color var(--hps-transition), box-shadow var(--hps-transition);
}

.hps-friend-card:hover {
  border-color: var(--hps-accent);
  box-shadow: var(--hps-shadow);
}

.hps-friend-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.hps-friend-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--hps-text);
}

.hps-friend-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Búsqueda
   -------------------------------------------------------------------------- */
.hps-search-bar {
  position: relative;
  margin-bottom: 20px;
}

.hps-search-bar .hps-input {
  width: 100%;
  padding-right: 44px;
  box-sizing: border-box;
}

.hps-search-spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.hps-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hps-search-result-item {
  background: var(--hps-card-bg);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color var(--hps-transition);
}

.hps-search-result-item:hover {
  border-color: var(--hps-accent);
}

.hps-search-result-info {
  flex: 1;
  min-width: 0;
}

.hps-search-result-name {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hps-search-result-login {
  color: var(--hps-text-muted);
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Solicitudes de amistad
   -------------------------------------------------------------------------- */
.hps-requests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hps-request-card {
  background: var(--hps-card-bg);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hps-request-card--sent {
  border-left: 3px solid var(--hps-accent);
}

.hps-request-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hps-request-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.hps-request-message {
  color: var(--hps-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.hps-request-date {
  color: var(--hps-text-muted);
  font-size: 0.8rem;
}

.hps-request-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Badges de estado
   -------------------------------------------------------------------------- */
.hps-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hps-status-badge--pending  { background: rgba(241, 196, 15, 0.15);  color: var(--hps-warning); }
.hps-status-badge--invited  { background: rgba(255, 140, 66, 0.15);  color: var(--hps-accent); }
.hps-status-badge--confirmed { background: rgba(46, 204, 113, 0.15); color: var(--hps-success); }
.hps-status-badge--declined { background: rgba(231, 76, 60, 0.15);   color: var(--hps-danger); }
.hps-status-badge--open      { background: rgba(46, 204, 113, 0.15); color: var(--hps-success); }
.hps-status-badge--full      { background: rgba(241, 196, 15, 0.15); color: var(--hps-warning); }
.hps-status-badge--cancelled { background: rgba(231, 76, 60, 0.15);  color: var(--hps-danger); }
.hps-status-badge--finished  { background: rgba(122, 158, 165, 0.15); color: var(--hps-text-muted); }

/* --------------------------------------------------------------------------
   Tipo de evento (badge)
   -------------------------------------------------------------------------- */
.hps-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hps-type-badge--quedada { background: rgba(255, 140, 66, 0.18); color: var(--hps-accent); }
.hps-type-badge--torneo  { background: rgba(155, 89, 182, 0.18); color: #b39ddb; }

.hps-game-badge {
  display: inline-block;
  background: rgba(26, 58, 64, 0.8);
  border: 1px solid var(--hps-border);
  color: var(--hps-text-muted);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Lista de meetups
   -------------------------------------------------------------------------- */
.hps-meetups-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hps-meetup-card {
  background: var(--hps-card-bg);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius);
  padding: 18px 20px;
  transition: border-color var(--hps-transition), box-shadow var(--hps-transition);
}

.hps-meetup-card:hover {
  border-color: var(--hps-accent);
  box-shadow: var(--hps-shadow);
}

.hps-meetup-card--cancelled {
  opacity: 0.55;
  pointer-events: none;
}

.hps-meetup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hps-meetup-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.hps-meetup-title {
  color: var(--hps-text);
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.hps-meetup-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--hps-text-muted);
}

.hps-meetup-desc {
  color: var(--hps-text-muted);
  font-size: 0.9rem;
  margin: 0 0 12px;
  line-height: 1.5;
}

.hps-meetup-rsvp {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hps-border);
}

/* --------------------------------------------------------------------------
   Inputs y formularios
   -------------------------------------------------------------------------- */
.hps-input,
.hps-select,
.hps-textarea {
  background: var(--hps-card-bg);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius);
  color: var(--hps-text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  transition: border-color var(--hps-transition);
  width: 100%;
  box-sizing: border-box;
}

.hps-input::placeholder,
.hps-textarea::placeholder {
  color: var(--hps-text-muted);
}

.hps-input:focus,
.hps-select:focus,
.hps-textarea:focus {
  border-color: var(--hps-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.15);
}

.hps-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a9ea5' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.hps-select option {
  background: var(--hps-card-bg);
  color: var(--hps-text);
}

.hps-textarea {
  resize: vertical;
  min-height: 80px;
}

.hps-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hps-form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--hps-text-muted);
}

.hps-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.hps-form-row--2col > .hps-form-group {
  flex: 1;
  min-width: 0;
}

.hps-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hps-form > .hps-form-group {
  margin-bottom: 16px;
}

.hps-form-actions {
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Selección de amigos para invitar (checkboxes)
   -------------------------------------------------------------------------- */
.hps-invite-friends {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--hps-bg);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius);
  padding: 12px;
  max-height: 160px;
  overflow-y: auto;
}

.hps-invite-friend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--hps-card-bg);
  border: 1px solid var(--hps-border);
  transition: border-color var(--hps-transition);
  font-size: 0.88rem;
  color: var(--hps-text);
}

.hps-invite-friend-item:hover {
  border-color: var(--hps-accent);
}

.hps-invite-friend-item input[type="checkbox"] {
  accent-color: var(--hps-accent);
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.hps-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 21, 24, 0.85);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.hps-modal {
  background: var(--hps-card-bg);
  border: 1px solid var(--hps-border);
  border-radius: calc(var(--hps-radius) * 1.5);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
}

.hps-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--hps-border);
  position: sticky;
  top: 0;
  background: var(--hps-card-bg);
  z-index: 1;
}

.hps-modal-header h3 {
  color: var(--hps-text);
  margin: 0;
  font-size: 1.15rem;
}

.hps-modal-close {
  background: transparent;
  border: none;
  color: var(--hps-text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 4px;
  transition: color var(--hps-transition);
}

.hps-modal-close:hover {
  color: var(--hps-text);
}

.hps-modal .hps-form {
  padding: 20px 24px 24px;
}

/* --------------------------------------------------------------------------
   Spinner de carga
   -------------------------------------------------------------------------- */
.hps-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--hps-border);
  border-top-color: var(--hps-accent);
  border-radius: 50%;
  animation: hps-spin 0.7s linear infinite;
}

@keyframes hps-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Mensajes de éxito / error
   -------------------------------------------------------------------------- */
.hps-message-area {
  border-radius: var(--hps-radius);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 12px;
  padding: 12px 16px;
}

.hps-message-area.hps-message--success {
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: var(--hps-success);
  display: block !important;
}

.hps-message-area.hps-message--error {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--hps-danger);
  display: block !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .hps-wrapper {
    padding: 16px;
  }

  .hps-tabs {
    gap: 0;
  }

  .hps-tab {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .hps-form-row--2col {
    flex-direction: column;
  }

  .hps-friends-grid {
    grid-template-columns: 1fr;
  }

  .hps-request-card {
    flex-wrap: wrap;
  }

  .hps-request-actions {
    width: 100%;
  }

  .hps-modal {
    max-height: 95vh;
  }
}
