/* Components: Agent Profile */

/* ---- Agent Social Links ---- */
.agent-social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-muted);
  font-size: var(--font-size-lg);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.social-icon:hover {
  background: var(--social-color, var(--color-primary));
  color: #fff;
  transform: scale(1.15);
}

/* ---- Agent Filter Bar + Panel ---- */
.agent-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.agent-filter-count {
  font-size: var(--font-size-sm);
  color: var(--color-muted);
  font-weight: var(--font-weight-medium);
}

.agent-filter-toggle.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.agent-filter-search {
  margin-left: auto;
  position: relative;
  min-width: 200px;
}

.agent-filter-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
  font-size: var(--font-size-sm);
}

.agent-filter-search input {
  padding-left: 2rem;
}

.agent-filter-panel {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.agent-filter-group {
  margin-bottom: var(--space-md);
}

.agent-filter-group:last-of-type {
  margin-bottom: var(--space-lg);
}

.agent-filter-group h4 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

.filter-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.25em 0.75em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.filter-chip input {
  display: none;
}

.filter-chip:hover {
  border-color: var(--color-primary);
}

.filter-chip:has(input:checked) {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

@media (max-width: 575px) {
  .agent-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .agent-filter-search {
    margin-left: 0;
    min-width: 100%;
  }
  .agent-filter-bar > .agent-filter-count,
  .agent-filter-bar > .agent-filter-toggle {
    align-self: flex-start;
  }
}

/* ---- Agent Profile Redesign ---- */

/* Hero Section */
.agent-hero {
  background: var(--color-nav);
  color: #fff;
  padding: var(--space-2xl) 0 var(--space-xl);
}

.agent-hero + .page-body {
  padding-top: var(--space-xl);
}

.agent-hero h1 { color: #fff; }

.agent-hero .breadcrumb a,
.agent-hero .breadcrumb span {
  color: rgba(255, 255, 255, 0.6);
}
.agent-hero .breadcrumb a:hover { color: #fff; }

/* Hero Layout: flexbox so we can reverse on mobile */
.agent-hero-layout {
  display: flex;
  gap: var(--space-xl);
  align-items: start;
  margin-top: var(--space-lg);
}

.agent-hero-photo-col {
  flex-shrink: 0;
  text-align: center;
}

.agent-hero-photo-wrap {
  position: relative;
  display: inline-block;
}

.agent-hero-photo {
  width: 220px;
  height: 275px;
  border-radius: var(--radius-lg);
  border: 3px solid rgba(255, 255, 255, 0.25);
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.agent-team-logo {
  position: absolute;
  bottom: -6px;
  left: -6px;
  width: 52px;
  height: 52px;
  border-radius: 22%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  background: #fff;
  transition: transform 0.15s ease;
}

.agent-team-logo:hover {
  transform: scale(1.1);
}

.agent-team-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-hero-info {
  flex: 1;
  min-width: 0;
}

.agent-hero-name {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: #fff;
  margin-bottom: 0;
  line-height: var(--line-height-tight);
}

.agent-hero-title {
  font-size: var(--font-size-base);
  opacity: 0.8;
  margin-top: 2px;
}

.agent-hero-designations {
  font-size: var(--font-size-sm);
  opacity: 0.6;
  margin-top: 2px;
}

.agent-hero-office {
  display: inline-block;
  font-size: var(--font-size-xs);
  background: rgba(255, 255, 255, 0.12);
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
  letter-spacing: 0.02em;
}

.agent-hero-info .badge-pacesetter,
.agent-hero-info .badge-office {
  display: inline-block;
  margin-top: var(--space-xs);
}

/* Sales Carousel */
kpdd-sales-carousel {
  display: block;
  width: 100%;
  min-width: 0;
}

.sales-carousel-wrap {
  position: relative;
  overflow: hidden;
  margin-top: var(--space-md);
}

.sales-carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.carousel-group-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  padding: 0 var(--space-xs) var(--space-2xs);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin: 0 var(--space-xs) var(--space-xs);
}

.carousel-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.carousel-group-cards {
  display: flex;
  flex: 1;
}

/* Size each group proportionally to its card count */
.carousel-group[data-count="1"] { flex: 1; }
.carousel-group[data-count="2"] { flex: 2; }
.carousel-group[data-count="3"] { flex: 3; }
.carousel-group[data-count="4"] { flex: 4; }

.carousel-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 var(--space-xs);
  box-sizing: border-box;
}

.carousel-card a {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  transition: background var(--transition-fast);
}

.carousel-card a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.carousel-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.carousel-card-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.25);
  font-size: var(--font-size-2xl);
}

.carousel-card-body {
  padding: var(--space-xs) var(--space-sm);
}

.carousel-card-price {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-card-addr {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.carousel-see-more {
  display: block;
  text-align: right;
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.carousel-see-more:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* Agent Stats Row */
.agent-stats-row {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-wrap: wrap;
}

.agent-stat-item {
  text-align: center;
  min-width: 80px;
}

.agent-stat-value {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: #fff;
  line-height: 1;
}

.agent-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

/* Sticky Sidebar */
.agent-sidebar-sticky {
  position: sticky;
  top: 80px;
}

/* Section Header Row */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}

.section-header-row h3 {
  margin: 0;
}

/* Service Area Tags */
.service-area-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.service-area-tags .badge-office {
  text-decoration: none;
}

.service-area-tags a.badge-office:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Agent Bookend Footer */
.agent-bookend {
  background: var(--color-bg-alt);
  padding: var(--space-3xl) 0;
  margin-top: var(--space-3xl);
}

.agent-bookend-card {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
}

.agent-bookend-card img {
  width: 120px;
  height: 150px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.agent-bookend-info {
  flex: 1;
}

.agent-bookend-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

/* Video Recorder */
.video-record-btn.recording {
  color: var(--color-danger);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.video-preview,
.video-playback {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-md);
  margin: var(--space-sm) 0;
}

/* Show More hidden content */
.hidden-content {
  display: none;
}

/* Responsive */
@media (max-width: 991px) {
  .agent-hero-photo {
    width: 180px;
    height: 225px;
  }

  .agent-team-logo {
    width: 44px;
    height: 44px;
  }

  .agent-sidebar-sticky {
    position: static;
  }
}

@media (orientation: portrait) {
  .agent-hero-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
  }

  .agent-hero-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .agent-hero-photo {
    width: 160px;
    height: 200px;
    margin: 0 auto;
  }

  .agent-team-logo {
    width: 40px;
    height: 40px;
    bottom: -4px;
    left: -4px;
  }

  kpdd-sales-carousel {
    display: none;
  }

  .agent-hero {
    padding: var(--space-xl) 0 var(--space-lg);
  }

  .agent-hero-name {
    font-size: var(--font-size-xl);
  }

  .agent-stats-row {
    gap: var(--space-sm) var(--space-md);
  }

  .agent-stat-item {
    min-width: 70px;
  }

  .agent-bookend-card {
    flex-direction: column;
    text-align: center;
  }

  .team-hero-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .team-hero-logo img {
    width: 80px;
    height: 80px;
  }

  .team-hero-identity {
    padding: var(--space-md) 0 var(--space-lg);
  }

}

/* ---- Departed Agent: Olive-Branch Contact Relay ---- */
.olive-branch-card {
  background: var(--color-bg-white, #fff);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary, #1a365d);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}
.olive-branch-form .form-group {
  margin-bottom: var(--space-md);
}
.olive-branch-form .form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}
.olive-branch-form .form-control {
  width: 100%;
}
.olive-branch-form .form-row {
  margin-bottom: var(--space-md);
}
@media (max-width: 480px) {
  .olive-branch-form .form-row {
    grid-template-columns: 1fr !important;
  }
}
