/*
 * Filename: single-job.css
 * File path: css/single-job.css
*/

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary-color: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --text-main: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.single-job-main {
  background: #fff;
  color: var(--text-main);
  font-family: "Inter", sans-serif;
  padding-bottom: 60px;
}

.job-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- HEADER --- */
.job-header {
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
}

.header-top {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.company-logo {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #fff;
  position: relative;
}

.company-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Edit Job Button - Overlay on Logo */
.job-edit-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.job-edit-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

.job-edit-btn svg {
  flex-shrink: 0;
}

.header-info {
  flex: 1;
}

.job-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.2;
  color: var(--text-main);
}

.company-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 12px;
}

.company-link:hover {
  text-decoration: underline;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-item svg {
  color: var(--text-muted);
}

.header-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pill.mode {
  background: #eff6ff;
  color: #3b82f6;
}

.pill.urgency {
  background: #fffbeb;
  color: #d97706;
}

.pill.urgency.urgent {
  background: #fef2f2;
  color: #ef4444;
}

.pill.urgency.immediate-hire {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.header-actions {
  flex-shrink: 0;
}

.btn-apply {
  display: inline-block;
  background: var(--primary-gradient);
  color: #fff;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

.btn-apply:hover {
  transform: translateY(-2px);
}

/* --- GRID LAYOUT --- */
.job-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

/* --- MAIN CONTENT --- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main);
  border-left: 4px solid var(--primary-color);
  padding-left: 12px;
}

.job-section {
  margin-bottom: 40px;
}

.section-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.section-body p {
  margin-bottom: 1.5em;
}

/* Requirements */
.req-group {
  margin-bottom: 24px;
}

.req-group h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tag.school {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.req-item {
  background: var(--bg-light);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.req-item.full-width {
  grid-column: span 2;
}

.req-item .label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.req-item .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Languages */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  background: var(--bg-light);
  padding: 20px;
  border-radius: var(--radius-md);
}

.lang-col h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.lang-col p {
  font-weight: 600;
  margin: 0;
}

/* --- SIDEBAR --- */
.sidebar-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.sidebar-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.overview-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.overview-list .icon {
  font-size: 1.2rem;
}

.overview-list .label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.overview-list .val {
  font-weight: 600;
  color: var(--text-main);
}

.check-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-color, #10b981);
  font-weight: bold;
}

.meta-list li {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.meta-list li.warning-text {
  color: #d97706;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- FOOTER --- */
.apply-footer {
  text-align: center;
  background: var(--bg-light);
  padding: 40px;
  border-radius: var(--radius-lg);
  margin-top: 40px;
}

.apply-footer h2 {
  margin-bottom: 10px;
}

.btn-apply-large {
  background: var(--text-main);
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 20px;
  transition: opacity 0.2s;
}

.btn-apply-large:hover {
  opacity: 0.9;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-meta {
    justify-content: center;
  }

  .header-pills {
    justify-content: center;
  }

  /* Reordering Logic */
  .job-content-grid {
    display: flex;
    flex-direction: column;
  }

  .content-main,
  .content-sidebar {
    display: contents; /* Unwrap containers to allow reordering of children */
  }

  /* Order 1: Job Overview (Salary, Date, etc.) */
  .sidebar-card.overview {
    order: 1;
  }

  /* Order 2: Application (New) */
  .sidebar-card.application-card {
    order: 2;
  }

  /* Order 3: Description */
  .job-section.description {
    order: 3;
  }

  /* Order 4: Requirements */
  .job-section.requirements {
    order: 4;
  }

  /* Order 5: Student & Class Profile */
  .sidebar-card.student-profile {
    order: 5;
  }

  /* Order 6: Work Conditions */
  .sidebar-card.conditions {
    order: 6;
  }

  /* Order 7: Benefits */
  .sidebar-card.benefits {
    order: 7;
  }

  /* Order 8: Languages */
  .job-section.languages {
    order: 8;
  }

  /* Order 9: Candidate Preferences */
  .sidebar-card.demographics {
    order: 9;
  }

  .lang-grid {
    grid-template-columns: 1fr;
  }
  
  .req-grid {
      grid-template-columns: 1fr;
  }
}
