// ========================================
// SERVICE — Job Details Container
// ========================================

.service-job-details-container {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 30px;
}

.job-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
  }

  .header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1;
  }

  .header-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  }

  .header-text {
    .job-title {
      margin: 0;
      font-size: 24px;
      font-weight: 700;
      color: white;
      letter-spacing: -0.5px;
    }

    .job-ref {
      margin: 6px 0 0 0;
      font-size: 14px;
      color: rgba(255, 255, 255, 0.9);
      font-weight: 500;
    }
  }

  .header-actions {
    display: flex;
    gap: 8px;
    z-index: 1;
  }

  .action-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 18px;
    text-decoration: none;

    &:hover {
      background: rgba(255, 255, 255, 0.25);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    &.pdf-btn:hover {
      background: rgba(239, 68, 68, 0.9);
      border-color: rgba(239, 68, 68, 0.9);
    }

    &.print-btn:hover {
      background: rgba(59, 130, 246, 0.9);
      border-color: rgba(59, 130, 246, 0.9);
    }

    &.edit-btn:hover {
      background: rgba(16, 185, 129, 0.9);
      border-color: rgba(16, 185, 129, 0.9);
    }

    &.close-btn:hover {
      background: rgba(239, 68, 68, 0.9);
      border-color: rgba(239, 68, 68, 0.9);
      transform: rotate(90deg);
    }

    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
  }
}

// ========================================
// SERVICE — Job Content & Grid
// ========================================

.job-content {
  padding: 32px;
  background: #f8f9fc;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

// ========================================
// SERVICE — Info Cards
// ========================================

.service-job-details-container {
  .info-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
      transform: scaleX(0);
      transition: transform 0.3s ease;
    }

    &:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);

      &::before {
        transform: scaleX(1);
      }
    }

    .card-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 2px solid #f1f5f9;
    }

    .card-icon {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      flex-shrink: 0;
    }

    .customer-icon { color: #667eea; }
    .technician-icon { color: #10b981; }
    .service-icon { color: #f5576c; }
    .job-type-icon { color: #8b5cf6; }
    .status-icon { color: #43e97b; }
    .datetime-icon { color: #fa709a; }
    .reference-icon { color: #8b5cf6; }

    .card-title {
      margin: 0;
      font-size: 13px;
      font-weight: 700;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .card-body {
      .info-value {
        font-size: 16px;
        font-weight: 600;
        color: #1e293b;
        line-height: 1.5;
      }
    }
  }
}

// ========================================
// SERVICE — Status Badge
// ========================================

.service-job-details-container .status-badge-modern {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;

  .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: servicePulse 2s ease infinite;
  }

  &.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;

    .status-dot { background: #f59e0b; }
  }

  &.in-progress {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;

    .status-dot { background: #3b82f6; }
  }

  &.completed {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;

    .status-dot { background: #10b981; }
  }

  &.cancelled {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;

    .status-dot { background: #ef4444; }
  }
}

@keyframes servicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

// ========================================
// SERVICE — Notes Section
// ========================================

.notes-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-left: 4px solid #667eea;

  .notes-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;

    i {
      font-size: 20px;
    }
  }

  .notes-content p {
    margin: 0;
    color: #475569;
    line-height: 1.8;
    white-space: pre-line;
  }
}

// ========================================
// SERVICE — Checklist Section
// ========================================

.checklist-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);

  .checklist-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;

    i {
      font-size: 20px;
      color: #667eea;
    }
  }

  .checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
  }

  .checklist-item {
    background: #f8f9fc;
    border-radius: 12px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;

    &:hover {
      border-color: #cbd5e1;
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    &.completed {
      background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
      border-color: #10b981;

      .checklist-item-name {
        color: #065f46;
      }
    }

    .checklist-item-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 8px;
    }

    .checklist-checkbox {
      font-size: 20px;
      flex-shrink: 0;
    }

    .checklist-item-name {
      font-size: 15px;
      font-weight: 600;
      color: #1e293b;
      flex: 1;
    }

    .checklist-category {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: #64748b;
      margin-top: 8px;

      i {
        font-size: 14px;
      }
    }
  }
}

// ========================================
// SERVICE — Empty / Error States
// ========================================

.empty-checklist {
  background: white;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);

  i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
  }

  p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
  }
}

.error-state {
  background: white;
  border-radius: 16px;
  padding: 60px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);

  i {
    font-size: 64px;
    color: #ef4444;
    margin-bottom: 20px;
  }

  p {
    margin: 0 0 24px 0;
    color: #64748b;
    font-size: 16px;
  }
}

// ========================================
// SERVICE — PDF Loading
// ========================================

.service-job-details-container ~ .pdf-loading-overlay,
.pdf-loading-overlay {
  .loading-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);

    .spinner {
      margin: 0 auto 20px;
    }

    p {
      margin: 0;
      color: #1e293b;
      font-size: 16px;
      font-weight: 600;
    }
  }
}

// ========================================
// SERVICE — Print View
// ========================================

.sj-print-wrapper {
  padding: 20px;
  font-family: Arial, sans-serif;
}

.sj-print-header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #1a56db;
  padding-bottom: 15px;
}

.sj-print-title {
  color: #1a56db;
  margin: 0 0 10px 0;
}

.sj-print-ref {
  color: #4b5563;
  margin: 0;
}

.sj-print-info-table {
  width: 100%;
  margin-bottom: 20px;
}

.sj-print-info-cell {
  width: 50%;
  vertical-align: top;
}

.sj-print-section-title {
  color: #1a56db;
  margin: 0 0 10px 0;
  font-size: 14px;
}

.sj-print-field {
  margin: 5px 0;
}

.sj-print-notes {
  margin-bottom: 20px;
  padding: 10px;
  background: #f9fafb;
  border-left: 3px solid #1a56db;
}

.sj-print-notes-text {
  margin: 0;
  white-space: pre-line;
}

.sj-print-checklist-wrapper {
  margin-bottom: 20px;
}

.sj-print-checklist-table {
  width: 100%;
  border-collapse: collapse;
}

.sj-print-checklist-header {
  background: #1a56db;
  color: white;
}

.sj-print-th {
  padding: 8px;
  text-align: left;
}

.sj-print-td {
  padding: 8px;
}

.sj-print-footer {
  margin-top: 30px;
  text-align: center;
  padding-top: 15px;
  border-top: 2px solid #e5e7eb;
}

.sj-print-footer-text {
  color: #1a56db;
  font-weight: bold;
  margin: 0;
}
