/* Reset & Global styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 45%), 
              radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.08), transparent 45%), 
              #0b0f19;
  font-family: 'Plus Jakarta Sans', sans-serif;
  overflow: hidden;
}

/* Glassmorphism panel styling */
.glass {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Tab panels transitions */
.tab-panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-panel.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Custom premium scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Custom list items active states */
.email-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.email-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.email-card.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.email-card.unread::after {
  content: '';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 7px;
  height: 7px;
  background: #6366f1; /* Indigo color */
  border-radius: 50%;
  box-shadow: 0 0 8px #6366f1;
}

/* Toast animations */
.toast-anim {
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%) translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

/* Selected text styling */
::selection {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

/* Form inputs hover effect */
input:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
  }
  
  #app-container {
    height: auto;
    overflow: visible;
  }

  main {
    height: auto;
    overflow: visible;
  }

  .tab-panel.active {
    flex-direction: column;
    height: auto;
  }
  
  #email-list {
    max-height: 300px;
  }
}

/* Quill Editor Dark Mode styling */
.ql-toolbar.ql-snow, .ql-container.ql-snow {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(15, 23, 42, 0.45) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.ql-toolbar.ql-snow {
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
  border-bottom: none !important;
  padding: 8px 12px !important;
}

.ql-container.ql-snow {
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
  font-size: 14px !important;
  color: #f1f5f9 !important;
}

.ql-editor {
  min-height: 280px;
  max-height: 500px;
  overflow-y: auto;
  padding: 12px 16px !important;
}

/* Custom scrollbar inside Quill editor */
.ql-editor::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.ql-editor::-webkit-scrollbar-track {
  background: transparent;
}
.ql-editor::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}
.ql-editor::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Quill Toolbar items styling */
.ql-snow .ql-stroke {
  stroke: #94a3b8 !important;
}
.ql-snow .ql-fill {
  fill: #94a3b8 !important;
}
.ql-snow .ql-picker {
  color: #94a3b8 !important;
}

/* Hover & Active states for buttons and pickers */
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke {
  stroke: #fbbf24 !important;
}

.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: #fbbf24 !important;
}

.ql-snow.ql-toolbar .ql-picker-label:hover,
.ql-snow.ql-toolbar .ql-picker-label.ql-active,
.ql-snow .ql-toolbar .ql-picker-label:hover,
.ql-snow .ql-toolbar .ql-picker-label.ql-active {
  color: #fbbf24 !important;
}

.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke {
  stroke: #fbbf24 !important;
}

/* Dropdown selections (Font, Size, Header) background and items */
.ql-snow .ql-picker-options {
  background-color: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
  border-radius: 8px !important;
  padding: 6px !important;
  z-index: 100 !important;
}

.ql-snow .ql-picker-item {
  color: #94a3b8 !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
}

.ql-snow .ql-picker-item:hover,
.ql-snow .ql-picker-item.ql-selected {
  color: #fbbf24 !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Link tooltip/dialog styling */
.ql-snow .ql-tooltip {
  background-color: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
  border-radius: 8px !important;
  color: #f1f5f9 !important;
  padding: 10px 12px !important;
}

.ql-snow .ql-tooltip input[type=text] {
  background-color: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f1f5f9 !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  outline: none !important;
}

.ql-snow .ql-tooltip input[type=text]:focus {
  border-color: #fbbf24 !important;
}

.ql-snow .ql-tooltip a.ql-action {
  color: #fbbf24 !important;
  font-weight: bold !important;
}

.ql-snow .ql-tooltip a.ql-preview {
  color: #94a3b8 !important;
}

.ql-snow .ql-tooltip a.ql-remove {
  color: #ef4444 !important;
}
