/* === Dropdown Base Styles === 
   styles/components/dropdown.css
 */
.dropdown {
  background-color: var(--surface-dropdown);
  border: 1px solid var(--surface-dropdown-border);
  border-radius: 4px;
  box-shadow: 0 2px 8px var(--shadow-dropdown);
  z-index: 1000;
}

.notifications-dropdown {
  width: 320px;
  min-width: 250px;
  z-index: 9000;
  border: 1px solid var(--surface-dropdown-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* === Task Menu === */
.task-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-dropdown);
  border: 1px solid var(--surface-dropdown-border);
  border-radius: 4px;
  box-shadow: 0 2px 8px var(--shadow-dropdown);
  min-width: 200px;
  padding: 8px 0;
}

.task-menu.visible {
  display: block;
}

.task-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--text-light);
  cursor: pointer;
  white-space: nowrap;
}

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

/* === New Tab Menu === */
.new-tab-menu {
  position: absolute;
  z-index: 9999;
  display: none;
}

.new-tab-menu.visible {
  display: block !important;
}

/* === Project Menu === */
.project-menu {
  position: absolute;
  top: 0;
  right: 100%;
  min-width: 200px;
  background-color: var(--surface-dropdown);
  border: 1px solid var(--surface-dropdown-border);
  border-radius: 4px;
  box-shadow: 0 2px 8px var(--shadow-dropdown);
  padding: 8px 0;
  z-index: 10000;
  display: none;
}

.project-menu.visible {
  display: block;
}

.project-item {
  padding: 8px 12px;
  color: var(--text-light);
  cursor: pointer;
}

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

/* === Dropdown Content === */
.dropdown-content {
  display: flex;
  flex-direction: column;
  max-height: 400px;
  overflow-y: auto;
  background-color: var(--surface-default);
}

/* === Dropdown Header === */
.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 1px solid var(--surface-dropdown-border);
  background-color: var(--surface-alt);
  font-size: 0.9em;
}

.dropdown-header .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--interactive-primary);
  color: var(--text-on-primary);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  margin-left: 5px;
  min-width: 18px;
}

/* === Mark All Read Button === */
.mark-all-read-btn {
  background: none;
  border: none;
  color: var(--interactive-primary);
  cursor: pointer;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
}

.mark-all-read-btn:hover {
  background-color: var(--surface-default);
  border: 1px solid var(--interactive-primary);
}

/* === Notification List & Items === */
.notifications-list,
.jobs-list {
  overflow-y: auto;
  background-color: var(--surface-default);
}

.notification-item {
  padding: 12px 15px;
  border-bottom: 1px solid var(--surface-dropdown-border);
  color: var(--text-light);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

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

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

/* .notification-item.unread {
    background-color: var(--focus-ring);
  } */

.notification-item.unread:hover {
  background-color: rgba(var(--interactive-primary-rgb), 0.15);
}

.notification-content {
  display: flex;
  align-items: flex-start;
}

.notification-icon {
  margin-right: 12px;
  color: var(--text-muted);
  min-width: 20px;
  font-size: 16px;
}

.notification-item.unread .notification-icon {
  color: var(--interactive-primary);
}

.notification-message {
  margin-bottom: 4px;
  line-height: 1.4;
  color: var(--text-primary);
  font-size: small;
}

.notification-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.notification-description {
  padding: 8px 10px;
  margin-top: 5px;
  background-color: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  font-size: 0.9em;
  color: #555;
  border-radius: 0 0 4px 4px;
}

.description-content {
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}

.preview-description {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 0 5px;
  font-size: 14px;
  margin-left: 5px;
}

.preview-description:hover {
  color: #444;
}

/* === Job Items === */
.job-item {
  padding: 12px 15px;
  border-bottom: 1px solid var(--surface-dropdown-border);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

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

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

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.job-title {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.job-progress {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background-color: var(--surface-default);
  border-radius: 3px;
  overflow: hidden;
  margin-right: 10px;
}

.progress {
  height: 100%;
  background-color: var(--interactive-primary);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  width: 36px;
  text-align: right;
}

.job-type {
  font-size: 12px;
  color: var(--text-muted);
}

/* === Dropdown Footer === */
.dropdown-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
  background-color: var(--surface-alt);
  border-top: 1px solid var(--surface-dropdown-border);
  text-align: center;
}

.dropdown-footer button,
.view-all-btn {
  background: none;
  border: none;
  color: var(--interactive-primary);
  cursor: pointer;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 4px;
}

.view-all-btn:hover {
  background-color: var(--surface-default);
  text-decoration: underline;
}

.dropdown-footer button:hover {
  background-color: var(--surface-default);
  border: 1px solid var(--interactive-primary);

}

.refresh-btn i {
  margin-right: 5px;
}

/* === States: Empty, Loading, Error === */
.empty-state,
.loading-state,
.error-state {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.empty-state {
  padding: 16px;
}

.error-state {
  color: var(--status-error);
}

.loading-state i,
.error-state i {
  margin-right: 8px;
  font-size: 16px;
}

/* Enhanced Jobs Dropdown Styles */
.enhanced-jobs-dropdown {
  background-color: var(--surface-dropdown);
  border: 1px solid var(--surface-dropdown-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}

.enhanced-jobs-dropdown .dropdown-content {
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

/* Header */
.enhanced-jobs-dropdown .dropdown-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e1e5e9;
  padding: 12px 16px;
  align-items: baseline;
}

.enhanced-jobs-dropdown .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.enhanced-jobs-dropdown .header-title {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
}

.enhanced-jobs-dropdown .header-stats {
  display: flex;
  gap: 2px;
  margin-left: 10px;
}

.enhanced-jobs-dropdown .stat-item {
  display: block;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6c757d;
}

.enhanced-jobs-dropdown .stat-icon {
  font-size: 10px;
}

.enhanced-jobs-dropdown .stat-icon.running {
  color: #007bff;
}

.enhanced-jobs-dropdown .stat-icon.completed {
  color: #28a745;
}

.enhanced-jobs-dropdown .header-controls {
  display: flex;
  gap: 4px;
}

.enhanced-jobs-dropdown .filter-btn {
  background: transparent;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6c757d;
}

.enhanced-jobs-dropdown .filter-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.enhanced-jobs-dropdown .filter-btn.active {
  background: var(--interactive-primary);
  border-color: var(--interactive-primary);
  color: white;
}

/* Content */
.enhanced-jobs-dropdown .jobs-content {
  flex: 1;
  overflow-y: auto;
  max-height: 350px;
}

.enhanced-jobs-dropdown .loading-state,
.enhanced-jobs-dropdown .empty-state,
.enhanced-jobs-dropdown .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: #6c757d;
  text-align: center;
}

.enhanced-jobs-dropdown .loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 8px;
}

.enhanced-jobs-dropdown .empty-icon,
.enhanced-jobs-dropdown .error-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.enhanced-jobs-dropdown .error-icon {
  color: #dc3545;
}

.enhanced-jobs-dropdown .retry-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 8px;
}

/* Jobs List */
.enhanced-jobs-dropdown .jobs-list {
  padding: 8px 0;
}

.enhanced-jobs-dropdown .job-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f5;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
}

.enhanced-jobs-dropdown .job-item:hover {
  background: #f8f9fa;
}

.enhanced-jobs-dropdown .job-item:last-child {
  border-bottom: none;
}

.enhanced-jobs-dropdown .job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.enhanced-jobs-dropdown .job-info {
  flex: 1;
  min-width: 0;
}

.enhanced-jobs-dropdown .job-title {
  font-weight: 500;
  font-size: 13px;
  color: #2c3e50;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enhanced-jobs-dropdown .job-metadata {
  font-size: 11px;
  color: #6c757d;
  line-height: 1.3;
}

.enhanced-jobs-dropdown .job-status {
  margin-left: 12px;
}

.enhanced-jobs-dropdown .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.enhanced-jobs-dropdown .status-badge.running {
  background: #e3f2fd;
  color: #1976d2;
}

.enhanced-jobs-dropdown .status-badge.queued {
  background: #fff3e0;
  color: #f57c00;
}

.enhanced-jobs-dropdown .status-badge.completed {
  background: #e8f5e8;
  color: #2e7d32;
}

.enhanced-jobs-dropdown .status-badge.failed {
  background: #ffebee;
  color: #d32f2f;
}

.enhanced-jobs-dropdown .status-badge.cancelled {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Progress Bar */
.enhanced-jobs-dropdown .job-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.enhanced-jobs-dropdown .progress-bar {
  flex: 1;
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
}

.enhanced-jobs-dropdown .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.enhanced-jobs-dropdown .progress-text {
  font-size: 10px;
  color: #6c757d;
  font-weight: 500;
  min-width: 30px;
  text-align: right;
}

/* Job Actions */
.enhanced-jobs-dropdown .job-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.enhanced-jobs-dropdown .job-item:hover .job-actions {
  opacity: 1;
}

.enhanced-jobs-dropdown .action-btn {
  background: transparent;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  padding: 4px 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6c757d;
  font-size: 10px;
}

.enhanced-jobs-dropdown .action-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.enhanced-jobs-dropdown .cancel-btn:hover {
  background: #dc3545;
  border-color: #dc3545;
  color: white;
}

.enhanced-jobs-dropdown .details-btn:hover {
  background: #17a2b8;
  border-color: #17a2b8;
  color: white;
}

.enhanced-jobs-dropdown .open-btn:hover {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

/* Footer */
.enhanced-jobs-dropdown .dropdown-footer {
  background: #f8f9fa;
  border-top: 1px solid #e1e5e9;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.enhanced-jobs-dropdown .dropdown-footer button {
  background: transparent;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 4px;
}

.enhanced-jobs-dropdown .dropdown-footer button:hover {
  background: transparent;
  border-color: var(--interactive-primary);
  color: var(--interactive-primary) !important;
}

.enhanced-jobs-dropdown .view-all-btn {
  background: transparent;
  border-color: var(--interactive-primary);
  color: var(--interactive-primary) !important;
}

.enhanced-jobs-dropdown .view-all-btn:hover {
  background: var(--background-subtle) !important;
  border-color: var(--interactive-primary) !important;
  color: var(--interactive-primary) !important;
  text-decoration: none;
}

.enhanced-jobs-dropdown .export-btn {
  min-width: auto;
  padding: 6px 8px;
}

/* Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .enhanced-jobs-dropdown {
    min-width: 320px;
    max-width: 90vw;
  }

  .enhanced-jobs-dropdown .job-metadata {
    font-size: 10px;
  }

  .enhanced-jobs-dropdown .job-actions {
    opacity: 1;
    /* Always show on mobile */
  }
}

/* === Profile Dropdown Styles === */
.top-bar-profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: var(--text-on-primary);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-size: 20px;
  padding: 0;
}

.top-bar-profile-btn:hover {
  background: var(--interactive-primary-hover);
  transform: scale(1.05);
}

.top-bar-profile-btn:active {
  transform: scale(0.98);
}

.top-bar-profile-btn i {
  color: var(--text-on-primary);
  font-size: 13px;
}

/* Profile dropdown positioning */
.top-bar-profile-dropdown::part(panel) {
  margin-top: 8px;
}