/* Company profile isolated styles (modern) */

/* Container and header */
#profileModal[data-profile-type="company"] .profile-container { background: var(--profile-bg); border:1px solid var(--profile-border); margin:20px auto 0; padding:30px 30px 30px 30px; border-radius:10px; max-width:900px; width:90%; box-shadow:0 0 20px rgba(0,0,0,0.3); position:relative; display:flex; flex-direction:column; gap:20px; }
#profileModal[data-profile-type="company"] .profile-header { display:flex; justify-content:space-between; align-items:center; margin:0 auto; padding:12px 16px; background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:var(--card-shadow); position:relative; max-width:980px; width:100%; box-sizing:border-box; flex-wrap:nowrap; gap:8px; }
#profileModal[data-profile-type="company"] .profile-header-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
#profileModal[data-profile-type="company"] .profile-header h2 { color:var(--primary-dark); font-size:2rem; font-weight:700; display:flex; align-items:center; gap:12px; margin:0; flex:1; }

/* Ensure our rendered wrapper is constrained within the modal */
#profileModal[data-profile-type="company"] .company-profile {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;

  /* Clean 2-column grid — cards only take the height they need */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Left column: overview + contact stacked */
#profileModal[data-profile-type="company"] .profile-layout-modern { display: contents; }
#profileModal[data-profile-type="company"] .profile-content-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
/* Right column: meta + address stacked */
#profileModal[data-profile-type="company"] .profile-sidebar-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
/* Paired row: free-text (left) + recent-activity (right) */
#profileModal[data-profile-type="company"] .profile-paired-row { display: contents; }
#profileModal[data-profile-type="company"] .paired-left  { min-width: 0; }
#profileModal[data-profile-type="company"] .paired-right { min-width: 0; }

/* Cards fill their column — no artificial height stretching */
#profileModal[data-profile-type="company"] .profile-card-content {
  padding: 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

/* Notes spans full width */
#profileModal[data-profile-type="company"] .notes-card {
  grid-column: 1 / span 2;
}

/* Recent activity — scrollable content, no hard vh cap */
#profileModal[data-profile-type="company"] .recent-activity-card .profile-card-content {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Cards */
#profileModal[data-profile-type="company"] .profile-card {
  background:#fff;
  border-radius:8px;
  box-shadow:0 2px 4px rgba(0,0,0,0.1);
  overflow:hidden;
  position:relative;
  border:1px solid var(--border,#e2e8f0);
  display:flex;
  flex-direction:column;
  margin: 0;
  /* align-self:start prevents grid stretch so cards hug their content */
  align-self: start;
  width: 100%;
}
#profileModal[data-profile-type="company"] .profile-card .profile-section-heading { background:#f8fafc; border-bottom:1px solid #e2e8f0; padding:16px 20px 12px; margin:0; font-size:1.1rem; color:#1e293b; font-weight:600; display:flex; align-items:center; gap:8px; }
#profileModal[data-profile-type="company"] .profile-card .profile-card-content { padding:20px; flex:1; overflow-y:auto; }

/* Paired row children are normal block items in the grid */

/* Avatar block */
#profileModal[data-profile-type="company"] .avatar-block { display:flex; flex-direction:column; align-items:center; gap:8px; }
#profileModal[data-profile-type="company"] .avatar-wrapper { width:96px; height:96px; border-radius:50%; background:#f1f5f9; border:1px solid #e2e8f0; display:flex; align-items:center; justify-content:center; overflow:hidden; cursor:pointer; box-shadow:0 1px 2px rgba(0,0,0,0.06); }
#profileModal[data-profile-type="company"] .avatar-img { width:100%; height:100%; object-fit:cover; display:block; }
#profileModal[data-profile-type="company"] .avatar-fallback { width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:#334155; font-weight:700; font-size:28px; }

/* Overview grid */
#profileModal[data-profile-type="company"] .profile-overview-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  height: 100%;
  min-height: 0;
  align-items: flex-start;
}

#profileModal[data-profile-type="company"] .overview-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

#profileModal[data-profile-type="company"] .field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#profileModal[data-profile-type="company"] .employee-list {
  margin: 4px 0 8px 0;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border-radius: 4px;
  padding: 4px;
  border: 1px solid #e2e8f0;
}

#profileModal[data-profile-type="company"] .employee-item {
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

#profileModal[data-profile-type="company"] .employee-item:hover {
  background: #f1f5f9;
  transform: translateX(2px);
}

#profileModal[data-profile-type="company"] .employee-item a {
  color: #2563eb;
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}

#profileModal[data-profile-type="company"] .employee-item a:hover {
  text-decoration: underline;
}

/* Placement History List - scrollable box matching employee list */
#profileModal[data-profile-type="company"] .placement-history-list {
  margin: 4px 0 8px 0;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #fafbfc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

#profileModal[data-profile-type="company"] .placement-history-item {
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
}

#profileModal[data-profile-type="company"] .placement-history-item:hover {
  background: #f1f5f9;
  transform: translateX(2px);
}

#profileModal[data-profile-type="company"] .placement-history-item a {
  color: #2563eb;
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}

#profileModal[data-profile-type="company"] .placement-history-item a:hover {
  text-decoration: underline;
}

#profileModal[data-profile-type="company"] .placement-date {
  font-weight: 500;
  color: #475569;
}

#profileModal[data-profile-type="company"] .placement-name {
  color: #1e293b;
}

#profileModal[data-profile-type="company"] .placement-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 6px;
  background: #e0e7ff;
  color: #4338ca;
}

/* Different colors for different placement types */
#profileModal[data-profile-type="company"] .placement-history-item:has(.placement-type-badge:contains("PERM")) .placement-type-badge,
#profileModal[data-profile-type="company"] .placement-type-badge {
  background: #dbeafe;
  color: #1e40af;
}

#profileModal[data-profile-type="company"] .no-placements {
  padding: 8px;
  color: #64748b;
  font-style: italic;
  font-size: 14px;
}

/* Field labels */
#profileModal[data-profile-type="company"] .field-row > strong {
  display: block;
  margin-bottom: 2px;
  color: #475569;
  font-size: 0.9em;
}

/* Meta card */
#profileModal[data-profile-type="company"] .meta-fields { display:flex; flex-direction:column; gap:6px; }
#profileModal[data-profile-type="company"] .meta-fields > div { display:flex; align-items:baseline; gap:10px; }
#profileModal[data-profile-type="company"] .meta-fields > div > strong { width:110px; flex:0 0 110px; text-align:left; padding-right:4px; }

/* Simple two-column grid */
#profileModal[data-profile-type="company"] .grid-two { display:grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap:12px; }

/* Notes list & card */
#profileModal[data-profile-type="company"] #profileNotesList { max-height: 220px; overflow:auto; display:flex; flex-direction:column; gap:10px; padding-right:6px; }
#profileModal[data-profile-type="company"] .note-item { padding:10px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:6px; }
#profileModal[data-profile-type="company"] .note-meta { font-size:12px; color:#64748b; margin-bottom:4px; }
#profileModal[data-profile-type="company"] .note-content { white-space:pre-wrap; word-break:break-word; color:#0f172a; }
#profileModal[data-profile-type="company"] .note-add textarea { width:100%; min-height:70px; }

#profileModal[data-profile-type="company"] .notes-card { margin: 0; height: 320px; display:flex; flex-direction:column; }
#profileModal[data-profile-type="company"] .notes-card .profile-card-content { padding-bottom: 12px; flex: 1 1 auto; display:flex; flex-direction:column; min-height:0; }
#profileModal[data-profile-type="company"] .notes-card #profileNotesList { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height:0; }

/* Input styles */
#profileModal[data-profile-type="company"] .note-add textarea { border:1px solid #e2e8f0; border-radius:8px; padding:12px 14px; background:#f8fafc; outline:none; box-shadow: inset 0 1px 2px rgba(0,0,0,0.04); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
#profileModal[data-profile-type="company"] .note-add textarea:focus { border-color:#94a3b8; background:#ffffff; box-shadow:0 0 0 3px rgba(148,163,184,0.25), inset 0 1px 2px rgba(0,0,0,0.05); }
#profileModal[data-profile-type="company"] .note-add > div { margin-top:10px !important; }

/* Activity */
#profileModal[data-profile-type="company"] .activity-timeline { display:flex; flex-direction:column; gap:8px; }
#profileModal[data-profile-type="company"] .activity-item { padding:10px; border:1px solid #e2e8f0; border-radius:6px; background:#fff; }
#profileModal[data-profile-type="company"] .activity-meta { font-size:12px; color:#64748b; margin-bottom:4px; }
#profileModal[data-profile-type="company"] .activity-desc { white-space:pre-wrap; }

/* Header title block */
#profileModal[data-profile-type="company"] .profile-title-block { display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
#profileModal[data-profile-type="company"] .profile-title-block .title-text { line-height:1.1; }
#profileModal[data-profile-type="company"] .profile-subtitle { font-size:14px; color:#64748b; line-height:1.1; }

