/* Base Styles with Google Fonts */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", "Roboto", sans-serif;
}

:root {
  --primary-color: #0085ff;
  --secondary-color: #ff8a00;
  --sidebar-bg: #0a2342;
  --outgoing-msg-bg: #0085ff;
  --incoming-msg-bg: #f1f1f1;
  --active-bg: #eaf3fc;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --border-color: #eee;
  --hover-bg: #f5f5f5;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --white: #fff;
  --red: #ff3b30;
  --green: #34c759;
  --avatar-blue: #4a86e8;
  --avatar-teal: #00a3a3;
  --avatar-purple: #9c27b0;
  --avatar-cyan: #00bcd4;
  --star-color: #f1c40f;
  --active-color: #e8f0fe;
  --hover-color: #f5f5f5;
  --light-text: #999;
  --text-color: #333;
}

/* Dark Mode Variables */
body.dark-mode {
  --primary-color: #3b82f6;
  --secondary-color: #f97316;
  --sidebar-bg: #111827;
  --outgoing-msg-bg: #3b82f6;
  --incoming-msg-bg: #374151;
  --active-bg: #1e293b;
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-light: #9ca3af;
  --border-color: #1f2937;
  --hover-bg: #1f2937;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --white: #111827;
  --red: #ef4444;
  --green: #10b981;
  --star-color: #eab308;
  --active-color: #1e40af;
  --hover-color: #1f2937;
  --light-text: #9ca3af;
  --text-color: #f3f4f6;
}

body {
  background-color: #051440;
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
}

.search-container{
  background-color: #f3f4f6;
  border-radius: 7px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed), width 0.3s cubic-bezier(0.4,0,0.2,1);
  margin-left: auto; /* Pushes the search bar to the right */
  box-sizing: border-box;
  cursor: pointer;
  width: 300px;
  max-width: 100%;
  height: 35px;
  border: 1px solid #b6e3fa; /* Added light blue border */
  margin-right: 1%;
}

.search-container:focus-within,
.search-container.expanded {
  width: 800px;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.search-container:active,
.search-container:focus-within {
  background-color: #f3f4f6;
}

.search-container input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-color);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 349px;
  max-height: 300px;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px var(--shadow-color);
  z-index: 100;
  overflow-y: auto;
  display: none;
}

.search-results.show {
  display: block;
}

.search-result-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.search-result-item:hover {
  background-color: var(--bg-color);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.search-result-date {
  font-size: 12px;
  color: var(--text-light);
}


/* App Container */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 3rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: calc(100% - 60px);
}

/* Enhanced Navigation Bar */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  /* box-shadow: 0 2px 4px var(--shadow-color); */
  width: 100%;
  position: fixed;
  top: 0;
  background-color: #ffffff;
  z-index: 100;
  height: 60px;
}

body.dark-mode .top-nav {
  background-color: var(--white);
}

/* Navigation Center - Quill Toolbar */
.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
  margin: 0 2rem;
}

.nav-quill-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
  max-width: 800px;
  overflow-x: auto;
}

body.dark-mode .nav-quill-toolbar {
  background-color: #374151;
}

.nav-format-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
}

.nav-format-btn:hover {
  background-color: var(--hover-color);
}

.nav-format-btn.active {
  background-color: var(--active-color);
  color: var(--primary-color);
}

.nav-format-select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
  color: var(--text-color);
  font-size: 12px;
  cursor: pointer;
  outline: none;
  min-width: 80px;
}

body.dark-mode .nav-format-select {
  background-color: #374151;
  color: var(--text-color);
}

/* Navigation Dropdowns */
.nav-dropdown {
  position: relative;
}

.nav-color-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 8px;
  z-index: 1000;
  display: none;
  margin-top: 4px;
}

body.dark-mode .nav-color-menu {
  background-color: #1f2937;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Enhanced Notification Dropdown */
.notification-dropdown {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 100vh;
  max-height: 100vh;
  background-color: white;
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  margin-top: 0;
}

body.dark-mode .notification-dropdown {
  background-color: #1f2937;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

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

.notification-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.mark-all-read {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 12px;
}

.notification-list {
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

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

.notification-item.unread {
  background-color: #f0f8ff;
  border-left: 3px solid var(--primary-color);
}

body.dark-mode .notification-item.unread {
  background-color: #1e40af;
}

.notification-subject {
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 4px;
}

.notification-preview {
  font-size: 12px;
  color: #000;
  margin-bottom: 4px;
}

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

/* Enhanced Help Dropdown */
.help-dropdown {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 100vh;
  max-height: 100vh;
  background-color: white;
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  margin-top: 0;
  flex-direction: column;
}

body.dark-mode .help-dropdown {
  background-color: #1f2937;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.help-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.help-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.help-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.help-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.2s;
  gap: 12px;
}

.help-item:hover {
  background-color: var(--hover-color);
}

.help-item i {
  font-size: 20px;
  color: #8b8b8b;
}

/* Enhanced Settings Dropdown */
.settings-dropdown {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 100vh;
  max-height: 100vh;
  background-color: white;
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  margin-top: 0;
  flex-direction: column;
}

body.dark-mode .settings-dropdown {
  background-color: #1f2937;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.settings-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.settings-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.settings-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.settings-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.2s;
  gap: 12px;
}

.settings-item:hover {
  background-color: var(--hover-color);
}

.settings-item.logout {
  color: var(--red);
}

.settings-item i {
  font-size: 20px;
  color: #8b8b8b;
}

.settings-item.logout i {
  color: var(--red);
}

.settings-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 8px 0;
}

/* Theme Toggle Button */
.theme-toggle {
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: rotate(180deg);
}

/* Logo Styles */
.logo {
  display: flex;
  align-items: center;
}

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

.logo-img {
  width: 2rem;
  height: 2rem;
  margin-right: 0.5rem;
}

.logo-saga {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.25rem;
}

.logo-chat {
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 1.25rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-right: 3%;
}

.search-container {
  position: relative;
}

.search-input {
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  width: 12rem;
}

body.dark-mode .search-input {
  background-color: var(--hover-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

.search-container i {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.875rem;
}

.nav-icon {
  /* width: 2.5rem;
  height: 2.5rem; */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

.nav-icon:hover {
  background-color: var(--hover-bg);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--red);
  color: var(--white);
  font-size: 0.7rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content Area */
.main-content {
  /* padding: 3px; */
  background-color: #e0e0e0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.dark-mode .main-content {
  background-color: #1f2937;
}

/* Top Header */
.top-header {
  display: flex;
  border-radius: 5px;
  justify-content: space-between;
  align-items: center;
  padding: 0px 1px;
  background-color: #f2fbff;
  border-bottom: 1px solid var(--border-color);
}

body.dark-mode .top-header {
  background-color: #111827;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border-radius: 8px;
  padding: 8px 15px;
  width: 500px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark-mode .search-bar {
  background-color: #374151;
}

.search-bar i {
  color: var(--light-text);
  margin-right: 10px;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--text-color);
}

.header-actions {
  display: flex;
  gap: 15px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-text);
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background-color: var(--hover-color);
}

/* Email Container */
.email-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #ffffff;
  margin-top: 60px;
}

body.dark-mode .email-container {
  background-color: var(--white);
}



/* Action Toolbar */
.action-toolbar {
  display: flex;
  border-radius: 5px;
  margin-top: 10px;
  margin-bottom: 2px;
  justify-content: space-between;
  padding: 5px 20px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  height: 50px;
}

body.dark-mode .action-toolbar {
  background-color: #1f2937;
}

@media (max-width: 1024px) {
  .action-toolbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    gap: 10px;
  }

  .toolbar-left {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }

  .toolbar-right {
    justify-content: flex-end;
    width: 100%;
  }

  .toolbar-btn {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) {
  .toolbar-left {
    flex-direction: column;
    width: 100%;
  }

  .toolbar-btn {
    justify-content: flex-start;
    width: 100%;
  }

  .dropdown-menu {
    position: relative;
    width: 100%;
  }
}



.toolbar-left {
  display: flex;
  gap: 1px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  gap: 4px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--text-color);
  transition: background-color 0.2s;
}

.toolbar-btn:hover {
  background-color: var(--hover-color);
}

/* Formatting Toolbar */
.formatting-toolbar {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping to second line */
  overflow-x: auto;   /* Allow horizontal scroll if icons overflow */
  border-radius: 5px;
  margin-top: 3px;
  margin-bottom: 3px;
  padding: 5px 10px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  gap: 5px;
  position: sticky;
  top: 0;
  z-index: 10;
  height: 48px; /* Fixed height for toolbar */
}

/* Hide some formatting-toolbar features on small screens, show "More" option */
@media (max-width: 900px) {
  .formatting-toolbar .toolbar-section:not(:first-child):not(:last-child) {
    display: none;
  }
  .formatting-toolbar .toolbar-section.more-options {
    display: flex !important;
  }
}

/* "More" option styling */
.formatting-toolbar .toolbar-section.more-options {
  display: none;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.formatting-toolbar .more-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 2px 8px var(--shadow-color);
  z-index: 100;
  min-width: 150px;
  padding: 8px 0;
}

.formatting-toolbar .toolbar-section.more-options.open .more-dropdown {
  display: block;
}

body.dark-mode .formatting-toolbar {
  background-color: #1f2937;
}

body.dark-mode .formatting-toolbar {
  background-color: #1f2937;
}

.toolbar-section {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.format-select {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.format-btn {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  position: relative;
}

.format-btn:hover {
  background-color: var(--hover-color);
}

.format-btn.active {
  background-color: var(--active-color);
  color: var(--primary-color);
}

.format-btn-group {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  padding-bottom: 2;
}

.format-btn-group .format-btn {
  border-radius: 0;
  border-right: 1px solid var(--border-color);
}

.format-btn-group .format-btn:last-child {
  border-right: none;
}

.format-select {
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  min-width: 100px;
}

body.dark-mode .format-select {
  background-color: #374151;
  color: var(--text-color);
}

/* Mini Formatting Toolbar */
.mini-formatting-toolbar {
  display: none;
  flex-wrap: wrap;
  border-radius: 5px;
  margin-top: 3px;
  margin-bottom: 3px;
  padding: 5px 10px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  gap: 5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

body.dark-mode .mini-formatting-toolbar {
  background-color: #1f2937;
}

/* Floating Format Toolbar */
.floating-format-toolbar {
  display: none;
  position: absolute;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 5px;
  z-index: 1000;
  gap: 5px;
}

body.dark-mode .floating-format-toolbar {
  background-color: #1f2937;
}

/* Color Picker */
.format-dropdown {
  position: relative;
}

.color-picker-menu {
  width: 220px;
  padding: 10px;
}

.color-picker-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text-color);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.color-cell {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.1s;
}

.color-cell:hover {
  transform: scale(1.1);
}

.color-picker-footer {
  font-size: 14px;
  color: var(--light-text);
  cursor: pointer;
  padding: 5px 0;
}

.color-picker-footer:hover {
  color: var(--primary-color);
}

/* Send Button Container */
.send-button-container {
  /* display: none; */
  justify-content: flex-end;
  padding: 5px 20px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
}

body.dark-mode .send-button-container {
  background-color: #1f2937;
}

.compose-btns {
  display: flex;
  align-items: center;
  gap: 5px;
}

.send-btn {
  background-color: var(--primary-color);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.send-dropdown-btn {
  background-color: var(--primary-color);
  color: white;
  padding: 8px 10px;
  border-radius: 0 4px 4px 0;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.send-btn:hover,
.send-dropdown-btn:hover {
  background-color: #01569c;
}

body.dark-mode .send-btn:hover,
body.dark-mode .send-dropdown-btn:hover {
  background-color: #1e40af;
}

.send-options-menu {
  min-width: 200px;
}

.discard-btn {
  background-color: #f5f5f5;
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  transition: background-color 0.2s;
}

body.dark-mode .discard-btn {
  background-color: #374151;
}

.discard-btn:hover {
  background-color: #c4c4c4;
}

body.dark-mode .discard-btn:hover {
  background-color: #4b5563;
}

/* Dropdown Menus */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 100;
  display: none;
  margin-top: 5px;
}

body.dark-mode .dropdown-menu {
  background-color: #1f2937;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
  display: block;
  padding: 10px 15px;
  transition: background-color 0.2s;
  color: var(--text-color);
  text-decoration: none;
}

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

.dropdown.active .dropdown-menu {
  display: block;
}

/* Email Content Panels */
.email-fullscreen {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Folder Panel */
.folder-panel {
  width: 220px;
  border-radius: 5px;
  background-color: white;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

body.dark-mode .folder-panel {
  background-color: #1f2937;
}

.user-profile {
  display: flex;
  align-items: center;
  padding: 15px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.user-profile:hover {
  background-color: var(--hover-color);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--avatar-blue);
  color: rgb(255, 255, 255);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 10px;
}

.avatar.large {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

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

.avatar.teal {
  background-color: var(--avatar-teal);
}

.avatar.purple {
  background-color: var(--avatar-purple);
}

.avatar.cyan {
  background-color: var(--avatar-cyan);
}

.user-info h3 {
  font-size: 14px;
  margin-bottom: -4.5px;
  color: var(--text-color);
}

.user-info p {
  font-size: 12px;
  color: var(--light-text);
}

.compose-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 10px auto;
  padding: 8px 16px;
  background-color: #44b1fa;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  width: fit-content;
  transition: background-color 0.1s, transform 0.1s ease;
  cursor: pointer;
  border: #e7e7e7 1px solid;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
  color: white;
}

body.dark-mode .compose-btn {
  background-color: #3b82f6;
  border-color: #1f2937;
}

.compose-btn:hover {
  transform: translateY(-2px);
  background-color: #7dcef7;
}

body.dark-mode .compose-btn:hover {
  background-color: #60a5fa;
}

.folder-list {
  padding: 15px 0;
  border-radius: 8px;
  width: 100%;
  font-family: Arial, sans-serif;
}

.folder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 10px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 15px;
  transition: background-color 0.2s ease;
  margin-bottom: 2px;
  border-radius: 6px;
}

.folder-item:hover {
  background-color: var(--hover-color);
}

.folder-item.active {
  background-color: #e8f0fe;
  color: #1a73e8;
  font-weight: bold;
}

body.dark-mode .folder-item.active {
  background-color: #3b82f6;
  color: white;
}

.icon-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.badge {
  background-color: #dbe0e3;
  color: #333;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  min-width: 30px;
  text-align: center;
}

body.dark-mode .badge {
  background-color: #4b5563;
  color: #e5e7eb;
}

.folder-item.active .badge {
  background-color: #1a73e8;
  color: #fff;
}

body.dark-mode .folder-item.active .badge {
  background-color: #2563eb;
}

/* Email List Panel */
.email-list-panel {
  width: 330px;
  margin-left: 3px;
  border-radius: 5px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: white;
}

body.dark-mode .email-list-panel {
  background-color: #1f2937;
}

.panel-header {
  display: flex;
  background-color: white;
  justify-content: space-between;
  align-items: center;
  padding: 1px 10px;
  border-bottom: 1px solid var(--border-color);
}

body.dark-mode .panel-header {
  background-color: #1f2937;
}

.panel-header h2 {
  font-size: 16px;
  /* margin-left: -40.3%; */
  color: var(--text-color);
}

.avatar-checkbox-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
}

.email-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #0d3338;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 16px;
  margin-left: auto;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
}

.email-checkbox {
  display: none;
  position: absolute;
  top: 10px;
  left: 5px;
  transform: scale(1.2);
}

#selectLable {
  display: none;
}

.email-checkbox {
  display: none;
}

.avatar-checkbox-wrapper.checked .email-avatar {
  display: none;
}

.avatar-checkbox-wrapper.checked .email-checkbox {
  display: inline-block;
}

.email-item:hover .email-avatar {
  display: none;
}

.email-item:hover .email-checkbox {
  display: inline-block;
}

.email-item.selected {
  background-color: #d8f3ff;
}

body.dark-mode .email-item.selected {
  background-color: #3b82f6;
}

.checkbox {
  display: flex;
  align-items: center;
}

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

.checkbox input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  height: 25px;
  width: 25px;
  cursor: pointer;
  z-index: 2;
}

.checkbox label {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: #f0f0f0;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s, border-color 0.2s;
}

body.dark-mode .checkbox label {
  background-color: #374151;
  border-color: #4b5563;
}

.checkbox input[type="checkbox"]:checked + label {
  background-color: #007bff;
  border-color: #007bff;
}

.checkbox input[type="checkbox"]:checked + label::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.list-actions {
  display: flex;
  gap: 10px;
}

.date-separator {
  padding: 5px 15px;
  background-color: #f9f9f9;
  font-weight: 500;
  font-size: 12px;
  color: var(--light-text);
}

body.dark-mode .date-separator {
  background-color: #111827;
}

.email-list {
  background-color: #ffffff;
  flex: 1;
  overflow-y: auto;
}

body.dark-mode .email-list {
  background-color: #1f2937;
}

.email-item {
  background-color: rgb(255, 255, 255);
  display: flex;
  padding: 18px 8px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.1s, transform 0.1s, box-shadow 0.1s;
  position: relative;
}

body.dark-mode .email-item {
  background-color: #1f2937;
}

.email-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  background-color: var(--hover-color);
}

.email-item.active {
  background-color: var(--active-color);
}

body.dark-mode .email-item.active {
  background-color: #374151;
}

.email-item.unread {
  font-weight: bold;
}

.email-item.hidden {
  display: none;
}

.email-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--avatar-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 15px;
  flex-shrink: 0;
}

.email-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 5px;
  margin-left: 10px;
}

.email-header {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
}

.email-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color);
}

.email-date {
  font-size: 12px;
  color: var(--light-text);
  margin-right: 10px;
}

.star-btn,
.edit-btn,
.not-spam-btn,
.restore-btn {
  color: #ccc;
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.star-btn.starred {
  color: var(--star-color);
}

.star-btn:hover {
  color: var(--star-color);
}

.edit-btn:hover {
  color: var(--primary-color);
}

.not-spam-btn:hover {
  color: #4caf50;
}

.restore-btn:hover {
  color: var(--primary-color);
}

.email-subject {
  font-weight: 500;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -5px;
  font-size: 12px;
  color: var(--text-color);
}

.email-preview {
  color: var(--light-text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -2px;
}

/* Email Quick Actions */
.email-quick-actions {
  position: absolute;
  right: 10px;
  top: 70%;
  transform: translateY(-50%);
  display: none;
  gap: 5px;
  background-color: white;
  padding: 5px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.dark-mode .email-quick-actions {
  background-color: #374151;
}

.email-item:hover .email-quick-actions {
  display: flex;
}

.quick-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-text);
  transition: background-color 0.2s;
}

.quick-action-btn:hover {
  background-color: var(--hover-color);
  color: var(--primary-color);
}

/* Email View Panel */
.email-view-panel {
  flex: 1;
  margin-left: 3px;
  border-radius: 5px;
  background-color: rgb(255, 255, 255);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

body.dark-mode .email-view-panel {
  background-color: #1f2937;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--light-text);
  text-align: center;
  padding: 20px;
}

.empty-icon {
  margin-bottom: 20px;
}

.envelope-icon {
  width: 250px;
  height: auto;
}

.empty-state h2 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-color);
}

/* Email Detail View */
.email-detail {
  padding: 20px;
}

.email-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.email-detail-subject {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.email-detail-actions {
  display: flex;
  gap: 10px;
}

.email-detail-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.sender-info {
  display: flex;
  align-items: center;
}

/* Enhanced Email Detail View */
.sender-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sender-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.sender-details {
  display: flex;
  flex-direction: column;
}

.sender-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 16px;
}

.sender-email {
  color: var(--text-light);
  font-size: 14px;
}

.sender-status {
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
}

.email-detail-date {
  color: var(--light-text);
  font-size: 12px;
}

.email-detail-recipients {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
  color: var(--text-color);
}

.email-detail-body {
  line-height: 1.6;
  color: var(--text-color);
}

.email-detail-body p {
  margin-bottom: 15px;
}

/* Compose View */
.compose-view,
.reply-view,
.forward-view {
  padding: 5px;
}

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

.compose-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.compose-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.from-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.from-label {
  color: var(--text-color);
  font-weight: 500;
}

.from-email-select {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s;
  color: var(--text-color);
}

.from-email-select:hover {
  background-color: var(--hover-color);
}

.from-dropdown-menu {
  min-width: 250px;
  left: 0;
  top: 100%;
}

.field-row {
  display: flex;
  align-items: flex-start;
  padding: 10px;
}

.field-label {
  background-color: #004466;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
}

body.dark-mode .field-label {
  background-color: #3b82f6;
}

.recipient-tags-container {
  display: flex;
  flex-wrap: wrap;
  flex-grow: 1;
  margin-left: 8px;
  padding: 4px;
  border: none;
  border-bottom: 1px solid #ddd;
  gap: 5px;
  align-items: center;
}

body.dark-mode .recipient-tags-container {
  border-bottom-color: #4b5563;
}

.recipient-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.recipient-tag {
  background-color: #e3f2fd;
  color: #0078d4;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

body.dark-mode .recipient-tag {
  background-color: #3b82f6;
  color: white;
}

.remove-tag {
  cursor: pointer;
  font-weight: bold;
}

.recipient-input {
  flex-grow: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text-color);
}

.cc-bcc-buttons {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

.cc-btn,
.bcc-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--light-text);
  cursor: pointer;
}

.cc-btn.active,
.bcc-btn.active {
  color: var(--primary-color);
}

.cc-row,
.bcc-row {
  display: none;
  margin-bottom: 12px;
}

.cc-row.visible,
.bcc-row.visible {
  display: flex;
  align-items: center;
}

.cc-label,
.bcc-label {
  min-width: 40px;
  text-align: center;
  color: var(--light-text);
}

.compose-field {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}

.compose-field label {
  width: 60px;
  color: var(--light-text);
}

.compose-field input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text-color);
}

.draft-status {
  padding: 10px;
  color: var(--light-text);
  font-size: 12px;
  text-align: right;
  font-style: italic;
}

blockquote {
  border-left: 3px solid rgb(85, 116, 163);
  padding-left: 15px;
  margin: 15px 0;
  color: var(--light-text);
}

/* Quill Editor Styles */
.ql-container.ql-snow {
  border: none !important;
  font-family: inherit;
}

.ql-editor {
  padding: 12px 15px !important;
  font-size: 14px;
  line-height: 1.5;
  min-height: 300px;
  color: var(--text-color);
}

body.dark-mode .ql-editor {
  color: var(--text-color);
}

.ql-toolbar.ql-snow {
  border: none !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 8px !important;
  display: none !important; /* Hide default Quill toolbar */
}

/* Selection Popup */
.ql-tooltip {
  z-index: 1000;
}

/* Attachment Styles */
.attachment-list {
  padding: 10px 15px;
  border-top: 1px dashed var(--border-color);
  margin-top: 10px;
}

.attachment-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background-color: #f5f5f5;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-color);
}

body.dark-mode .attachment-item {
  background-color: #374151;
}

.attachment-item i {
  margin-right: 8px;
  color: var(--primary-color);
}

.file-size {
  margin-left: 8px;
  color: var(--light-text);
  font-size: 12px;
}

.remove-attachment {
  margin-left: auto;
  color: var(--light-text);
  background: none;
  border: none;
  cursor: pointer;
}

.remove-attachment:hover {
  color: var(--red);
}

/* Scrollbar Styles */
.email-list::-webkit-scrollbar {
  width: 5px;
}

.email-list::-webkit-scrollbar-track {
  background: transparent;
}

.email-list::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  background-color: #aedaff;
}

.email-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(116, 116, 116, 0.2);
}

.email-view-panel::-webkit-scrollbar {
  width: 5px;
}

.email-view-panel::-webkit-scrollbar-track {
  background: transparent;
}

.email-view-panel::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  background-color: #aedaff;
}

.email-view-panel::-webkit-scrollbar-thumb:hover {
  background-color: rgba(116, 116, 116, 0.2);
}

/* Enhanced Email Actions Menu */
.email-actions-menu {
  min-width: 200px;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body.dark-mode .modal-content {
  background-color: #1f2937;
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 24px;
}

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

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-color);
  background-color: white;
}

body.dark-mode .form-group input {
  background-color: #374151;
  color: var(--text-color);
}

.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: var(--text-color);
  transform: scale(1.1);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.btn {
  padding: 10px 20px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #f8f9fa;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--hover-color);
}

.spinning {
  animation: spin 1s linear infinite;
}

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

/* Responsive Styles */
@media (max-width: 1200px) {
  .email-list-panel {
    width: 350px;
  }
}

@media (max-width: 992px) {
  .folder-panel {
    width: 200px;
  }

  .email-list-panel {
    width: 300px;
  }

  /* .formatting-toolbar {
    flex-wrap: wrap;
  } */
}

@media (max-width: 768px) {
  .folder-panel {
    width: 60px;
  }

  .user-info,
  .compose-btn span,
  .folder-item span {
    display: none;
  }

  .compose-btn {
    justify-content: center;
    padding: 10px;
  }

  .folder-item {
    justify-content: center;
    padding: 10px 0;
  }

  .folder-item i {
    margin-right: 0;
  }

  .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .email-list-panel {
    width: 250px;
  }

  .formatting-toolbar {
    padding: 2px 5px;
  }

  .toolbar-section {
    padding: 0 2px;
    margin-bottom: 5px;
  }
}

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

  .sidebar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    justify-content: space-around;
    position: relative;
  }

  .sidebar-icons {
    flex-direction: row;
    margin-top: 0;
    gap: 1rem;
  }

  .sidebar-bottom {
    flex-direction: row;
    margin-top: 0;
    gap: 1rem;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Responsive adjustments */
@media (max-width: 768px) {
  .top-nav {
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
  }

  .logo-image {
    margin-bottom: 0.5rem;
  }

  .nav-right {
    width: 100%;
    justify-content: space-between;
    margin-top: 0.5rem;
  }

  .search-container {
    flex: 1;
    margin-right: 0.5rem;
  }

  .search-input {
    width: 100%;
  }

  .nav-icon {
    width: 2rem;
    height: 2rem;
  }

  .notification-badge {
    width: 0.8rem;
    height: 0.8rem;
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  .search-container {
    display: none; /* Hide search for very small screens */
  }

  .top-nav {
    justify-content: space-between;
  }

  .nav-right {
    gap: 0.5rem;
  }
}


  .email-container {
    margin-top: 0;
  }

  .email-fullscreen {
    flex-direction: column;
  }

  .folder-panel {
    width: 100%;
    height: auto;
    max-height: 60px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .user-profile {
    display: none;
  }

  .compose-btn {
    margin: 5px;
    padding: 5px 10px;
  }

  .folder-list {
    display: flex;
    padding: 5px 0;
    overflow-x: auto;
  }

  .folder-item {
    flex-shrink: 0;
    margin-right: 5px;
  }

  .email-list-panel {
    width: 100%;
    height: 40vh;
  }

  .email-view-panel {
    width: 100%;
    height: 60vh;
    margin-left: 0;
    margin-top: 3px;
  }

  .panel-header h2 {
    margin-left: 0;
    text-align: center;
  }

  .toolbar-left {
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .toolbar-btn span {
    display: none;
  }

  .formatting-toolbar {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .toolbar-section {
    flex-shrink: 0;
  }

  .format-select {
    min-width: 80px;
  }
}

/* Small Mobile Devices */
@media (max-width: 375px) {
  .sidebar-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .compose-btn {
    padding: 5px;
  }

  .folder-item {
    padding: 8px 5px;
  }

  .email-item {
    padding: 10px 5px;
  }

  .email-avatar {
    width: 30px;
    height: 30px;
  }

  .email-header h3 {
    font-size: 13px;
  }

  .email-subject,
  .email-preview {
    font-size: 11px;
  }

  .format-btn {
    width: 30px;
    height: 30px;
  }
}

/* Emoji Picker Styles */
.emoji-picker {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 10px;
  z-index: 1000;
}

body.dark-mode .emoji-picker {
  background-color: #1f2937;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.emoji-btn {
  transition: transform 0.1s;
}

.emoji-btn:hover {
  transform: scale(1.2);
}

/* Additional utility classes and animations */
.spinning {
  animation: spin 1s linear infinite;
}

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

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}