/**
 * Utility Bar Styles
 * Extracted from utility-bar.js for CSP compliance
 */

/* ============================================
   GLOBAL UTILITY BAR
   ============================================ */

.global-utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.utility-bar-left,
.utility-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   GLOBAL SEARCH
   ============================================ */

.global-search-wrapper {
  position: relative;
}

.global-search-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 8px;
  width: 280px;
  transition: all 0.15s;
}

.global-search-input-container:focus-within {
  background: white;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.global-search-icon {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  flex-shrink: 0;
}

.global-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: #374151;
  outline: none;
}

.global-search-input::placeholder {
  color: #9ca3af;
}

.global-search-shortcut {
  padding: 2px 6px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-family: system-ui, sans-serif;
  color: #9ca3af;
}

.global-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 420px;
  max-height: 480px;
  overflow-y: auto;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1001;
}

.global-search-dropdown.show {
  display: block;
}

.global-search-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #6366f1;
  color: white;
  font-size: 0.875rem;
  border-radius: 11px 11px 0 0;
}

.global-search-header strong {
  margin-left: 4px;
}

.global-search-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  color: #6b7280;
  font-size: 0.875rem;
}

.search-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: utility-bar-spin 0.6s linear infinite;
}

@keyframes utility-bar-spin {
  to { transform: rotate(360deg); }
}

.global-search-hint {
  padding: 20px 16px;
  color: #9ca3af;
  font-size: 0.875rem;
  text-align: center;
}

.global-search-empty {
  padding: 20px 16px;
  color: #6b7280;
  font-size: 0.875rem;
  text-align: center;
}

.search-error {
  padding: 16px;
  color: #dc2626;
  font-size: 0.875rem;
  text-align: center;
}

.search-section {
  border-bottom: 1px solid #f3f4f6;
}

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

.search-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f9fafb;
}

.search-section-header svg {
  width: 14px;
  height: 14px;
}

.global-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.1s;
}

.global-search-item:hover,
.global-search-item.selected {
  background: #f3f4f6;
}

.search-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.search-item-avatar.staff {
  background: #0d9488;
}

.search-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-item-icon svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.search-item-icon.service {
  background: #fef3c7;
}

.search-item-icon.service svg {
  color: #d97706;
}

.search-item-icon.appointment {
  background: #dbeafe;
}

.search-item-icon.appointment svg {
  color: #2563eb;
}

.search-item-content {
  flex: 1;
  min-width: 0;
}

.search-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-name mark {
  background: #fef08a;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.search-item-meta {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   UTILITY BUTTONS
   ============================================ */

.utility-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.utility-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.utility-btn svg {
  width: 16px;
  height: 16px;
}

.utility-btn-primary {
  background: #7c3aed;
  border-color: #7c3aed;
  color: white;
}

.utility-btn-primary:hover {
  background: #6d28d9;
  border-color: #6d28d9;
}

.utility-btn.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: white;
}

.utility-divider {
  width: 1px;
  height: 24px;
  background: #e5e7eb;
  margin: 0 4px;
}

.utility-add-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utility-add-label {
  font-size: 0.8125rem;
  color: #6b7280;
}

.utility-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}

.utility-add-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.utility-add-btn svg {
  width: 16px;
  height: 16px;
}

.utility-notification-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.utility-notification-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.utility-notification-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   USER DROPDOWN
   ============================================ */

.utility-user-dropdown {
  position: relative;
}

.utility-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}

.utility-user-menu:hover {
  background: #f3f4f6;
}

.utility-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #7c3aed;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.utility-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.utility-user-menu svg {
  width: 16px;
  height: 16px;
  color: #9ca3af;
}

.utility-user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 200px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 1000;
}

.utility-user-dropdown-menu.show {
  display: block;
}

.utility-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #374151;
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.utility-dropdown-item:hover {
  background: #f9fafb;
}

.utility-dropdown-item svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.utility-dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

.feedback-btn {
  color: #7c3aed;
  border-color: #e9d5ff;
}

.feedback-btn:hover {
  background: #faf5ff;
  border-color: #d8b4fe;
}

/* ============================================
   GLOBAL CUSTOMER MODAL
   ============================================ */

.global-customer-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}

.global-customer-modal-overlay.show {
  display: block;
}

.global-customer-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  width: 400px;
  max-width: 90vw;
}

.global-customer-modal.show {
  display: block;
}

.global-customer-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.global-customer-modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.global-customer-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.global-customer-modal-close:hover {
  color: #374151;
}

.global-customer-modal-body {
  padding: 24px;
}

.global-customer-form-group {
  margin-bottom: 16px;
}

.global-customer-form-group:last-child {
  margin-bottom: 0;
}

.global-customer-form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.global-customer-form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.global-customer-form-group input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.global-customer-phone-row {
  display: flex;
  gap: 8px;
}

.global-customer-country-select {
  width: 100px;
  padding: 10px 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
  outline: none;
}

.global-customer-country-select:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.global-customer-phone-row input {
  flex: 1;
}

.global-customer-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

.global-customer-btn-cancel {
  padding: 10px 20px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}

.global-customer-btn-cancel:hover {
  background: #f3f4f6;
}

.global-customer-btn-create {
  padding: 10px 20px;
  border: none;
  background: #0d9488;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.15s;
}

.global-customer-btn-create:hover {
  background: #0f766e;
}

.global-customer-btn-create:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .global-search-input-container {
    width: 200px;
  }
  .global-search-dropdown {
    width: 350px;
  }
}

@media (max-width: 768px) {
  .global-search-wrapper {
    display: none;
  }
  .utility-add-group {
    display: none;
  }
}
