/*! Aleph1-Layout
 * responsive layout framework
 *
 * Author: Essoudry Avraham
 */
/* Variables
 * ===============
 *
 * All variables and most of the configuration is defined on this page. */
/* Containers */
/* Breakpoints */
/* Padding */
/* Divider */
/* Mixins
  =============== */
/* Reset
  =============== */
/* Helpers
  =============== */
.a1-full-height {
  height: 100%;
}

.a1-self-center {
  align-self: center;
}

.a1-self-stretch {
  align-self: stretch;
}

.a1-padding {
  padding: 1rem;
}

.a1-padding-lr {
  padding-left: 1rem;
  padding-right: 1rem;
}

.a1-half-padding-tb {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.a1-padding-tb {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.a1-margin {
  margin: 1rem;
}

.a1-margin-lr {
  margin-left: 1rem;
  margin-right: 1rem;
}

.a1-margin-tb {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Layout
  =============== */
.a1-row,
.a1-column {
  display: flex;
  flex-wrap: nowrap;
  overflow: auto;
}

.a1-row.a1-end,
.a1-column.a1-end {
  justify-content: flex-end;
}

.a1-row.a1-no-scroll, .a1-row.a1-magic-scroll,
.a1-column.a1-no-scroll,
.a1-column.a1-magic-scroll {
  overflow: hidden !important;
}

.a1-row.a1-magic-scroll:hover,
.a1-column.a1-magic-scroll:hover {
  overflow: auto !important;
}

.a1-row.a1-overflow-visible,
.a1-column.a1-overflow-visible {
  overflow: visible !important;
}

.a1-row.a1-justify-items,
.a1-column.a1-justify-items {
  justify-content: space-between;
}

.a1-row.a1-same-size > *,
.a1-column.a1-same-size > * {
  flex: 1 1 0px;
  overflow: auto;
}

.a1-row > *,
.a1-column > * {
  flex: 0 0 auto;
}

.a1-row > .a1-long,
.a1-column > .a1-long {
  flex: 1 0 auto;
}

.a1-row > .a1-elastic,
.a1-column > .a1-elastic {
  flex: 0 1 auto;
  overflow: auto;
}

.a1-row > .a1-elastic.a1-long,
.a1-column > .a1-elastic.a1-long {
  flex: 1 1 auto;
}

.a1-row.a1-divided-items > :not(:first-child),
.a1-column.a1-divided-items > :not(:first-child) {
  overflow: visible;
  position: relative;
}

.a1-row.a1-divided-items > :not(:first-child):after {
  content: "";
  position: absolute;
  height: 100%;
  top: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.a1-row:not(.a1-reverse) {
  flex-direction: row;
}

.a1-row:not(.a1-reverse).a1-spaced-items > :not(:first-child) {
  margin-left: 1rem;
}

.a1-row:not(.a1-reverse).a1-half-spaced-items > :not(:first-child) {
  margin-left: 0.5rem;
}

.a1-row:not(.a1-reverse).a1-divided-items > :not(:first-child):after {
  left: -0.5rem;
}

.a1-row.a1-reverse {
  flex-direction: row-reverse;
}

.a1-row.a1-reverse.a1-spaced-items > :not(:first-child) {
  margin-right: 1rem;
}

.a1-row.a1-reverse.a1-half-spaced-items > :not(:first-child) {
  margin-right: 0.5rem;
}

.a1-row.a1-reverse.a1-divided-items > :not(:first-child):after {
  right: -0.5rem;
}

.a1-row.a1-center-items-h {
  justify-content: center;
}

.a1-row.a1-center-items-v {
  align-items: center;
}

.a1-column.a1-divided-items > :not(:first-child):after {
  content: "";
  position: absolute;
  width: 100%;
  left: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.a1-column:not(.a1-reverse) {
  flex-direction: column;
}

.a1-column:not(.a1-reverse).a1-spaced-items > :not(:first-child) {
  margin-top: 1rem;
}

.a1-column:not(.a1-reverse).a1-divided-items > :not(:first-child):after {
  top: -0.5rem;
}

.a1-column.a1-reverse {
  flex-direction: column-reverse;
}

.a1-column.a1-reverse.a1-spaced-items > :not(:first-child) {
  margin-bottom: 1rem;
}

.a1-column.a1-reverse.a1-divided-items > :not(:first-child):after {
  bottom: -0.5rem;
}

.a1-column.a1-center-items-h {
  align-items: center;
}

.a1-column.a1-center-items-v {
  justify-content: center;
}

.a1-ltr {
  direction: ltr;
}

.a1-rtl {
  direction: rtl;
}

.a1-rtl .a1-row:not(.a1-reverse).a1-spaced-items > :not(:first-child), .a1-rtl.a1-row:not(.a1-reverse).a1-spaced-items > :not(:first-child) {
  margin-left: 0;
  margin-right: 1rem;
}

.a1-rtl .a1-row:not(.a1-reverse).a1-divided-items > :not(:first-child):after, .a1-rtl.a1-row:not(.a1-reverse).a1-divided-items > :not(:first-child):after {
  left: unset;
  right: -0.5rem;
}

.a1-rtl .a1-row.a1-reverse.a1-spaced-items > :not(:first-child), .a1-rtl.a1-row.a1-reverse.a1-spaced-items > :not(:first-child) {
  margin-left: 1rem;
  margin-right: 0;
}

.a1-rtl .a1-row.a1-reverse.a1-divided-items > :not(:first-child):after, .a1-rtl.a1-row.a1-reverse.a1-divided-items > :not(:first-child):after {
  left: -0.5rem;
  right: unset;
}

:root {
  --bg-main: #dadbd3;
  --dark-green: #009688;
  --chat-bg: #e5ddd5;
  --scroll-thumb: rgba(0, 0, 0, 0.2);
  --scroll-track: rgba(255, 255, 255, 0.08);
  --white: #fff;
  --black: #000;
  --side-panel: var(--white);
  --text-color: #000;
  --secondary-text-color: #00000070;
  --secondary-panel: #ededed;
  --green: #04d755;
  --light-green: #dbf8c6;
  --blue: #85cff2;
  --icon: #919191;
  --grey: #c2c2c2;
  --border: #00000014;
  --border-lighter: #00000009;
}

.dark-mode {
  --dark-green: #003f39;
  --bg-main: #121212;
  --chat-bg: #191919;
  --scroll-thumb: rgba(255, 255, 255, 0.2);
  --scroll-track: rgba(0, 0, 0, 0.08);
  --side-panel: #222222;
  --text-color: var(--white);
  --secondary-text-color: #ffffff70;
  --secondary-panel: #262626;
}

/* Fix input text colors in dark mode */
.dark-mode input[type="text"],
.dark-mode input[type="color"],
.dark-mode textarea {
  background: var(--secondary-panel) !important;
  color: var(--white) !important;
  border-color: #444 !important;
}

/* Exception: Chat message input should remain white with black text */
.dark-mode #messageInput {
  background: #fff !important;
  color: #000 !important;
  border-color: var(--border) !important;
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
  color: var(--secondary-text-color) !important;
}

.dark-mode #messageInput::placeholder {
  color: #999 !important;
}

/* Quick Reply Items Styling */
.quick-reply-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.dark-mode .quick-reply-item {
  background: var(--secondary-panel);
  border-color: #444;
}

.quick-reply-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

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

.quick-reply-shortcut {
  font-weight: 600;
  font-size: 14px;
  color: var(--dark-green);
  margin-bottom: 4px;
}

.quick-reply-message {
  font-size: 13px;
  color: var(--secondary-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-reply-actions button {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.quick-reply-actions button:hover {
  opacity: 1;
  background: rgba(255, 0, 0, 0.1);
}

/* Tags Items Styling */
.tag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.dark-mode .tag-item {
  background: var(--secondary-panel);
  border-color: #444;
}

.tag-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.tag-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.tag-color-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.tag-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-color);
}

.tag-actions button {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.tag-actions button:hover {
  opacity: 1;
  background: rgba(255, 0, 0, 0.1);
}

/* Search Bar Styling */
.search-bar {
  background: var(--side-panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark-mode .search-bar {
  background: #2a2a2a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-bar-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-bar-content i {
  color: var(--icon);
  cursor: pointer;
  font-size: 18px;
  transition: color 0.2s;
}

.search-bar-content i:hover {
  color: var(--text-color);
}

#searchInChatInput {
  flex: 1;
  padding: 8px 12px;
  background: var(--side-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 14px;
}

.search-result-count {
  font-size: 13px;
  color: var(--secondary-text-color);
  white-space: nowrap;
}

.search-navigation {
  display: flex;
  gap: 8px;
}

.search-navigation i {
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.search-navigation i:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dark-mode .search-navigation i:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Message highlight for search */
.message-highlight {
  background: #ffeb3b !important;
  color: #000 !important;
  padding: 2px 4px;
  border-radius: 3px;
}

.dark-mode .message-highlight {
  background: #ffc107 !important;
  color: #000 !important;
}

/* Chat Options Dropdown */
.chat-options-dropdown {
  position: fixed;
  /* top and right will be set by JavaScript */
  background: var(--side-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 10000;
  overflow: hidden;
}

.dark-mode .chat-options-dropdown {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-color);
  font-size: 14px;
}

.dropdown-item:hover {
  background: var(--secondary-panel);
}

.dropdown-item i {
  width: 20px;
  text-align: center;
  color: var(--icon);
}

/* ============================================
   STATISTICS DASHBOARD STYLING
   ============================================ */

/* Stats Grid - Cards Layout */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Stat Card */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dark-mode .stat-card {
  background: var(--secondary-panel);
  border-color: #333;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--dark-green);
}

.stat-card.info::before {
  background: #3b82f6;
}

.stat-card.warning::before {
  background: #f59e0b;
}

.stat-card.success::before {
  background: #10b981;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary-text-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 4px;
  line-height: 1;
}

.stat-subvalue {
  font-size: 13px;
  color: var(--secondary-text-color);
}

/* Stats Section */
.stats-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.dark-mode .stats-section {
  background: var(--secondary-panel);
  border-color: #333;
}

.stats-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* Top Contacts List */
.top-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.top-contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--side-panel);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.dark-mode .top-contact-item {
  background: rgba(255, 255, 255, 0.05);
}

.top-contact-item:hover {
  background: var(--bg-main);
  transform: translateX(4px);
}

.top-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-contact-rank {
  width: 32px;
  height: 32px;
  background: var(--dark-green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.top-contact-name {
  font-weight: 500;
  color: var(--text-color);
}

.top-contact-count {
  font-weight: 600;
  color: var(--dark-green);
  font-size: 14px;
}

/* Chart Container */
.chart-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-label {
  min-width: 100px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-color);
}

.chart-bar-bg {
  flex: 1;
  height: 40px;
  background: var(--side-panel);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.dark-mode .chart-bar-bg {
  background: rgba(255, 255, 255, 0.05);
}

.chart-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  transition: width 0.8s ease;
  position: relative;
  /* Default gradient for hourly charts */
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.chart-bar-fill.sent {
  background: linear-gradient(90deg, #10b981, #059669);
}

.chart-bar-fill.received {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.chart-value {
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Message Types Grid */
.message-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.message-type-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--side-panel);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.dark-mode .message-type-badge {
  background: rgba(255, 255, 255, 0.05);
  border-color: #333;
}

.message-type-badge:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.message-type-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.message-type-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary-text-color);
  margin-bottom: 4px;
  text-transform: capitalize;
}

.message-type-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-color);
}

/* Daily Trend Grid */
.daily-trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.trend-day {
  background: var(--side-panel);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.dark-mode .trend-day {
  background: rgba(255, 255, 255, 0.05);
}

.trend-day:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.trend-date {
  font-size: 11px;
  color: var(--secondary-text-color);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 500;
}

.trend-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 4px;
}

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

/* Loading State */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--secondary-text-color);
  font-size: 14px;
}

::placeholder {
  color: var(--grey);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb);
}

::-webkit-scrollbar-track {
  background-color: var(--scroll-track);
}

.bg-left-panel-header {
  background-color: var(--secondary-panel);
}

.bg-white {
  background-color: var(--white);
}

.icon-color {
  color: var(--icon);
}

.secondary-panel {
  color: var(--secondary-panel);
}

.grey {
  color: var(--grey);
}

.blue {
  color: var(--blue);
}

html,
body {
  height: 100%;
  line-height: unset;
}

body {
  font-family: Segoe UI, Helvetica Neue, Helvetica;
  background: var(--bg-main);
  background: linear-gradient(180deg, var(--dark-green) 14%, var(--bg-main) 14%, var(--bg-main) 100%);
  color: var(--text-color);
}

i {
  cursor: pointer;
}

section.container {
  position: relative;
  margin: 0 10% 0 10%;
  height: calc(100% - 38px);
  top: 19px;
  box-shadow: 0 1px 1px 0 var(--border), 0 2px 6px 0 var(--border);
}

.aside {
  flex: 30%;
  min-width: 270px;
}

.main {
  flex: 70%;
}

.profile-pic {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}
.profile-pic.side-friend-profile-pic {
  width: 42px;
  height: 42px;
}

.border-r {
  border-right: 1px solid var(--border);
}

.border-b {
  border-bottom: 1px solid var(--border);
}

.search, .friends-panel {
  background-color: var(--side-panel);
}

.search {
  border-bottom: 1px solid var(--border);
}
.search input[type=text] {
  border: unset;
  background: transparent;
  color: var(--text-color);
}
.search input[type=text]:focus {
  outline: 0;
}

.notification,
.pin-wrap {
  align-self: flex-end;
  border-radius: 50%;
}

.pin-wrap {
  background-color: var(--grey);
  color: var(--white);
  width: 18px;
  height: 18px;
  font-size: 0.6rem;
}

.notification {
  text-align: center;
  background-color: var(--green);
  color: var(--white);
  width: 20px;
  height: 20px;
  font-size: 0.8rem;
}

.timestamp {
  color: var(--grey);
  font-size: 0.8rem;
}

.message-preview {
  max-width: 90%;
  font-size: 0.9em;
  color: var(--secondary-text-color);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.friend i.fa-chevron-down {
  display: none;
}
.friend:hover {
  cursor: pointer;
  background-color: var(--border-lighter);
}
.friend:hover i.fa-chevron-down {
  display: block;
}
.friend.active {
  background-color: var(--border);
}

.chat-container {
  background-color: var(--chat-bg);
}

.chat-main {
  padding: 1.8em;
}

.text {
  position: relative;
  border-radius: 0.6em;
  max-width: 50%;
  padding: 0.2em 0.6em 0.1em 0.6em;
  color: var(--black);
}
.text.text-recieved {
  align-self: flex-start;
  background-color: var(--white);
}
.text.text-recieved::after {
  content: "";
  display: block;
  position: absolute;
  width: 0;
  height: 0;
  border: 17px solid transparent;
  border-right-color: var(--white);
  border-left: 0;
  border-top: 0;
  top: 0;
  left: -9.5px;
}
.text.text-sent {
  align-self: flex-end;
  background-color: var(--light-green);
}
.text.text-sent::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 17px solid transparent;
  border-left-color: var(--light-green);
  border-right: 0;
  border-top: 0;
  top: 0;
  right: -9.5px;
}

.chat-input {
  border: none;
  border-radius: 21px;
  padding-left: 10px;
  padding: 0.8rem 0 0.8rem 12px;
  background-color: var(--white);
}
.chat-input:focus {
  outline: 0;
}

.fa-1half {
  font-size: 1.5rem;
}

.back-arrow {
  display: none;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--side-panel);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 75px rgba(0, 0, 0, 0.2);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 19px;
  font-weight: 400;
  color: var(--text-color);
}

.modal-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--grey);
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.modal-close:hover {
  background: var(--border-lighter);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media only screen and (max-width: 962px) {
  .main {
    position: fixed;
    right: -100%;
    top: 0;
    bottom: 0;
    width: 100%;
    transition: transform 0.4s;
  }

  .open-message {
    transform: translateX(-100%);
  }

  .back-arrow {
    display: block;
  }
}
@media only screen and (max-width: 1440px) {
  section.container {
    height: 100%;
    margin: unset;
    top: 0;
  }
}

/* ============================================
   CONTACTS STYLING
   ============================================ */

/* Contact form inputs - dark mode fix */
.dark-mode #contactName,
.dark-mode #contactPhone,
.dark-mode #contactsSearchInput {
  background: #2a2a2a !important;
  color: #e1e1e1 !important;
  border-color: #444 !important;
}

.dark-mode #contactName::placeholder,
.dark-mode #contactPhone::placeholder,
.dark-mode #contactsSearchInput::placeholder {
  color: #888 !important;
}

.contacts-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dark-mode .contact-item {
  background: var(--secondary-panel);
  border-color: #444;
}

.contact-item:hover {
  background: var(--side-panel);
  border-color: var(--dark-green);
  transform: translateX(4px);
}

.dark-mode .contact-item:hover {
  background: #2a2a2a;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dark-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

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

.contact-details {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-weight: 500;
  font-size: 15px;
  color: var(--text-color);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-phone {
  font-size: 13px;
  color: var(--grey);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.delete-contact-btn {
  background: transparent;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.delete-contact-btn:hover {
  background: rgba(231, 76, 60, 0.1);
  transform: scale(1.1);
}

.empty-chat-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--grey);
  font-size: 14px;
}
