/* ===== RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: #e9f2ff;
  color: #0f172a;
}

/* ===== LAYOUT GENERAL ===== */

.app {
  display: flex;
  min-height: 100vh;
  padding: 16px;       /* separa todo del borde de la pantalla */
  gap: 16px;           /* espacio entre la sidebar y el contenido */
}


/* ===== SIDEBAR PRINCIPAL ===== */

.sidebar {
  width: 230px;
  background: #ffffff;
  box-shadow: 6px 0 30px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  padding: 16px 14px 16px;
  border-radius: 0 24px 24px 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.sidebar-logo img {
  max-width: 140px;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border-radius: 999px;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #1f2933;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease,
    transform 0.05s ease;
}

.nav-item--simple {
  justify-content: flex-start;
  gap: 8px;
}

.nav-item--active {
  background: #1455e6;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(20, 85, 230, 0.5);
  transform: translateY(-1px);
}

.nav-item--group {
  background: rgba(20, 85, 230, 0.06);
  color: #1455e6;
}

.nav-item--group:hover {
  background: rgba(20, 85, 230, 0.12);
}

.nav-chevron {
  font-size: 11px;
  opacity: 0.7;
}

/* Submenú community */

.nav-sub {
  margin-left: 8px;
  margin-top: 4px;
  display: grid;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.18s ease;
}

.nav-sub--open {
  max-height: 240px;
}

.nav-sub-item {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #4b5563;
  text-decoration: none;
  background: transparent;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-sub-item:hover {
  background: rgba(20, 85, 230, 0.08);
  color: #111827;
}

.nav-sub-item--active {
  background: #1455e6;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 85, 230, 0.4);
}

/* Footer sidebar */

.sidebar-footer {
  margin-top: 12px;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1455e6, #1d5fff);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.user-tag {
  font-size: 11px;
  color: #9ca3af;
}

.logout-btn {
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  cursor: pointer;
}

/* ========== MAIN ========== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forum-header {
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forum-title-image {
  display: flex;
  align-items: center;
}

.forum-title-image img {
  max-height: 42px;
  width: auto;
}

.forum-subcopy {
  font-size: 13px;
  color: #4b5563;
  max-width: 640px;
}

.city-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.city-label {
  font-size: 12px;
  color: #4b5563;
  margin-right: 4px;
}

.city-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: #ffffff;
  font-size: 12px;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease,
    border-color 0.12s ease, box-shadow 0.12s ease,
    transform 0.05s ease;
}

.city-pill:hover {
  border-color: #1455e6;
  background: #eff6ff;
  color: #1455e6;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
  transform: translateY(-1px);
}

.city-pill--active {
  background: #1455e6;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 14px 32px rgba(20, 85, 230, 0.6);
}

/* ========== BODY (3 COLUMNAS) ========== */

.forum-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: flex-start;
}

.friends-column,
.chat-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friends-card,
.chat-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
  padding: 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friends-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friends-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.friends-subtitle {
  font-size: 11px;
  color: #6b7280;
}

.friends-search {
  position: relative;
  margin-top: 4px;
}

.friends-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 12px;
  padding: 7px 11px 7px 26px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease;
}

.friends-search input:focus {
  background: #ffffff;
  border-color: #1455e6;
  box-shadow: 0 0 0 2px rgba(20, 85, 230, 0.18);
}

.search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.7;
}

.friends-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 3px;
}

.friend-item {
  width: 100%;
  border-radius: 999px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease,
    transform 0.05s ease, border-color 0.12s ease;
}

.friend-item:hover {
  background: #eff6ff;
  border-color: #1455e6;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.volunteer-opportunity--active {
  background: #1455e6;
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(20, 85, 230, 0.6);
}

.friend-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.volunteer-opportunity--active .friend-avatar {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.friend-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.friend-name {
  font-size: 12px;
  font-weight: 600;
}

.friend-detail {
  font-size: 11px;
  color: inherit;
  opacity: 0.85;
}

/* ========== BOTONES PRINCIPALES ========== */

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 999px;
  border: none;
  background-image: linear-gradient(135deg, #1455e6, #1d5fff);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(20, 85, 230, 0.55);
  transition: transform 0.08s ease, box-shadow 0.12s ease,
    filter 0.12s ease;
}

.primary-btn--small {
  padding: 7px 16px;
  font-size: 12px;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(20, 85, 230, 0.65);
  filter: brightness(1.03);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(20, 85, 230, 0.45);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #ffffff;
  color: #1455e6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease,
    border-color 0.12s ease, transform 0.08s ease,
    box-shadow 0.12s ease;
}

.secondary-btn:hover {
  background: rgba(239, 246, 255, 0.95);
  border-color: #1455e6;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.secondary-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ========== DETALLE VOLUNTARIADO (COLUMNA CENTRAL) ========== */

.chat-card {
  gap: 14px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.chat-channel-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 2px;
}

.chat-channel-name {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.chat-channel-meta {
  font-size: 12px;
  color: #4b5563;
  margin-top: 2px;
}

.rating-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap;
}

.rating-stars {
  letter-spacing: 1px;
}

.rating-score,
.rating-count {
  font-weight: 500;
}

.vol-detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
  margin-top: 10px;
}

.vol-detail-image {
  border-radius: 18px;
  min-height: 210px;
  background: #e0edff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vol-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vol-detail-info {
  display: flex;
  flex-direction: column;
}

.vol-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin: 4px 0 6px;
}

.vol-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vol-checklist li {
  font-size: 13px;
  color: #374151;
  display: flex;
  align-items: flex-start;
}

.check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-right: 6px;
  margin-top: 1px;
}

.vol-description {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  margin: 4px 0 6px;
}

.vol-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.vol-quick-cards {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vol-quick-card {
  background: #f9fafb;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
}

.vol-quick-title {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 3px;
}

.vol-quick-text {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.45;
}

/* ========== COLUMNA DERECHA: RESEÑAS ========== */

.volunteer-comments-column .friends-card {
  max-height: none;
}

.vol-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.vol-comment {
  background: #f9fafb;
  border-radius: 14px;
  padding: 8px 9px 9px;
  border: 1px solid #e5e7eb;
}

.vol-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.vol-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.vol-comment-meta {
  display: flex;
  flex-direction: column;
}

.vol-comment-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.vol-comment-rating {
  font-size: 12px;
  color: #92400e;
}

.vol-comment-text {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.5;
}

.vol-comment-form {
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vol-comment-form label {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.vol-comment-rating-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #4b5563;
}

.vol-comment-rating-input select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 4px 8px;
  font-size: 12px;
  background: #ffffff;
}

.vol-comment-form textarea {
  border-radius: 12px;
  border: 1px solid #d1d5db;
  min-height: 70px;
  resize: vertical;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease;
}

.vol-comment-form textarea:focus {
  border-color: #1455e6;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(20, 85, 230, 0.18);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1024px) {
  .app {
    padding: 10px;
    gap: 10px;
  }

  .forum-body {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .volunteer-comments-column {
    display: none;
  }
}

@media (max-width: 860px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-radius: 18px;
  }

  .sidebar-footer {
    display: none;
  }

  .forum-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .friends-column {
    order: 2;
  }

  .chat-column {
    order: 1;
  }

  .vol-detail-layout {
    grid-template-columns: 1fr;
  }

  .vol-quick-cards {
    grid-template-columns: 1fr;
  }
}
