/* ========== HEADER ========== */
.header-simple {
  padding: 14px 20px !important;
  min-height: auto !important;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Notification center modal */
.notification-center-modal {
  max-width: 520px;
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
}

.notification-center-body {
  padding: 0 24px 24px;
}

.notification-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.notification-filter {
  flex: 1;
  min-width: 90px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-filter.active {
  background: linear-gradient(135deg, #d4d4d4 0%, #f8f8f800 100%);
  color: #000000;
  border-color: transparent;
  box-shadow: 0 8px 16px rgb(0 0 0 / 25%);
}

.notification-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #f9fafb;
  border: 1px solid #eef2f7;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.notification-item.unread {
  border-color: #dbeafe;
  background: #eef2ff;
}

.notification-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.notification-item-content {
  flex: 1;
}

.notification-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.notification-item-message {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.4;
  margin-bottom: 6px;
}

.notification-timestamp {
  font-size: 12px;
  color: #9ca3af;
}

.notification-empty-state {
  text-align: center;
  padding: 40px 0;
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.notification-center-footer {
  border-top: 1px solid #f0f2f5;
  padding: 16px 24px;
  background: #f9fafb;
  text-align: right;
}

.btn-mark-read {
  border: none;
  background: linear-gradient(135deg, #e6e6e6 0%, #ffffff00 100%);
  color: #010000;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 20px rgb(207 207 207 / 12%);
  transition: transform 0.2s ease;
}

.btn-mark-read:hover {
  transform: translateY(-1px);
}

@media (min-width: 1200px) {
  .messenger-container {
    max-width: 1200px;
    min-height: calc(100vh - 140px);
    border-radius: 32px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
  }

  .messenger-sidebar {
    max-width: 380px;
  }

  .messenger-main {
    align-items: flex-start;
    justify-content: flex-start;
    background: #ffffff;
  }
}

.header-simple .logo-center img {
  height: 36px !important;
  max-height: 36px !important;
  width: auto !important;
}

/* ========== MESSENGER STYLE LAYOUT ========== */
.messenger-container {
  display: flex;
  width: 100%;
  max-width: 720px;
  min-height: 1280px;
  margin: 0 auto;
  background: #f8f9fb;
  overflow: hidden;
}

/* ========== SIDEBAR ========== */
.messenger-sidebar {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
  overflow: hidden;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.02);
}

/* Sidebar Header */
.sidebar-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  color: #1f2937;
  letter-spacing: -0.5px;
}

.sidebar-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.btn-icon:hover {
  background: #e5e7eb;
  color: #1f2937;
  transform: translateY(-1px);
}

.btn-icon:active {
  transform: translateY(0);
}

.badge-notification {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  border: 2px solid #ffffff;
}

/* Sidebar Search */
.sidebar-search {
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  color: #1f2937;
}

.search-input:focus {
  background: #ffffff;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
  color: #9ca3af;
}

/* Sidebar Tabs */
.sidebar-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-tab svg {
  stroke-width: 2;
  transition: all 0.2s ease;
}

.sidebar-tab:hover {
  background: #f3f4f6;
  color: #374151;
}

.sidebar-tab.active {
  background: linear-gradient(135deg, #dcfcd724 0%, #ffffff00 100%);
  color: #249129;
  box-shadow: 0 4px 12px rgb(102 126 234 / 0%);
}

.sidebar-tab.active svg {
  stroke: #36b85a;
}

/* Sidebar Content */
.sidebar-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-content.active {
  display: block;
}

/* Custom Scrollbar */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ========== CONVERSATIONS LIST ========== */
.conversations-list {
  padding: 8px 0;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  margin: 0 8px;
  border-radius: 12px;
}

.conversation-item:hover {
  background: #f9fafb;
  transform: translateX(2px);
}

.conversation-item.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
  border-left: 3px solid #667eea;
}

.conversation-item.unread {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.conversation-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 40%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 0 4px 4px 0;
}

.conversation-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.conversation-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.conversation-item:hover .conversation-avatar {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.conversation-item.unread .conversation-avatar {
  border-color: #667eea;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
}

/* Online Status Indicator */
.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #31a24c;
  border: 2px solid #fff;
}

.conversation-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.conversation-name {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.conversation-item:hover .conversation-name {
  color: #667eea;
}

.conversation-item.unread .conversation-name {
  font-weight: 700;
  color: #667eea;
}

.conversation-time {
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
  margin-left: 8px;
  font-weight: 500;
}

.conversation-item.unread .conversation-time {
  color: #667eea;
  font-weight: 600;
}

.conversation-preview {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-message {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  line-height: 1.4;
}

.conversation-item.unread .conversation-message {
  color: #374151;
  font-weight: 600;
}

.unread-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  min-width: 22px;
  height: 22px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
  border: 2px solid #ffffff;
}

/* Typing Indicator */
.typing-indicator-text {
  font-size: 13px;
  color: #667eea;
  font-style: italic;
}

/* ========== FRIENDS LIST ========== */
.friends-list {
  padding: 8px 0;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  margin: 0 8px;
  border-radius: 12px;
  cursor: pointer;
}

.friend-item:hover {
  background: #f9fafb;
  transform: translateX(2px);
}

.friend-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.friend-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.friend-item:hover .friend-avatar {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

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

.friend-name {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.friend-item:hover .friend-name {
  color: #667eea;
}

.friend-username {
  font-size: 13px;
  color: #65676b;
  margin: 0;
}

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

.btn-friend-message {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-friend-message:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========== MAIN AREA ========== */
.messenger-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fb 0%, #f1f3f5 100%);
  position: relative;
}

.messenger-main:empty {
  display: none;
}

.messenger-container:has(.messenger-main:empty) {
  max-width: 720px;
}

.messenger-container:has(.messenger-main:empty) .messenger-sidebar {
  max-width: 100%;
  box-shadow: none;
}

.messenger-empty {
  text-align: center;
  padding: 60px 40px;
  max-width: 420px;
}

.empty-icon {
  margin-bottom: 32px;
  opacity: 0.15;
  transform: scale(1.1);
}

.empty-icon svg {
  stroke: #667eea;
  stroke-width: 1.2;
}

.empty-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 10px 0;
  letter-spacing: -0.3px;
}

.empty-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

/* ========== EMPTY STATES ========== */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 72px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: #050505;
  margin: 0 0 8px 0;
}

.empty-state p {
  font-size: 14px;
  color: #65676b;
  margin: 0 0 20px 0;
}

.btn-empty-action {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-empty-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ========== LOADING STATE ========== */
.loading-state {
  padding: 40px 20px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e4e6eb;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-text {
  font-size: 14px;
  color: #65676b;
  font-weight: 500;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1280px) {
  .messenger-sidebar {
    max-width: 720px;
  }
  
  .sidebar-title {
    font-size: 20px;
  }
  
  .conversation-avatar,
  .conversation-avatar-wrapper {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 768px) {
  .messenger-container {
    height: calc(100vh - 60px - 70px);
  }
  
  .messenger-sidebar {
    max-width: 100%;
  }
  
  .messenger-main {
    display: none;
  }
  
  .sidebar-header {
    padding: 12px 16px;
  }
  
  .sidebar-title {
    font-size: 18px;
  }
  
  .btn-icon {
    width: 32px;
    height: 32px;
  }
  
  .btn-icon svg {
    width: 18px;
    height: 18px;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .messenger-container,
  .messenger-sidebar,
  .sidebar-header,
  .sidebar-search,
  .sidebar-tabs {
    background: #18191a;
    border-color: #3a3b3c;
  }
  
  .sidebar-title {
    color: #e4e6eb;
  }
  
  .search-input {
    background: #3a3b3c;
    color: #e4e6eb;
  }
  
  .search-input::placeholder {
    color: #b0b3b8;
  }
  
  .conversation-item,
  .friend-item {
    border-color: #3a3b3c;
  }
  
  .conversation-item:hover,
  .friend-item:hover,
  .sidebar-tab:hover {
    background: #3a3b3c;
  }
  
  .conversation-name,
  .friend-name,
  .empty-title {
    color: #e4e6eb;
  }
  
  .conversation-message,
  .friend-username,
  .conversation-time,
  .empty-subtitle {
    color: #b0b3b8;
  }
  
  .messenger-main {
    background: #18191a;
  }
}
