/**
 * Social Features CSS (Phase 2.4 & 2.5)
 * Friends, Notifications, and Trip Sharing UI
 */

/* ========================================
   HEADER ICON BUTTONS
   ======================================== */

.btn-icon {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Header icons should be white */
.app-header .btn-icon {
  color: white;
}

.app-header .btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.app-header .btn-icon svg {
  color: white;
  stroke: white;
}

/* Non-header icons use text color */
.btn-icon svg {
  color: var(--text-primary);
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger-color);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

/* ========================================
   SIDE PANELS (Notifications & Friends)
   ======================================== */

.notifications-panel,
.friends-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.notifications-panel.active,
.friends-panel.active {
  display: block;
}

.notifications-panel-overlay,
.friends-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.notifications-panel-content,
.friends-panel-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--bg-primary);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.notifications-panel-header,
.friends-panel-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.notifications-panel-header h3,
.friends-panel-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.notifications-header-actions,
.friends-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notifications-panel-close,
.friends-panel-close {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notifications-panel-close:hover,
.friends-panel-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.btn-text {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.btn-text:hover {
  background-color: rgba(33, 150, 243, 0.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notifications-panel-body,
.friends-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* ========================================
   NOTIFICATIONS LIST
   ======================================== */

.notification-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  position: relative;
}

.notification-item:hover {
  background-color: var(--bg-secondary);
}

.notification-item.unread {
  background-color: rgba(33, 150, 243, 0.05);
}

.notification-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 50%;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

.notification-item:hover .notification-delete {
  opacity: 1;
}

.notification-delete:hover {
  background-color: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

.notification-delete:active {
  transform: scale(0.95);
}

.notification-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.notification-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.notification-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.notification-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.notification-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.notifications-empty,
.friends-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.notifications-empty svg,
.friends-empty svg {
  margin-bottom: 16px;
  opacity: 0.3;
}

.notifications-empty p,
.friends-empty p {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.friends-empty small {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========================================
   FRIENDS TABS
   ======================================== */

.friends-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  position: sticky;
  top: 61px;
  z-index: 9;
}

.friends-tab {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.friends-tab:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.friends-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-count {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.friends-tab.active .tab-count {
  background: rgba(33, 150, 243, 0.1);
  color: var(--primary-color);
}

.friends-tab-content {
  display: none;
}

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

/* ========================================
   FRIENDS LIST
   ======================================== */

.friends-list {
  padding: 0;
}

.friend-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s;
}

.friend-item:hover {
  background-color: var(--bg-secondary);
}

.friend-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.friend-email {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.friend-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.friend-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.friend-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon-sm {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-sm:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.btn-icon-sm.danger:hover {
  background-color: rgba(244, 67, 54, 0.1);
  color: var(--danger-color);
}

/* ========================================
   MODALS (Add Friend, Share Trip)
   ======================================== */

.modal-sm .modal-content {
  max-width: 400px;
}

.modal-md .modal-content {
  max-width: 500px;
}

.modal-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 20px 0;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 16px;
}

.alert-error {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
}

.alert-success {
  background: #efe;
  border: 1px solid #cfc;
  color: #3c3;
}

/* ========================================
   SHARE TRIP MODAL
   ======================================== */

.share-section {
  margin-bottom: 24px;
}

.share-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.participant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.participant-info {
  flex: 1;
  min-width: 0;
}

.participant-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.participant-role {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.participant-actions {
  display: flex;
  gap: 4px;
}

.friends-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.friend-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.friend-select-item:hover {
  background-color: #e8e8e8;
}

.friend-select-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.friend-select-item.disabled:hover {
  background-color: var(--bg-secondary);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInFromRight 0.3s ease-out;
  min-width: 300px;
}

@keyframes slideInFromRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.removing {
  animation: slideOutToRight 0.3s ease-out forwards;
}

@keyframes slideOutToRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text-primary);
}

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

@media (max-width: 768px) {
  .notifications-panel-content,
  .friends-panel-content {
    max-width: 75vw; /* Leave 25% space on left */
  }

  .toast-container {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    min-width: 0;
  }
}

