/* Elastic Modern overrides — safe to remove to revert */

/* Typography and base links */
body, button, input, select, textarea, .popover {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

#toolbar-menu a,
#toolbar-menu .dropbutton > a {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: none !important;
}

#toolbar-menu a:hover,
#toolbar-menu .dropbutton > a:hover {
    background: transparent !important;
    color: inherit !important;
    transform: none !important;
}

#toolbar-menu a:focus,
#toolbar-menu a:active,
#toolbar-menu .dropbutton > a:focus,
#toolbar-menu .dropbutton > a:active {
    background: transparent !important;
    outline: none !important;
    color: inherit !important;
}

a { color: #2563eb; }
a:hover { color: #1d4ed8; }

/* Header and footer subtle polish */
#layout > div > .header,
#layout > div > .footer {
  border-color: #eaeaea;
  backdrop-filter: saturate(150%) blur(6px);
}

/* Toolbar buttons (top menus) */
.menu.toolbar a {
  border-radius: 0;
  transition: none;
}
.menu.toolbar a:not(.disabled):hover,
.menu.toolbar a:not(.disabled):focus {
  transform: none;
  background-color: transparent !important;
}

/* Buttons */
.btn {
  border-radius: 0;
  transition: none;
}
.btn:active { transform: none; }

.btn-primary {
  background-color: #2563eb;
  border-color: #2563eb;
}
.btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

.btn-secondary {
  background-color: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
}
.btn-secondary:hover { background-color: #e5e7eb; }

.btn-danger {
  background-color: #ef4444;
  border-color: #ef4444;
}
.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

/* Inputs */
.form-control,
.custom-select,
.input-group-text,
.multi-input > .content,
.recipient-input .recipient {
  border-radius: 4px;
}
.form-control:focus,
.custom-select:focus {
  box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .25);
  border-color: #2563eb;
}

/* Searchbar */
.searchbar {
  border-radius: 4px;
  background-color: #ffffff;
  border-color: #e5e7eb;
}

/* Lists: hover and selection emphasis */
.listing tr:hover td,
.listing li:hover > a {
  background-color: #f5f8ff;
}
.listing tr.selected td,
.listing li.selected > a {
  border-left-color: #2563eb !important;
}

/* Cards look for message parts and attachments */
.message-part,
.message-htmlpart,
.attachmentslist {
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  background-clip: padding-box;
}
#message-header > .header img.contactphoto {
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* Task menu (left) accents */
#taskmenu a.selected {
  background-color: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}
#taskmenu a:not(.disabled):hover {
  background-color: rgba(37, 99, 235, 0.12);
}

/* Floating action buttons */
.floating-action-buttons a.button {
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  background: #2563eb;
}

/* Message stack (toast) polish */
#messagestack div {
  border-radius: 4px;
  box-shadow: 0 10px 20px rgba(0,0,0,.1);
}

/* Dark mode adjustments */
html.dark-mode a { color: #93c5fd; }
html.dark-mode .btn-primary {
  background-color: #3b82f6;
  border-color: #3b82f6;
}
html.dark-mode .menu.toolbar a:not(.disabled):hover,
html.dark-mode .menu.toolbar a:not(.disabled):focus {
  background-color: rgba(147, 197, 253, 0.08);
}
html.dark-mode .listing tr:hover td,
html.dark-mode .listing li:hover > a {
  background-color: rgba(147, 197, 253, 0.06);
}
html.dark-mode #taskmenu a.selected {
  color: #93c5fd;
  background-color: rgba(147, 197, 253, 0.15);
}
html.dark-mode .message-part,
html.dark-mode .message-htmlpart,
html.dark-mode .attachmentslist {
  box-shadow: none;
  border: 1px solid #2c373a;
  border-radius: 12px;
}
html.dark-mode .form-control:focus,
html.dark-mode .custom-select:focus {
  box-shadow: 0 0 0 .2rem rgba(59, 130, 246, .25);
  border-color: #3b82f6;
}

/* Toast notifications animation */
@media (prefers-reduced-motion: no-preference) {
  #messagestack div {
    animation: rc-toast-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    will-change: transform, opacity;
  }
}

@media (prefers-reduced-motion: reduce) {
  #messagestack div { animation: none !important; }
}

@keyframes rc-toast-in {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  60% { transform: translateY(0) scale(1.02); opacity: 1; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Hide Contacts and About buttons */
#taskmenu a.contacts,
#taskmenu .contacts,
a.button.contacts,
[command="addressbook"],
[data-command="addressbook"],
#taskmenu a.about,
#taskmenu .about,
a.button.about,
.special-buttons a.about,
.special-buttons .about {
  display: none !important;
  visibility: hidden !important;
}

/* Hide sidebar completely */
#layout-sidebar {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
}

/* Hide quota display */
#quotadisplay,
.quota-widget {
  display: none !important;
  visibility: hidden !important;
}

/* Hide folder-related buttons */
.back-sidebar-button.folders,
.sidebar-menu {
  display: none !important;
  visibility: hidden !important;
}

/* Adjust layout to use full width when sidebar is hidden */
.task-mail #layout-list {
  max-width: 100% !important;
  flex: 1 1 auto !important;
}

/* Email display in header */
.email-in-header {
  font-size: 0.9em;
  opacity: 0.7;
  margin-left: 0.5em;
}

