/**
 * Project Assignment Module - Styles
 * @version 1.0.1
 */

/* Modal de asignación */
.g360d-assignment-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.g360d-assignment-modal.active {
  display: flex;
}

.g360d-assignment-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.g360d-assignment-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.g360d-assignment-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.g360d-assignment-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #6b7280;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.g360d-assignment-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.g360d-assignment-body {
  padding: 24px;
}

.g360d-current-owner {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.g360d-current-owner-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.g360d-current-owner-name {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.g360d-search-wrapper {
  margin-bottom: 20px;
}

.g360d-search-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.g360d-user-search-modal {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
}

.g360d-user-search-modal:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.g360d-selected-user-modal {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: #e3f2fd;
  border: 2px solid #1976d2;
  border-radius: 8px;
}

.g360d-selected-user-modal.active {
  display: flex;
  align-items: center;
  gap: 12px;
}

.g360d-selected-user-modal img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.g360d-selected-user-info {
  flex: 1;
  min-width: 0;
}

.g360d-selected-user-name {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g360d-selected-user-email {
  font-size: 14px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g360d-remove-selected {
  background: transparent;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  font-size: 24px;
  line-height: 1;
  transition: color 0.2s;
}

.g360d-remove-selected:hover {
  color: #b71c1c;
}

.g360d-assignment-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

.g360d-btn-cancel {
  padding: 10px 20px;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.g360d-btn-cancel:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.g360d-btn-assign {
  padding: 10px 20px;
  border: none;
  background: #1976d2;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.g360d-btn-assign:hover {
  background: #1565c0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.g360d-btn-assign:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.g360d-loading {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  margin-top: 16px;
}

.g360d-loading.active {
  display: flex;
}

.g360d-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ffc107;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.g360d-loading-text {
  font-size: 14px;
  color: #856404;
}

/* jQuery UI Autocomplete */
.ui-autocomplete {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  z-index: 100001 !important;
}

.ui-autocomplete .ui-menu-item {
  padding: 0;
  margin: 0;
  list-style: none;
}

.ui-autocomplete .ui-menu-item-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #111827;
  transition: background-color 0.2s;
}

.ui-autocomplete .ui-menu-item-wrapper:hover,
.ui-autocomplete .ui-state-active {
  background: #f3f4f6;
}

.ui-autocomplete .g360d-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ui-autocomplete .g360d-user-info-autocomplete {
  flex: 1;
  min-width: 0;
}

.ui-autocomplete .g360d-user-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.ui-autocomplete .g360d-user-email {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Estilos del metabox (admin edit) */
.g360d-assignment-wrapper {
  padding: 10px 0;
}

.g360d-label {
  display: block;
  margin-bottom: 8px;
  color: #1d2327;
  font-size: 13px;
}

.g360d-current-user {
  margin-bottom: 16px;
}

.g360d-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  margin-top: 8px;
}

.g360d-user-info img.avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.g360d-user-details {
  flex: 1;
  min-width: 0;
}

.g360d-user-name {
  font-weight: 600;
  font-size: 14px;
  color: #1d2327;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g360d-user-email {
  font-size: 12px;
  color: #646970;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g360d-separator {
  height: 1px;
  background: #dcdcde;
  margin: 16px 0;
}

.g360d-new-user {
  margin-bottom: 16px;
}

.g360d-user-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 4px;
  transition: border-color 0.2s;
}

.g360d-user-search:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

.g360d-selected-user {
  margin-top: 12px;
  padding: 12px;
  background: #e0f7fa;
  border: 1px solid #00acc1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.g360d-selected-user img.avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.g360d-selected-user .g360d-remove-user {
  background: transparent;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  transition: color 0.2s;
}

.g360d-selected-user .g360d-remove-user:hover {
  color: #b71c1c;
}

.g360d-history {
  margin-bottom: 16px;
}

.g360d-history-list {
  margin-top: 8px;
}

.g360d-history-entry {
  padding: 8px;
  background: #f6f7f7;
  border-left: 3px solid #00a0d2;
  margin-bottom: 8px;
  font-size: 12px;
  border-radius: 0 4px 4px 0;
  color: #3c434a;
  line-height: 1.5;
}

.g360d-history-date {
  display: block;
  color: #646970;
  font-size: 11px;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 600px) {
  .g360d-assignment-content {
    max-width: 95%;
  }
}
