/* Common Styles - Shared across all pages */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f9fafb;
  color: #111827;
  line-height: 1.5;
}

/* Header */
.header {
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-logo {
  width: 2rem;
  height: 2rem;
  color: #6366f1;
}

.header-left h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Header dropdowns */
.notification-container,
.account-container {
  position: relative;
}

.notification-dropdown,
.account-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: none; /* hidden until .show */
  min-width: 22rem;
  max-width: 28rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25), 0 10px 15px -3px rgba(0,0,0,0.1);
  z-index: 60; /* above header but below modals */
  overflow: hidden;
}

.notification-dropdown.show,
.account-dropdown.show {
  display: block;
}

/* Notification Header */
.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.notification-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.notification-mark-all-read {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.notification-mark-all-read:hover {
  background: #f3f4f6;
  border-color: #2563eb;
  color: #2563eb;
}

.notification-mark-all-read svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Notification List */
.notification-list {
  max-height: 24rem;
  overflow-y: auto;
}

.notification-list::-webkit-scrollbar {
  width: 6px;
}

.notification-list::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.notification-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Notification Item */
.notification-dropdown .notification-item {
  display: flex;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s;
  cursor: pointer;
}

.notification-dropdown .notification-item:hover {
  background: #f9fafb;
}

.notification-dropdown .notification-item:last-child {
  border-bottom: none;
}

.notification-dropdown .notification-item.notification-unread {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
}

.notification-dropdown .notification-item.notification-unread:hover {
  background: #dbeafe;
}

/* Notification Icon Wrapper */
.notification-icon-wrapper {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon-wrapper.delivery-assigned {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.notification-icon-wrapper.route-optimized {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.notification-icon-wrapper.delivery-completed {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
}

.notification-icon-wrapper.rider-status {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #6366f1;
}

.notification-icon-wrapper.low-efficiency {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}

.notification-icon-wrapper.route-updated {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.notification-icon-wrapper.delivery-reminder {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #f59e0b;
}

.notification-icon-wrapper svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Notification Content */
.notification-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.notification-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.4;
}

.notification-unread-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: #2563eb;
  border-radius: 50%;
  flex-shrink: 0;
}

.notification-message {
  font-size: 0.8125rem;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
}

.notification-highlight {
  font-weight: 600;
  color: #111827;
}

.notification-highlight.status-active {
  color: #10b981;
}

.notification-highlight.efficiency-low {
  color: #d97706;
}

/* Notification Details */
.notification-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.notification-detail-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: #6b7280;
  padding: 0.25rem 0.5rem;
  background: #f9fafb;
  border-radius: 0.25rem;
}

.notification-detail-icon {
  width: 0.75rem;
  height: 0.75rem;
  color: #9ca3af;
  flex-shrink: 0;
}

/* Notification Time */
.notification-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

.notification-icon-wrapper.route-updated {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.notification-icon-wrapper.delivery-reminder {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #f59e0b;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: #9ca3af;
}

.notification-empty svg {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.notification-empty p {
  margin: 0;
  font-size: 0.9375rem;
}

.notification-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.notification-view-all {
  width: 100%;
  padding: 0.625rem;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.notification-view-all:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.notification-time-icon {
  width: 0.75rem;
  height: 0.75rem;
  color: #9ca3af;
  flex-shrink: 0;
}

/* Notification Footer */
.notification-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  text-align: center;
}

.notification-view-all {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  color: #2563eb;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.notification-view-all:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

/* Notification Details Modal Styles */
.notification-details-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-details-icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-details-icon-wrapper.delivery-assigned {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.notification-details-icon-wrapper.route-optimized {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.notification-details-icon-wrapper.delivery-completed {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
}

.notification-details-icon-wrapper.rider-status {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #6366f1;
}

.notification-details-icon-wrapper.low-efficiency {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}

.notification-details-icon-wrapper.route-updated {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.notification-details-icon-wrapper.delivery-reminder {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #f59e0b;
}

.notification-details-icon-wrapper svg {
  width: 1.5rem;
  height: 1.5rem;
}

.notification-details-time {
  margin: 0.25rem 0 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

/* Notification Details Container */
.notification-details-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Notification Details Sections */
.notification-details-section {
  margin-bottom: 2rem;
}

.notification-details-section:last-child {
  margin-bottom: 0;
}

.notification-details-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.notification-details-section-icon {
  width: 1.125rem;
  height: 1.125rem;
  color: #6b7280;
}

.notification-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.notification-details-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.notification-details-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.notification-details-item-icon {
  width: 0.875rem;
  height: 0.875rem;
  color: #9ca3af;
  flex-shrink: 0;
}

.notification-details-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
}

.notification-details-value.highlight {
  color: #2563eb;
  font-weight: 700;
}

.notification-details-value.highlight.success {
  color: #16a34a;
}

.notification-details-value.highlight.warning {
  color: #d97706;
}

.notification-details-value.status-active {
  color: #10b981;
}

/* Notification Details Info Box */
.notification-details-info-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #2563eb;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.notification-details-info-box-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #2563eb;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.notification-details-info-box.warning {
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: #d97706;
}

.notification-details-info-box.warning .notification-details-info-box-icon {
  color: #d97706;
}

.notification-details-info-box p {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.6;
}

.notification-details-info-box p:last-child {
  margin-bottom: 0;
}

.notification-details-info-box strong {
  color: #111827;
  font-weight: 600;
}

.notification-details-list {
  margin: 0;
  padding-left: 1.25rem;
  list-style-type: disc;
}

.notification-details-list li {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
}

.notification-details-list li:last-child {
  margin-bottom: 0;
}

/* Scrollable notification details body */
#notificationDetailsBody {
  max-height: 70vh;
  overflow-y: auto;
  padding: 1.5rem;
}

#notificationDetailsBody::-webkit-scrollbar {
  width: 8px;
}

#notificationDetailsBody::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

#notificationDetailsBody::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#notificationDetailsBody::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.account-dropdown .account-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}

.account-dropdown .account-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.25rem;
}

.account-dropdown .account-header p {
  font-size: 0.875rem;
  color: #6b7280;
}

.account-dropdown .account-menu {
  display: grid;
  padding: 0.25rem 0;
}

.account-dropdown .account-menu-item {
  padding: 0.875rem 1.25rem;
  font-size: 0.95rem;
  color: #111827;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid #f3f4f6;
}

.account-dropdown .account-menu-item:hover {
  background-color: #f9fafb;
}

.account-dropdown .account-menu-item:last-child {
  border-bottom: none;
}

.icon-btn {
  position: relative;
  padding: 0.5rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.notification-btn {
  background-color: #dbeafe;
}

.notification-btn:hover {
  background-color: #bfdbfe;
}

.notification-btn .icon {
  color: #1d4ed8;
}

.account-btn {
  background-color: #e0e7ff;
}

.account-btn:hover {
  background-color: #c7d2fe;
}

.account-btn .icon {
  color: #4338ca;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-small {
  width: 1rem;
  height: 1rem;
}

.notification-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background-color: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.btn-logout:hover {
  background-color: #f9fafb;
}

/* Main Content */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background-color: white;
  border-radius: 0.5rem;
  max-width: 28rem;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal.modal-large {
  max-width: 48rem;
  width: 90%;
}

.modal.modal-medium {
  max-width: 40rem;
  width: 90%;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  color: #6b7280;
  line-height: 1.6;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-cancel,
.btn-confirm {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel {
  background-color: white;
  border: 1px solid #d1d5db;
  color: #374151;
}

.btn-cancel:hover {
  background-color: #f9fafb;
}

.btn-confirm {
  background-color: #d1d5db;
  border: none;
  color: white;
}

.btn-confirm:hover {
  background-color: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
  .header-left h1 {
    font-size: 1rem;
  }

  .header-right {
    gap: 0.5rem;
  }

  .notification-dropdown {
    min-width: 18rem;
    max-width: calc(100vw - 2rem);
    right: -0.5rem;
  }

  .notification-list {
    max-height: 20rem;
  }

  .notification-details {
    flex-direction: column;
    gap: 0.5rem;
  }

  .notification-detail-item {
    width: 100%;
  }
}
