/* Trade Union SaaS - Members Directory & Individual Profile Dossier Stylesheet */

/* Member Dossier Hero */
.profile-avatar-large {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--primary-500);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.avatar-status-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-surface);
}

.avatar-status-badge.active { background: var(--emerald-500); }
.avatar-status-badge.pending { background: var(--amber-500); }
.avatar-status-badge.inactive { background: var(--slate-400); }
.avatar-status-badge.suspended { background: var(--rose-500); }

.profile-pos {
  color: var(--primary-600);
}

.profile-company-link {
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.profile-company-link:hover {
  color: var(--primary-600);
  text-decoration: underline;
}

/* 2-Column Dossier Layout */
.member-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  width: 100%;
  min-width: 0;
}

.member-dossier-col, .member-card-col {
  min-width: 0;
}

/* ==========================================
   DIGITAL 3D FLIPPABLE UNION ID CARD
   ========================================== */
.id-card-wrapper {
  padding: 16px 20px;
  width: 100%;
}

.id-card-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.id-card-title-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.id-card-btns {
  display: flex;
  gap: 8px;
}

.id-card-perspective {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 10px 0;
}

.id-card-3d {
  width: 100%;
  max-width: 440px;
  min-height: 260px;
  aspect-ratio: 85.6 / 54;
  position: relative;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  cursor: grab;
}
.id-card-3d:active {
  cursor: grabbing;
}

.id-card-3d.flipped {
  transform: rotateY(180deg);
}

.id-card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
  padding: clamp(14px, 2.5vw, 20px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 35px -5px rgba(15, 23, 42, 0.35), 0 8px 10px -6px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

/* FRONT FACE */
.id-card-front {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.id-card-front::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6, #10B981);
}

.id-card-hologram-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, 
    transparent 20%, 
    rgba(255, 255, 255, 0.12) 35%, 
    rgba(59, 130, 246, 0.18) 45%, 
    rgba(139, 92, 246, 0.18) 55%, 
    rgba(16, 185, 129, 0.12) 65%, 
    transparent 80%);
  pointer-events: none;
  background-size: 200% 200%;
  transition: opacity 0.3s ease;
  mix-blend-mode: overlay;
}

.id-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.id-card-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.id-card-crest {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2563EB, #4F46E5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.id-card-org-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-card-org-sub {
  font-size: 9px;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-card-status-badge {
  background: #10B981;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.id-card-status-badge.pending { background: #F59E0B; }
.id-card-status-badge.inactive { background: #64748B; }
.id-card-status-badge.suspended { background: #E11D48; }

.id-card-body {
  display: flex;
  gap: 14px;
  flex: 1;
  min-height: 0;
  align-items: center;
}

.id-card-photo-box {
  position: relative;
  width: clamp(68px, 16vw, 78px);
  height: clamp(84px, 20vw, 96px);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #3B82F6;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.id-card-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.id-card-details {
  flex: 1;
  min-width: 0;
}

.id-card-member-name {
  font-size: clamp(13px, 2.2vw, 15px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-card-position {
  font-size: 11px;
  color: #93C5FD;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-card-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.id-field-lbl {
  display: block;
  font-size: 8px;
  color: #94A3B8;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.id-field-val {
  display: block;
  font-size: 10.5px;
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-field-val.highlight {
  color: #60A5FA;
  font-family: monospace;
}

.id-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
  margin-top: auto;
  flex-shrink: 0;
}

.id-card-barcode-mock {
  font-size: 8.5px;
  color: #64748B;
  font-family: monospace;
  letter-spacing: 1px;
}

.id-card-seal {
  font-size: 8.5px;
  font-weight: 700;
  color: #3B82F6;
  letter-spacing: 0.06em;
}

/* BACK FACE */
.id-card-back {
  background: #FFFFFF;
  color: #0F172A;
  transform: rotateY(180deg);
  border: 1px solid #CBD5E1;
  padding: 0;
}

.id-card-back-header {
  background: #0F172A;
  height: 36px;
  margin-bottom: 10px;
  position: relative;
  flex-shrink: 0;
}

.magstripe {
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 26px;
  background: #1E293B;
}

.id-card-back-body {
  display: flex;
  gap: 12px;
  padding: 0 16px;
  flex: 1;
  min-height: 0;
  align-items: center;
}

.id-card-qr-box {
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}

.id-card-qr-box img {
  width: 70px;
  height: 70px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 2px;
}

.id-card-qr-box span {
  font-size: 7.5px;
  font-weight: 700;
  color: #64748B;
  margin-top: 3px;
}

.id-card-back-text {
  flex: 1;
  min-width: 0;
}

.id-card-back-text h5 {
  font-size: 10px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 2px;
}

.id-card-back-text p {
  font-size: 8.5px;
  color: #64748B;
  line-height: 1.3;
  margin-bottom: 4px;
}

.id-back-contact {
  font-size: 8px;
  color: #334155;
  margin-bottom: 6px;
}

.id-signature-area {
  border-top: 1px solid #CBD5E1;
  padding-top: 2px;
}

.sig-mock {
  font-family: 'Brush Script MT', cursive, sans-serif;
  font-size: 14px;
  color: #1E40AF;
  line-height: 1;
}

.sig-label {
  font-size: 7px;
  color: #94A3B8;
  font-weight: 700;
}

.id-card-back-footer {
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  padding: 5px 16px;
  font-size: 8px;
  color: #94A3B8;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Notes box */
.member-notes-box {
  padding: 18px 20px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Timeline */
.timeline-feed {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-step {
  display: flex;
  gap: 14px;
  position: relative;
}

.timeline-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 5px;
  bottom: -16px;
  width: 2px;
  background: var(--border-color);
}

.timeline-step:last-child::before {
  display: none;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-text strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
}

.timeline-text span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.timeline-text small {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.company-badge-sm {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.company-link {
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.company-link:hover {
  color: var(--primary-600);
}

.mono-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 1150px) {
  .member-profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
