/* ==========================================================================
   SOCIAL (main page only, off by default)
   ========================================================================== */

/* Switch in the search form */
#social_switch_wrapper {
  float: left;
  margin-top: 12px;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ftw-social-help-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 18px;
  line-height: 1;
  padding: 2px;
  cursor: pointer;
  transition: color 0.15s ease-in-out;
}

.ftw-social-help-btn:hover,
.ftw-social-help-btn:focus {
  color: #ffffff;
  outline: none;
}

/* Help modal */
.ftw-social-help-intro {
  color: #444;
  font-size: 16px;
  max-width: 680px;
  margin: 0 auto 24px;
}

.ftw-social-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ftw-social-help-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 14px;
  background: #f8faf9;
  border: 1px solid #e3ebe8;
  border-radius: 14px;
  text-align: center;
}

.ftw-social-help-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(19, 150, 118, 0.1);
  color: #139676;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.ftw-social-help-title {
  color: #0d7159;
  font-size: 15px;
}

.ftw-social-help-text {
  color: #555;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .ftw-social-help-grid { grid-template-columns: 1fr; }
}

#social_switch_wrapper .custom-control-label {
  color: #ffffff;
  letter-spacing: 1px;
  cursor: pointer;
}

/* Result slot */
.ftw-social-slot:empty {
  display: none;
}

.ftw-social-bar {
  margin-top: 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(19, 150, 118, 0.05) 0%, rgba(19, 150, 118, 0.01) 100%);
  border: 1px solid rgba(19, 150, 118, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  text-align: center;
}

.ftw-social-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.ftw-social-empty {
  font-size: 13px;
  color: #666;
}

.ftw-social-avatar-btn,
.ftw-social-more-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s ease-in-out;
}

.ftw-social-avatar-btn:hover,
.ftw-social-more-btn:hover {
  transform: translateY(-2px);
}

.ftw-social-more-btn {
  width: 30px;
  height: 30px;
  background: #ffffff;
  border: 1px solid rgba(19, 150, 118, 0.35);
  color: #139676;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ftw-social-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: #139676;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.ftw-social-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ftw-social-avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.ftw-social-avatar-md { width: 44px; height: 44px; font-size: 18px; }
.ftw-social-avatar-lg { width: 110px; height: 110px; font-size: 44px; }

.ftw-social-join-btn {
  background: #139676;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(19, 150, 118, 0.25);
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ftw-social-join-btn:hover {
  background: #0d7159;
}

.ftw-social-join-btn.is-joined {
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(19, 150, 118, 0.45);
}

.ftw-social-join-btn.is-joined:hover {
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(19, 150, 118, 0.3);
}

.ftw-social-joined-state,
.ftw-social-joined-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
}

.ftw-social-joined-state {
  background: linear-gradient(135deg, #0d7159 0%, #1fb38e 100%);
  color: #ffffff;
}

.ftw-social-joined-edit {
  color: #0d7159;
  transition: background 0.2s ease-in-out;
}

.ftw-social-join-btn.is-joined:hover .ftw-social-joined-edit {
  background: rgba(19, 150, 118, 0.1);
}

.view-flat .ftw-social-joined-state,
.view-flat .ftw-social-joined-edit {
  padding: 3px 8px;
}

/* Flat view: compact */
.view-flat .ftw-social-bar {
  margin-top: 6px;
  padding: 4px 6px;
  gap: 6px;
}

.view-flat .ftw-social-avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.view-flat .ftw-social-more-btn { width: 24px; height: 24px; font-size: 10px; }
.view-flat .ftw-social-join-btn { padding: 3px 10px; font-size: 11px; }

/* Modals */
.ftw-social-modal .modal-dialog {
  max-width: min(960px, 94vw);
}

.ftw-social-modal .modal-content {
  border-radius: 20px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.ftw-social-modal .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 18px 24px;
  justify-content: center;
  position: relative;
}

.ftw-social-modal .modal-header .close {
  position: absolute;
  right: 20px;
  top: 14px;
  font-size: 26px;
}

.ftw-social-modal .modal-title {
  color: #111;
  font-size: 22px;
  text-align: center;
  width: 100%;
}

.ftw-social-modal .modal-body {
  padding: 28px 36px;
  text-align: center;
}

.ftw-social-modal label {
  display: block;
  text-align: center;
  color: #333;
  margin-bottom: 6px;
}

.ftw-social-modal textarea {
  text-align: left;
  border-radius: 10px;
  min-height: 140px;
}

/* Join modal: header */
#ftw_social_join_modal .modal-header {
  background: linear-gradient(135deg, #0d7159 0%, #139676 60%, #1fb38e 100%);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 26px 24px 22px;
}

#ftw_social_join_modal .modal-header .close {
  color: #ffffff;
  opacity: 0.85;
  text-shadow: none;
}

.ftw-social-join-title {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: #ffffff;
}

.ftw-social-join-title-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.ftw-social-join-title-kicker {
  font-size: 13px;
  letter-spacing: 3px;
  opacity: 0.85;
}

.ftw-social-join-title-city {
  font-size: 28px;
  line-height: 1.2;
}

.ftw-social-join-title-city i {
  font-size: 20px;
  opacity: 0.8;
}

/* Join modal: sections */
.ftw-social-section {
  margin-bottom: 26px;
}

.ftw-social-modal .ftw-social-section-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #0d7159;
  font-size: 15px;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.ftw-social-section-label i {
  color: #139676;
}

.ftw-social-optional {
  font-size: 11px;
  color: #8a9a95;
  background: #f1f5f4;
  border-radius: 10px;
  padding: 1px 8px;
}

/* Icon tiles */
.ftw-social-choice-grid {
  display: grid;
  gap: 10px;
}

.ftw-social-choice-grid-purpose {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

@media (max-width: 991px) {
  .ftw-social-choice-grid-purpose { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ftw-social-choice-grid-budget {
  grid-template-columns: repeat(4, 1fr);
}

.ftw-social-choice-grid-group {
  grid-template-columns: repeat(3, 1fr);
}

.ftw-social-choice-icon i + i {
  margin-left: 1px;
}

.ftw-social-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  background: #ffffff;
  border: 1px solid #e3ebe8;
  border-radius: 14px;
  color: #445;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease-in-out;
}

.ftw-social-choice:hover {
  border-color: rgba(19, 150, 118, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(19, 150, 118, 0.12);
}

.ftw-social-choice:focus {
  outline: none;
}

.ftw-social-choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(19, 150, 118, 0.08);
  color: #139676;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  transition: all 0.18s ease-in-out;
}

.ftw-social-choice-label {
  font-size: 13px;
  line-height: 1.2;
}

.ftw-social-choice.is-selected {
  border-color: #139676;
  background: linear-gradient(135deg, rgba(19, 150, 118, 0.10) 0%, rgba(19, 150, 118, 0.03) 100%);
  color: #0d7159;
  box-shadow: 0 6px 16px rgba(19, 150, 118, 0.18);
}

.ftw-social-choice.is-selected .ftw-social-choice-icon {
  background: #139676;
  color: #ffffff;
}

.ftw-social-section textarea {
  border: 1px solid #e3ebe8;
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 120px;
}

.ftw-social-section textarea:focus {
  border-color: #139676;
  box-shadow: 0 0 0 3px rgba(19, 150, 118, 0.12);
}

/* Join modal: buttons */
.ftw-social-modal .ftw-social-btn-primary {
  background: linear-gradient(135deg, #0d7159 0%, #1fb38e 100%);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 12px 40px;
  letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(19, 150, 118, 0.3);
  transition: all 0.2s ease-in-out;
}

.ftw-social-modal .ftw-social-btn-primary:hover {
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(19, 150, 118, 0.4);
}

.ftw-social-modal .ftw-social-btn-leave {
  background: #ffffff;
  color: #d9534f;
  border: 1px solid rgba(217, 83, 79, 0.4);
  border-radius: 30px;
  padding: 12px 28px;
}

.ftw-social-modal .ftw-social-btn-leave:hover {
  background: #fdf1f0;
  color: #c9302c;
}

@media (max-width: 760px) {
  .ftw-social-choice-grid-budget { grid-template-columns: repeat(2, 1fr); }
}

.ftw-social-modal .btn {
  border-radius: 10px;
  padding: 10px 28px;
}

.ftw-social-modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

/* Profile modal */
.ftw-social-profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.ftw-social-profile-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.ftw-social-profile-cell {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.ftw-social-profile-cell-label {
  display: block;
  font-size: 12px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ftw-social-profile-cell-value {
  display: block;
  font-size: 16px;
  color: #111;
  margin-top: 4px;
}

.ftw-social-profile-description {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  white-space: pre-wrap;
  color: #333;
  margin-bottom: 20px;
}

@media (max-width: 760px) {
  .ftw-social-profile-grid { grid-template-columns: repeat(2, 1fr); }
  .ftw-social-modal .modal-body { padding: 20px; }
}

/* Inbox */
#ftw_social_inbox_modal .modal-dialog {
  max-width: min(1200px, 96vw);
}

#ftw_social_inbox_modal .modal-body {
  padding: 0;
  height: calc(100vh - 180px);
  display: flex;
}

.ftw-social-inbox-list {
  width: 340px;
  flex-shrink: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  overflow-y: auto;
}

.ftw-social-inbox-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ftw-social-inbox-thread-header {
  padding: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
  font-size: 18px;
  color: #111;
}

.ftw-social-inbox-thread {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbfa;
}

.ftw-social-inbox-empty {
  padding: 30px 20px;
  color: #777;
  text-align: center;
}

.ftw-social-convo {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  text-align: center;
}

.ftw-social-convo:hover,
.ftw-social-convo.active {
  background: rgba(19, 150, 118, 0.08);
}

.ftw-social-convo-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ftw-social-convo-name {
  color: #111;
  font-size: 15px;
}

.ftw-social-convo-snippet {
  color: #555;
  font-size: 13px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ftw-social-convo-date,
.ftw-social-msg-date {
  color: #999;
  font-size: 11px;
}

.ftw-social-msg {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.ftw-social-msg.is-mine {
  align-self: flex-end;
  background: #dff3ed;
}

.ftw-social-msg.is-theirs {
  align-self: flex-start;
  background: #ffffff;
}

.ftw-social-msg-trip {
  font-size: 11px;
  color: #139676;
  margin-bottom: 4px;
}

.ftw-social-msg-body {
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  color: #222;
}

.ftw-social-msg-date {
  text-align: right;
  margin-top: 4px;
}

.ftw-social-inbox-reply {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.ftw-social-inbox-reply textarea {
  flex: 1;
  min-height: 60px;
  resize: vertical;
}

.ftw-social-unread-badge {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e74c3c;
  color: #ffffff;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 760px) {
  #ftw_social_inbox_modal .modal-body { flex-direction: column; }
  .ftw-social-inbox-list { width: 100%; max-height: 35%; border-right: none; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
}

/* Join modal: edit mode + leave confirmation */
.ftw-social-join-title-chip {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 3px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ftw-social-leave-confirm {
  margin-top: 20px;
  padding: 22px;
  border-radius: 16px;
  background: #fdf4f3;
  border: 1px solid rgba(217, 83, 79, 0.25);
  text-align: center;
}

.ftw-social-leave-confirm > span {
  display: block;
  margin-bottom: 6px;
}

.ftw-social-leave-confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  color: #d9534f;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px !important;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(217, 83, 79, 0.15);
}

.ftw-social-leave-confirm-title {
  font-size: 18px;
  color: #333;
}

.ftw-social-leave-confirm-text {
  font-size: 14px;
  color: #777;
}

.ftw-social-leave-confirm .ftw-social-modal-actions {
  margin-top: 12px;
}

.ftw-social-modal .ftw-social-btn-secondary {
  background: #ffffff;
  color: #555;
  border: 1px solid #dde3e1;
  border-radius: 30px;
  padding: 10px 28px;
}

.ftw-social-modal .ftw-social-btn-secondary:hover {
  background: #f4f6f5;
}

.ftw-social-modal .ftw-social-btn-danger {
  background: #d9534f;
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 10px 28px;
  box-shadow: 0 6px 16px rgba(217, 83, 79, 0.3);
}

.ftw-social-modal .ftw-social-btn-danger:hover {
  background: #c9302c;
  color: #ffffff;
}
