/**
 * course-details.css
 * Specific styles for the course details page
 */

/* Layout */
.page-container {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.main-content {
  flex-grow: 1;
}

.content-wrapper {
  max-width: 1000px; /* Match search results page */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-top: 1rem; /* Reduced to half */
  padding-bottom: 2rem;
}

.two-column-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .two-column-layout {
    flex-direction: row;
  }
  
  .main-column {
    width: 66.666667%;
  }
  
  .sidebar-column {
    width: 33.333333%;
  }
}

/* Header */
.header-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
}

.header-content {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem 1.5rem; /* Reduced top/bottom padding to half */
}

.back-link {
  display: flex;
  align-items: center;
  color: #6b7280;
}

.back-link:hover {
  color: #2563eb;
  transition: color 0.2s;
}

.back-icon {
  margin-right: 0.5rem;
  width: 1rem;
  height: 1rem;
}

/* Course Header */
.course-header {
  margin-bottom: 2rem;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.course-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.course-tag-blue {
  background-color: #dbeafe;
  color: #1e40af;
}

.course-tag-green {
  background-color: #d1fae5;
  color: #065f46;
}

.course-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.course-meta {
  display: flex;
  align-items: center;
  color: #6b7280;
  margin-bottom: 1rem;
}

.course-code {
  font-family: monospace;
}

.meta-separator {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

/* Section Styling */
.content-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-icon {
  margin-right: 0.5rem;
  color: #2563eb;
  width: 1.25rem;
  height: 1.25rem;
}

.section-content {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.section-text {
  color: #4b5563;
  margin-bottom: 1rem;
}

.section-intro {
  color: #6b7280;
  margin-bottom: 1rem;
}

/* Course Details */
.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.detail-item {
  display: flex;
  align-items: flex-start;
}

.detail-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  margin-top: 0.125rem;
  color: #2563eb;
}

.detail-content h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.detail-content p {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Provider Cards */
.provider-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .provider-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.provider-card {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease-in-out;
}

.provider-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.provider-name {
  font-weight: 500;
  color: #1e40af;
  margin-bottom: 0.25rem;
}

.provider-code {
  font-size: 0.875rem;
  color: #6b7280;
}

.provider-location {
  font-size: 0.875rem;
  color: #4b5563;
  margin-top: 0.25rem;
}

/* Related Courses */
.related-courses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.related-course-card {
  display: block;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: box-shadow 0.2s ease-in-out;
}

.related-course-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.related-course-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #1e3a8a;
  margin-bottom: 0.5rem;
}

.related-course-meta {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.related-course-description {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Lead Form */
.lead-form-sticky {
  position: sticky;
  top: 24px; /* Space below the sticky header */
}

.lead-form {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lead-form-header {
  background-color: #2563eb;
  padding: 1rem 1.5rem;
}

.lead-form-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

.lead-form-subtitle {
  font-size: 0.875rem;
  color: #bfdbfe;
}

.lead-form-content {
  padding: 1.5rem;
}

.lead-form-success {
  background-color: #f0fdf4;
  border-top: 1px solid #bbf7d0;
  padding: 1.5rem;
  text-align: center;
}

.success-icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: #dcfce7;
  color: #16a34a;
  margin-bottom: 1rem;
}

.success-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #166534;
  margin-bottom: 0.5rem;
}

.success-message {
  color: #15803d;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-submit {
  width: 100%;
  background-color: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out;
}

.form-submit:hover:not(:disabled) {
  background-color: #1d4ed8;
}

.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-footer {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
}

.form-link {
  color: #2563eb;
}

.form-link:hover {
  text-decoration: underline;
}

/* Footer */
.page-footer {
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.footer-content {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1.5rem;
}

.footer-links {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.footer-link {
  font-size: 0.875rem;
  color: #6b7280;
}

.footer-link:hover {
  color: #2563eb;
}

.footer-info {
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
}

.footer-info p {
  margin-top: 0.5rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Loading and Error States */
.loading-state {
  padding: 1rem 0; /* Reduced top/bottom padding to half */
  text-align: center;
}

.loading-spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 2px solid transparent;
  border-bottom-color: #3b82f6;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.error-state {
  padding: 1rem 0; /* Reduced top/bottom padding to half */
  text-align: center;
}

.error-icon {
  margin: 0 auto 1rem auto;
  width: 3rem;
  height: 3rem;
  color: #ef4444;
}

.error-title {
  font-weight: 500;
  color: #ef4444;
  margin-bottom: 0.5rem;
}

.error-message {
  color: #6b7280;
  margin-bottom: 1rem;
}

.error-button {
  display: inline-block;
  background-color: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
}

.error-button:hover {
  background-color: #2563eb;
}
