/* 
 * CareerNest - Single Job Listing Styles
 * Modern job listing layout with gradient banner design (matching employer profile)
 */

/* Container */
.cn-job-listing-page {
  min-height: 100vh;
  padding: 0;
}

.cn-job-container {
  max-width: 100%;
  margin: 0 auto;
}

/* ==========================================
   JOB BANNER - At Top of Main Content
   ========================================== */

.cn-job-banner {
  height: 150px;
  background: linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.2) 0%,
      transparent 30%,
      transparent 70%,
      rgba(0, 0, 0, 0.2) 100%
    ),
    var(--cn-primary-btn);
  position: relative;
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
}

/* ==========================================
   JOB INFO SECTION - Vertical Layout
   ========================================== */

.cn-job-info-section {
  background: #fff;
  border-radius: 0 0 12px 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Company Logo Badge */
.cn-job-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.cn-company-logo-badge {
  flex-shrink: 0;
}

.cn-company-logo-badge img {
  width: 148px;
  height: 148px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.cn-share-dropdown {
  position: relative;
}

.cn-share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
}

.cn-share-btn:hover {
  background: var(--cn-primary-btn);
  border-color: var(--cn-primary-btn);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cn-share-btn svg {
  width: 20px;
  height: 20px;
}

.cn-share-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.cn-share-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cn-share-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s ease;
  font-size: 14px;
}

.cn-share-option:hover {
  background: #f5f5f5;
  color: #333;
}

.cn-share-option svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #666;
}

.cn-share-option:hover svg {
  color: var(--cn-primary-btn);
}

/* Job Title */
.cn-job-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #1a1a1a;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cn-applicants-count {
  font-size: 14px;
  font-weight: 500;
  color: #888;
}

/* Meta Items - Vertical List with Icons */
.cn-job-meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  color: #666;
  font-size: 15px;
}

.cn-job-meta-item svg {
  flex-shrink: 0;
  color: inherit;
  width: 20px;
  height: 20px;
}

.cn-job-meta-item span {
  color: inherit;
}

.cn-job-meta-item a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cn-job-meta-item a:hover {
  color: var(--cn-primary-btn);
  text-decoration: underline;
}

.cn-company-link {
  color: #666;
  text-decoration: none;
  font-weight: 500;
}

.cn-company-link:hover {
  color: var(--cn-primary-btn);
  text-decoration: underline;
}

.cn-company-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cn-view-all-jobs-link {
  color: var(--cn-primary-btn) !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.cn-view-all-jobs-link:hover {
  text-decoration: underline;
  opacity: 0.8;
  color: var(--cn-primary-btn) !important;
}

.cn-remote-badge {
  background: #10b981;
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Job Categories */
.cn-job-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.cn-category-badge {
  background: var(--cn-primary-btn);
  color: white;
  padding: 0.375rem 0.875rem;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

/* Position Filled Notice */
.cn-position-filled-notice {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 1rem;
}

/* Quick Apply Button */
.cn-quick-apply-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--cn-primary-btn);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  margin-top: 1.5rem;
  transition: all 0.2s ease;
}

.cn-quick-apply-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: white;
}

/* Application Status Badge */
.cn-application-status-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  color: #155724;
  font-size: 15px;
}

.cn-application-status-badge svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.cn-application-status-badge strong {
  font-weight: 600;
}

/* ==========================================
   JOB BODY
   ========================================== */

.cn-job-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  padding: 2rem 1rem 2rem 1rem;
}

.cn-job-main {
  min-width: 0;
}

/* Job Sections */
.cn-job-section {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Bottom Apply Section */
.cn-bottom-apply-section {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.cn-bottom-apply-section .cn-apply-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--cn-primary-btn);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.2s ease;
}

.cn-bottom-apply-section .cn-apply-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  color: white;
}

.cn-section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--cn-primary-btn);
}

.cn-section-content {
  color: #444;
  line-height: 1.7;
}

.cn-section-content p {
  margin: 0 0 1rem 0;
}

.cn-section-content ul,
.cn-section-content ol {
  margin: 0 0 1rem 1.5rem;
  line-height: 1.8;
}

.cn-section-content li {
  margin-bottom: 0.5rem;
}

/* Application Section */
.cn-job-apply-section {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.cn-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: var(--cn-primary-btn);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.cn-apply-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  color: white;
}

.cn-apply-btn svg {
  width: 20px;
  height: 20px;
}

/* Already Applied Section */
.cn-job-apply-section.cn-already-applied {
  background: #d4edda;
  border: 2px solid #c3e6cb;
}

.cn-applied-notice {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  text-align: left;
}

.cn-applied-notice svg {
  flex-shrink: 0;
}

.cn-applied-text {
  flex: 1;
}

.cn-applied-text h3 {
  color: #155724;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.cn-applied-text p {
  color: #155724;
  margin: 0 0 1rem 0;
  font-size: 15px;
}

.cn-view-dashboard-link {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: white;
  color: #155724;
  text-decoration: none;
  border: 2px solid #155724;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.cn-view-dashboard-link:hover {
  background: #155724;
  color: white;
}

/* Position Filled Section */
.cn-job-apply-section.cn-position-filled {
  background: #f8d7da;
  border: 2px solid #f5c6cb;
}

.cn-filled-notice {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  text-align: left;
}

.cn-filled-notice svg {
  flex-shrink: 0;
}

.cn-filled-text {
  flex: 1;
}

.cn-filled-text h3 {
  color: #721c24;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.cn-filled-text p {
  color: #721c24;
  margin: 0;
  font-size: 15px;
}

/* Job Navigation */
.cn-job-navigation {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cn-nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cn-nav-prev,
.cn-nav-all,
.cn-nav-next {
  color: var(--cn-primary-btn);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color 0.2s ease;
}

.cn-nav-prev:hover,
.cn-nav-all:hover,
.cn-nav-next:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.cn-nav-all {
  padding: 0.5rem 1.5rem;
  background: var(--cn-primary-btn);
  color: white;
  border-radius: 8px;
}

.cn-nav-all:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.cn-job-sidebar {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.cn-sidebar-card {
  background: #fafafa;
  border: 1px solid #dadada;
  border-radius: 8px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: none;
}

.cn-sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
}

/* Company Card */
.cn-company-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.cn-company-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.cn-company-logo-thumb {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: contain;
  border: 2px solid #e5e7eb;
  flex-shrink: 0;
  background: #fff;
}

.cn-company-name-section {
  flex: 1;
}

.cn-company-name-section h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.25rem 0;
}

.cn-company-name-link {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cn-company-name-link:hover {
  color: var(--cn-primary-btn);
  text-decoration: underline;
}

.cn-company-tagline {
  font-size: 0.875rem;
  color: #666;
  font-style: italic;
  margin: 0;
}

.cn-company-description {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1.25rem 0;
  padding: 1rem 0;
  border-top: 1px solid #e5e7eb;
}

.cn-company-description p {
  margin: 0;
}

/* Company Facts */
.cn-company-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid #e5e7eb;
}

.cn-fact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cn-fact-label {
  font-size: 0.875rem;
  color: #888;
  font-weight: 500;
}

.cn-fact-value {
  font-size: 0.875rem;
  color: #1a1a1a;
  font-weight: 600;
  text-align: right;
}

/* Company Actions */
.cn-company-actions {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.cn-company-profile-btn {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--cn-primary-btn);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
}

.cn-company-profile-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: white;
}

/* Related Jobs */
.cn-related-jobs-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.cn-related-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cn_related_job_card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cn_related_job_card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.cn_related_job_card-top {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.cn_related_job_card__img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.cn_related_job_card__img-placeholder {
  width: 50px;
  height: 50px;
  background: #e0e0e0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #666;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.cn_related_job_card__title {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.cn_related_job_card__title a {
  color: #333;
  text-decoration: none;
  font-weight: 600;
}

.cn_related_job_card__title a:hover {
  color: var(--cn-primary-btn);
  text-decoration: underline;
}

.cn_related_job_card__company,
.cn_related_job_card__location {
  color: #666;
  font-size: 0.85rem;
}

.cn_related_job_card__salary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: #333;
  font-size: 0.9rem;
  font-weight: 500;
}

.cn_related_job_card__salary svg {
  flex-shrink: 0;
}

.cn_related_job_card hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 1rem 0;
}

.cn_related_job_card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cn_related_job_card__modified {
  color: #999;
  font-size: 0.8rem;
}

.cn-no-related {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1024px) {
  .cn-job-body {
    grid-template-columns: 1fr;
  }

  .cn-job-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .cn-job-banner {
    height: 120px;
  }

  .cn-job-body {
    padding: 0 0.5rem 1rem 0.5rem;
  }

  .cn-job-info-section {
    padding: 1.5rem;
  }

  .cn-job-info-header {
    gap: 1rem;
  }

  .cn-job-logo {
    width: 80px;
    height: 80px;
  }

  .cn-job-title {
    font-size: 22px;
  }

  .cn-job-company-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .cn-job-meta-tags {
    flex-wrap: wrap;
  }

  .cn-job-type-tag,
  .cn-salary-tag,
  .cn-deadline-tag {
    width: fit-content;
  }

  .cn-application-status-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cn-job-section {
    padding: 1.5rem;
  }

  .cn-section-title {
    font-size: 1.5rem;
  }

  .cn-job-container {
    margin: 0;
  }

  .cn-job-apply-section {
    padding: 1.5rem;
  }

  .cn-apply-btn {
    width: 100%;
    justify-content: center;
  }

  .cn-nav-links {
    flex-direction: column;
    align-items: stretch;
  }

  .cn-nav-prev,
  .cn-nav-next {
    text-align: center;
  }

  .cn-nav-all {
    text-align: center;
  }

  .cn-company-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cn-company-name-section {
    width: 100%;
  }

  .cn-job-info-section {
    margin-bottom: 1rem;
  }

  .cn-company-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .cn-section-content ul,
  .cn-section-content ol {
    margin: 0;
    padding-left: 2.2rem;
  }
}

@media (max-width: 480px) {
  .cn-job-title {
    font-size: 20px;
  }

  .cn-sidebar-card {
    padding: 1.25rem;
  }

  .cn-job-section {
    padding: 1.25rem;
  }

  .cn-company-logo-thumb {
    width: 60px;
    height: 60px;
  }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
  .cn-job-listing-page {
    background: white;
  }

  .cn-job-header-wrapper,
  .cn-job-section,
  .cn-sidebar-card {
    box-shadow: none;
    page-break-inside: avoid;
  }

  .cn-job-banner {
    height: 80px;
  }

  .cn-application-status-badge,
  .cn-job-apply-section,
  .cn-job-navigation,
  .cn-related-jobs-card {
    display: none;
  }
}
