/* Shared AI Hub profile modal styles (community + talent) */

:root {
  --ai-hub-primary: #a5c5e5;
  --ai-hub-primary-hover: #94b5d6;
  --ai-hub-primary-20: rgba(165, 197, 229, 0.2);
  --ai-hub-primary-30: rgba(165, 197, 229, 0.3);
  --ai-hub-slate-50: #f8fafc;
  --ai-hub-slate-100: #f1f5f9;
  --ai-hub-slate-200: #e2e8f0;
  --ai-hub-slate-400: #94a3b8;
  --ai-hub-slate-500: #64748b;
  --ai-hub-slate-600: #475569;
  --ai-hub-slate-700: #334155;
  --ai-hub-slate-900: #0f172a;
}

.ai-hub-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.5rem;
  padding: 0 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000;
  background: var(--ai-hub-primary);
  border: none;
  border-radius: 0.75rem;
  transition: background 0.2s;
}

.ai-hub-btn-primary:hover {
  background: var(--ai-hub-primary-hover);
  color: #000;
}

.ai-hub-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ai-hub-slate-500);
  background: #fff;
  border: 1px dashed var(--ai-hub-slate-400);
  border-radius: 0.375rem;
  width: 100%;
  transition: background 0.2s;
}

.ai-hub-btn-outline:hover {
  background: var(--ai-hub-slate-50);
  color: var(--ai-hub-slate-700);
}

.ai-hub-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.ai-hub-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.ai-hub-modal-panel {
  position: fixed;
  top: 72px;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: 100%;
  max-width: 42rem;
  background: #fff;
  border-left: 1px solid var(--ai-hub-slate-200);
  overflow-y: auto;
  box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1);
}

.ai-hub-profile-modal {
  top: 72px !important;
  bottom: 0 !important;
  height: auto !important;
}

.ai-hub-modal-panel-events {
  pointer-events: auto;
}

.ai-hub-modal-close-btn {
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 2;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: none;
  opacity: 0.7;
  cursor: pointer;
}

.ai-hub-modal-close-btn:hover {
  opacity: 1;
}

.ai-hub-modal-close-btn svg {
  width: 16px;
  height: 16px;
}

.ai-hub-modal-header {
  background: var(--ai-hub-slate-900);
  color: #fff;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.ai-hub-modal-header-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

.ai-hub-modal-header-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.ai-hub-modal-header-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ai-hub-modal-avatar-wrap {
  position: relative;
  width: 6rem;
  height: 6rem;
  flex-shrink: 0;
}

.ai-hub-modal-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.875rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  box-sizing: border-box;
}

.ai-hub-modal-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
}

.ai-hub-modal-name {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.ai-hub-modal-subtitle {
  color: #93c5fd;
  font-weight: 500;
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.ai-hub-modal-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.ai-hub-modal-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-hub-modal-meta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ai-hub-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-hub-badge-verified,
.ai-hub-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.375rem;
  line-height: 1.3;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ai-hub-badge-verified {
  color: #86efac;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.ai-hub-badge-top {
  color: #fde047;
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.ai-hub-badge-verified svg,
.ai-hub-badge-top svg {
  width: 12px;
  height: 12px;
  margin-right: 0;
  flex-shrink: 0;
}

.ai-hub-badge-top svg {
  fill: #eab308;
}

.ai-hub-modal-body {
  padding: 2rem;
  color: var(--ai-hub-slate-700);
}

.ai-hub-modal-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-hub-btn-connect {
  flex: 1;
  min-height: 3rem;
  background: var(--ai-hub-slate-900);
  color: #fff !important;
}

.ai-hub-btn-connect:hover {
  background: #334155;
  color: #fff;
}

.ai-hub-btn-download {
  flex: 1;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.ai-hub-modal-resume-unavailable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 3rem;
  color: var(--ai-hub-slate-500);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: not-allowed;
  opacity: 0.85;
  border: 1px dashed var(--ai-hub-slate-300);
  border-radius: 0.375rem;
  background: var(--ai-hub-slate-50);
}

.ai-hub-modal-section {
  margin-bottom: 2rem;
  padding-top: 0.25rem;
}

.ai-hub-modal-section-title,
.ai-hub-modal-skills-title,
.ai-hub-modal-stats-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ai-hub-slate-900);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-hub-modal-section-title {
  margin-bottom: 0.75rem;
}

.ai-hub-modal-section-title svg,
.ai-hub-modal-skills-title svg,
.ai-hub-modal-stats-title svg {
  width: 20px;
  height: 20px;
  color: var(--ai-hub-slate-500);
}

.ai-hub-modal-about-wrap {
  position: relative;
}

.ai-hub-modal-about {
  color: var(--ai-hub-slate-700);
  line-height: 1.625;
  font-size: 1rem;
  margin: 0;
}

.ai-hub-modal-about-collapsed {
  max-height: 4.9em;
  overflow: hidden;
}

.ai-hub-modal-about-full {
  max-height: none;
  overflow: visible;
}

.ai-hub-modal-view-more {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
}

.ai-hub-modal-view-more:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.ai-hub-modal-primary-focus {
  margin-bottom: 1rem;
}

.ai-hub-modal-primary-focus h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ai-hub-slate-700);
  margin-bottom: 8px;
}

.ai-hub-primary-focus-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 0.375rem;
}

.ai-hub-primary-focus-badge:hover {
  background: #bfdbfe;
}

.ai-hub-modal-skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ai-hub-skill-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ai-hub-slate-700);
  background: var(--ai-hub-slate-100);
  border: 1px solid var(--ai-hub-slate-200);
  border-radius: 0.375rem;
  white-space: nowrap;
}

.ai-hub-skill-badge--trunc {
  max-width: min(100%, 14rem);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-hub-modal-no-skills {
  color: var(--ai-hub-slate-600);
  font-size: 0.875rem;
  margin: 0;
}

.ai-hub-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.ai-hub-stat-item {
  background: var(--ai-hub-slate-50);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--ai-hub-slate-100);
  text-align: center;
}

.ai-hub-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ai-hub-slate-900);
  margin-bottom: 0.25rem;
}

.ai-hub-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ai-hub-slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-hub-section-divider {
  height: 1px;
  width: 100%;
  background: var(--ai-hub-slate-200);
  flex-shrink: 0;
  margin: 1.5rem 0;
}

.ai-hub-modal-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.ai-hub-modal-project-card {
  border: 1px solid var(--ai-hub-slate-200);
  border-radius: 12px;
  background: var(--ai-hub-slate-50);
  padding: 0.875rem;
}

.ai-hub-modal-project-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ai-hub-slate-900);
  line-height: 1.35;
}

.ai-hub-modal-project-desc {
  margin: 0 0 0.75rem;
  color: var(--ai-hub-slate-600);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-hub-modal-project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-hub-modal-project-link {
  min-height: 2rem;
  padding: 0.35rem 0.625rem;
  font-size: 0.8rem;
  line-height: 1.1;
  border-radius: 999px;
  flex: 0 0 auto;
  width: auto;
}

.ai-hub-modal-report-divider {
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
}

.ai-hub-modal-section--report {
  padding: 0;
  margin: 0;
  border: 0;
}

.ai-hub-modal-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ai-hub-slate-600);
  background: transparent;
  border: 1px dashed var(--ai-hub-slate-300);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ai-hub-modal-report-btn:hover:not(:disabled) {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fef2f2;
}

.ai-hub-modal-report-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes slide-in-from-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in-right {
  animation: slide-in-from-right 0.3s ease-out forwards;
}

@media (max-width: 767px) {
  .ai-hub-profile-modal {
    top: 0 !important;
    max-width: 100%;
    border-left: none;
    box-shadow: none;
    margin-top: 56px;
  }

  .ai-hub-modal-close-btn {
    right: 0.75rem;
    top: 0.75rem;
    width: 2rem;
    height: 2rem;
  }

  .lang_ar .ai-hub-modal-close-btn {
    right: auto;
    left: 0.75rem;
  }

  /* Push header content below the absolute close button */
  .ai-hub-modal-header {
    padding: 3rem 1rem 1.25rem;
  }

  .ai-hub-modal-body {
    padding: 1rem;
  }

  /* Allow avatar + info on first row, badges on second row */
  .ai-hub-modal-header-main {
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  /* Info div (name / subtitle / meta) fills remaining width beside avatar */
  .ai-hub-modal-header-main > div:not(.ai-hub-modal-avatar-wrap):not(.ai-hub-modal-badges) {
    flex: 1;
    min-width: 0;
  }

  .ai-hub-modal-avatar-wrap {
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
  }

  .ai-hub-modal-name {
    font-size: 1.15rem;
    line-height: 1.25;
  }

  .ai-hub-modal-subtitle {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
  }

  .ai-hub-modal-meta {
    gap: 0.375rem;
    font-size: 0.8125rem;
  }

  /* Badges always occupy their own full-width row below avatar + info */
  .ai-hub-modal-badges {
    width: 100%;
    order: 3;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.375rem;
  }

  .ai-hub-modal-actions {
    flex-direction: column;
    gap: 0.625rem;
  }

  .ai-hub-btn-connect,
  .ai-hub-btn-download,
  .ai-hub-modal-resume-unavailable {
    width: 100%;
    min-height: 2.75rem;
  }

  .ai-hub-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .ai-hub-stat-item {
    padding: 0.875rem;
  }

  .ai-hub-modal-section {
    margin-bottom: 1.5rem;
  }

  .ai-hub-modal-project-grid {
    grid-template-columns: 1fr;
  }

  .ai-hub-modal-project-card {
    padding: 0.75rem;
  }

  .ai-hub-modal-project-link {
    font-size: 0.75rem;
    padding: 0.35rem 0.55rem;
  }
}
