/*
 * Job Detail Page - Design Variants A, B, C
 * Uses existing --da-accent custom properties from _job_cards_v2.css
 */

/* ========================================
   Shared: Layout & Typography
   ======================================== */
.jd-page {
  max-width: 1100px;
  margin: 0 auto;
}

.jd-header {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--da-card-shadow);
}

.jd-header-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.jd-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.jd-logo-fallback {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
  flex-shrink: 0;
}

.jd-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin: 0 0 0.25rem;
}

.jd-company-name {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--da-accent);
  text-decoration: none;
}

.jd-company-name:hover {
  text-decoration: underline;
  color: var(--da-accent-hover);
}

/* ========================================
   Shared: Metadata Row
   ======================================== */
.jd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.75rem;
}

.jd-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.jd-meta-item i {
  font-size: 0.8125rem;
  color: #9ca3af;
}

.jd-salary {
  font-weight: 600;
  color: var(--da-success);
}

/* ========================================
   Shared: Action Buttons
   ======================================== */
.jd-actions {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  margin-top: 1rem;
}

.jd-btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--da-accent);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.jd-btn-apply:hover {
  background: var(--da-accent-hover);
  color: #fff;
}

.jd-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.jd-btn-save:hover {
  border-color: var(--da-accent);
  color: var(--da-accent);
}

.jd-btn-save-active {
  background: var(--da-accent-light);
  border-color: var(--da-accent);
  color: var(--da-accent);
  font-weight: 600;
}

.jd-btn-save-active:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
}

.jd-btn-save:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ========================================
   Shared: Sticky Apply Bar
   ======================================== */
.jd-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 12px rgb(0 0 0 / 8%);
  padding: 0.75rem 0;
  z-index: 1040;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.jd-sticky-bar-visible {
  transform: translateY(0);
}

.jd-sticky-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.jd-sticky-bar-info {
  min-width: 0;
}

.jd-sticky-bar-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jd-sticky-bar-company {
  font-size: 0.8125rem;
  color: #6b7280;
}

/* ========================================
   Shared: Two-Column Content
   ======================================== */
.jd-content {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  align-items: start;
}

@media (width <= 900px) {
  .jd-content {
    grid-template-columns: 1fr;
  }
}

.jd-main {
  min-width: 0;
}

.jd-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: var(--da-card-shadow);
}

.jd-card + .jd-card {
  margin-top: 1rem;
}

.jd-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem;
}

/* ========================================
   Shared: Description Formatting
   ======================================== */
.jd-description {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #374151;
  max-width: 72ch;
}

.jd-description h1,
.jd-description h2,
.jd-description h3,
.jd-description h4 {
  font-weight: 600;
  color: #111827;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.jd-description h1 { font-size: 1.25rem; }
.jd-description h2 { font-size: 1.125rem; }
.jd-description h3 { font-size: 1rem; }

.jd-description ul,
.jd-description ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.jd-description li {
  margin-bottom: 0.375rem;
}

.jd-description p {
  margin-bottom: 0.875rem;
}

.jd-description a {
  color: var(--da-accent);
}

/* ========================================
   Shared: Sidebar Company Card
   ======================================== */
.jd-sidebar-company {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.jd-sidebar-company-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.jd-sidebar-company-name {
  font-weight: 600;
  color: #111827;
  font-size: 0.9375rem;
}

.jd-sidebar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--da-accent);
  text-decoration: none;
}

.jd-sidebar-link:hover {
  text-decoration: underline;
}

/* ========================================
   Shared: Application Tracker
   ======================================== */
.jd-tracker {
  padding: 1rem 1.25rem;
}

.jd-tracker-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem;
}

.jd-tracker-subtitle {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0 0 0.75rem;
}

/* ========================================
   Shared: Breadcrumb
   ======================================== */
.jd-breadcrumb {
  margin-bottom: 1rem;
}

.jd-breadcrumb a {
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: none;
}

.jd-breadcrumb a:hover {
  color: var(--da-accent);
}

.jd-breadcrumb span {
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 0 0.375rem;
}

/* ========================================
   Variant B: Skills Tags
   ======================================== */
.jd-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.jd-skill-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--da-accent-light);
  color: var(--da-accent);
}

/* ========================================
   Variant B: Structured Sidebar Details
   ======================================== */
.jd-sidebar-details {
  list-style: none;
  padding: 0;
  margin: 0;
}

.jd-sidebar-detail {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.jd-sidebar-detail:last-child {
  border-bottom: none;
}

.jd-sidebar-detail-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.jd-sidebar-detail-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.125rem;
}

.jd-sidebar-detail-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

/* ========================================
   Variant B: Related Jobs Skeleton
   ======================================== */
.jd-related {
  margin-top: 1.25rem;
}

.jd-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (width <= 900px) {
  .jd-related-grid {
    grid-template-columns: 1fr;
  }
}

.jd-related-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: var(--da-card-shadow);
}

.jd-skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: jd-shimmer 1.5s infinite;
  border-radius: 4px;
}

.jd-skeleton-line {
  height: 14px;
  margin-bottom: 0.5rem;
}

.jd-skeleton-line-short {
  width: 60%;
}

.jd-skeleton-line-med {
  width: 80%;
}

@keyframes jd-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================
   Variant B: Enhanced Company Card
   ======================================== */
.jd-company-description {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0.5rem 0;
}

.jd-company-meta {
  font-size: 0.8125rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ========================================
   Variant C: Tabs
   ======================================== */
.jd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.25rem;
}

.jd-tab {
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s ease, border-color 0.15s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.jd-tab:hover {
  color: #111827;
}

.jd-tab-active {
  color: var(--da-accent);
  border-bottom-color: var(--da-accent);
  font-weight: 600;
}

/* ========================================
   Variant C: AI Summary Placeholder
   ======================================== */
.jd-summary-placeholder {
  padding: 1.5rem;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  text-align: center;
  color: #6b7280;
}

.jd-summary-placeholder i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
  color: #9ca3af;
}

/* ========================================
   Variant C: How You Match
   ======================================== */
.jd-match-section {
  margin-bottom: 1rem;
}

.jd-match-item {
  margin-bottom: 0.75rem;
}

.jd-match-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
}

.jd-match-skill {
  font-weight: 500;
  color: #374151;
}

.jd-match-percent {
  color: #9ca3af;
}

.jd-match-bar {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}

.jd-match-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--da-accent);
  transition: width 0.3s ease;
}

.jd-match-fill-high {
  background: var(--da-success);
}

.jd-match-fill-med {
  background: #f59e0b;
}

/* ========================================
   Variant C: Freshness Badge
   ======================================== */
.jd-freshness {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.jd-freshness-new {
  background: #ecfdf5;
  color: var(--da-success);
}

.jd-freshness-recent {
  background: #fffbeb;
  color: #b45309;
}

.jd-freshness-older {
  background: #f3f4f6;
  color: #6b7280;
}

/* ========================================
   Variant C: Q&A Accordion
   ======================================== */
.jd-qa {
  margin-top: 1.25rem;
}

.jd-qa-item {
  border-bottom: 1px solid #e5e7eb;
}

.jd-qa-item:last-child {
  border-bottom: none;
}

.jd-qa-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #111827;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.jd-qa-question:hover {
  color: var(--da-accent);
}

.jd-qa-question i {
  font-size: 0.75rem;
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.jd-qa-item.open .jd-qa-question i {
  transform: rotate(180deg);
}

.jd-qa-answer {
  display: none;
  padding: 0 0 0.875rem;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.6;
}

.jd-qa-item.open .jd-qa-answer {
  display: block;
}

/* ========================================
   Variant C: Share Button
   ======================================== */
.jd-btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.jd-btn-share:hover {
  border-color: var(--da-accent);
  color: var(--da-accent);
}

/* ========================================
   Responsive: Mobile
   ======================================== */
@media (width <= 640px) {
  .jd-header {
    padding: 1rem 1.25rem;
  }

  .jd-title {
    font-size: 1.25rem;
  }

  .jd-card {
    padding: 1rem 1.25rem;
  }

  .jd-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .jd-btn-apply,
  .jd-btn-save,
  .jd-btn-share {
    justify-content: center;
  }

  .jd-sticky-bar-info {
    max-width: 60%;
  }

  .jd-related-grid {
    grid-template-columns: 1fr;
  }
}
