/**
 * Company Switcher Styles
 * Dropdown component for reseller users to switch between companies
 */

/* Screen reader only helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Company switcher dropdown container */
.company-switcher-dropdown {
  position: relative;
  display: inline-block;
  margin-right: 15px;
}

/* Current company indicator button */
.company-switcher-dropdown .current-company-indicator {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-switcher-dropdown .current-company-indicator:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

.company-switcher-dropdown .current-company-indicator:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 128, 0, 0.2);
  border-color: #ff8000;
}

.company-switcher-dropdown .company-name {
  font-weight: 500;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  word-break: break-word;
}

/* Dropdown menu */
.company-switcher-dropdown .company-dropdown-menu,
.company-switcher-dropdown .company-switcher-panel {
  min-width: 250px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 5px;
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background-color: #fff;
  z-index: 1000;
}

.company-switcher-dropdown.is-open .company-dropdown-menu,
.company-switcher-dropdown.is-open .company-switcher-panel {
  display: block;
}

.company-switcher-panel[hidden] {
  display: none !important;
}

.company-switcher-dropdown .dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f9fa;
}

.company-switcher-dropdown .close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
}

.company-switcher-dropdown.is-open .current-company-indicator {
  border-color: #ff8000;
  box-shadow: 0 0 0 2px rgba(255, 128, 0, 0.2);
}

/* Company option items */
.company-switcher-dropdown .company-option {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.company-switcher-dropdown .company-option .company-name {
  flex: 1;
  margin-right: 10px;
  max-width: none;
}

.company-switcher-dropdown .company-option input[type="radio"] {
  margin-right: 10px;
}

.company-switcher-dropdown .company-option:hover {
  background-color: #f5f5f5;
  text-decoration: none;
  color: #333;
}

.company-switcher-dropdown .company-option.active {
  background-color: #fff3e6;
  color: #ff8000;
  font-weight: 500;
}

.company-switcher-dropdown .company-option.active:hover {
  background-color: #ffe6cc;
}

.company-switcher-dropdown .company-option .badge {
  background-color: #007bff;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  margin-left: 8px;
}

.company-switcher-dropdown .current-indicator {
  color: #ff8000;
  margin-left: 10px;
}

/* Warning message */
.company-switcher-dropdown .switcher-warning {
  padding: 10px 15px;
  background-color: #fff3cd;
  border-top: 1px solid #ffc107;
  font-size: 12px;
  line-height: 1.4;
  color: #856404;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.company-switcher-dropdown .switcher-warning i {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-overlay .loading-spinner {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: #ff8000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .company-switcher-dropdown .company-name {
    max-width: 150px;
  }
  
  .company-switcher-dropdown .company-dropdown-menu {
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .company-switcher-dropdown .company-name {
    max-width: 100px;
  }
  
  .company-switcher-dropdown .current-company-indicator {
    padding: 6px 10px;
    font-size: 13px;
  }
}
