/* ===========================
   DA Course Outline - Modern Design with Collapsible Sections
   =========================== */

.da-course-outline {
  margin: 3rem 0;
  font-family: inherit;
}

/* ===========================
   Summary Bar at Top
   =========================== */
.da-course-summary {
  margin-bottom: 2.5rem;
  padding: 2rem;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.da-summary-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  color: #1f2937;
}

.da-summary-section {
  margin-top: 1.5rem;
}

.da-summary-section:first-child {
  margin-top: 0;
}

.da-summary-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
  color: #6b7280;
}

.da-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.da-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 0.875rem;
  color: #4b5563;
  transition: all 0.2s ease;
}

.da-summary-item:hover {
  transform: translateY(-1px);
}

.da-summary-item .da-tag {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 0.5rem;
}

.da-summary-count {
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-top-right-radius: 9999px;
  border-bottom-right-radius: 9999px;
  font-size: 0.75rem;
}

/* ===========================
   Module Sections
   =========================== */
.da-module {
  margin-bottom: 3rem;
  padding: 2rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.da-module:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.da-module:last-child {
  margin-bottom: 0;
}

.da-module-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #1f2937;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
}

.da-module-description {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f9fafb;
  border-left: 3px solid #2563eb;
  border-radius: 0.5rem;
  color: #4b5563;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.da-module-description p {
  margin: 0;
}

/* ===========================
   Unit Sections - Collapsible
   =========================== */
.da-module-units {
  margin-top: 1.5rem;
}

.da-unit {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.da-unit:last-child {
  margin-bottom: 0;
}

.da-unit:hover {
  background: #ffffff;
  border-color: #d1d5db;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.da-unit-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #1f2937;
  position: relative;
}

.da-unit-toggle {
  appearance: none;
  border: none;
  background-color: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  color: inherit;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.da-unit-toggle:hover,
.da-unit-toggle:focus,
.da-unit-toggle:focus-visible {
  color: #2563eb;
  background-color: transparent;
  box-shadow: none;
  outline: none;
}

.da-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
}

.da-toggle-icon {
  flex: 0 0 auto;
  font-size: 1rem;
  color: #6b7280;
  transition: transform 0.3s ease;
  font-weight: 600;
}

.da-toggle-icon::before {
  content: '⌄';
  display: inline-block;
}

.da-unit-toggle[aria-expanded="true"] .da-toggle-icon,
.da-language-toggle[aria-expanded="true"] .da-toggle-icon {
  transform: rotate(180deg);
}

.da-unit-content {
  overflow: hidden;
  max-height: 5000px;
  opacity: 1;
  transition: max-height 0.5s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 1rem;
}

.da-unit-content.da-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.da-unit-languages {
  display: grid;
  gap: 1.25rem;
}

/* ===========================
   Language Sections - Collapsible
   =========================== */
.da-language {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.da-language:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.da-language-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 0;
  position: relative;
}

.da-language-toggle {
  appearance: none;
  border: none;
  background-color: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.da-language-toggle:hover,
.da-language-toggle:focus,
.da-language-toggle:focus-visible {
  color: #2563eb;
  background-color: transparent;
  box-shadow: none;
  outline: none;
}

.da-language-toggle .da-toggle-label::before {
  content: "";
  width: 1rem;
  height: 1rem;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.da-language-toggle[aria-expanded="true"] .da-toggle-icon {
  transform: rotate(180deg);
}

.da-language-content {
  overflow: hidden;
  max-height: 5000px;
  opacity: 1;
  transition: max-height 0.5s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.da-language-content.da-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ===========================
   Chapter Lists
   =========================== */
.da-chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.da-chapter-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.da-chapter-item:hover {
  background: #ffffff;
  border-color: #d1d5db;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.da-chapter-item a {
  color: #1f2937;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.da-chapter-item a::before {
  content: "→";
  color: #2563eb;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s ease;
}

.da-chapter-item:hover a::before {
  opacity: 1;
  transform: translateX(0);
}

.da-chapter-item a:hover {
  color: #2563eb;
}

.da-chapter-item > span {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.9375rem;
}

/* ===========================
   Chapter Meta
   =========================== */
.da-chapter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.da-meta-separator {
  font-size: 0.75rem;
  color: #d1d5db;
  margin: 0 0.125rem;
}

/* ===========================
   Tags
   =========================== */
.da-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.da-tag:hover {
  transform: translateY(-1px);
}

.da-tag--post {
  background: #dbeafe;
  color: #1e40af;
}

.da-tag--post + .da-summary-count {
  background: #dbeafe;
  color: #1e40af;
}

.da-tag--page {
  background: #d1fae5;
  color: #065f46;
}

.da-tag--page + .da-summary-count {
  background: #d1fae5;
  color: #065f46;
}

.da-tag--pdf {
  background: #fee2e2;
  color: #991b1b;
}

.da-tag--pdf + .da-summary-count {
  background: #fee2e2;
  color: #991b1b;
}

.da-tag--image {
  background: #fef3c7;
  color: #92400e;
}

.da-tag--image + .da-summary-count {
  background: #fef3c7;
  color: #92400e;
}

.da-tag--video {
  background: #ede9fe;
  color: #6b21a8;
}

.da-tag--video + .da-summary-count {
  background: #ede9fe;
  color: #6b21a8;
}

.da-tag--audio {
  background: #fce7f3;
  color: #9f1239;
}

.da-tag--audio + .da-summary-count {
  background: #fce7f3;
  color: #9f1239;
}

.da-tag--file {
  background: #f3f4f6;
  color: #374151;
}

.da-tag--file + .da-summary-count {
  background: #f3f4f6;
  color: #374151;
}

.da-tag--external {
  background: #ccfbf1;
  color: #115e59;
}

.da-tag--external + .da-summary-count {
  background: #ccfbf1;
  color: #115e59;
}

.da-tag--no-link {
  background: #f9fafb;
  color: #9ca3af;
  border: 1px dashed #d1d5db;
}

.da-tag--no-link + .da-summary-count {
  background: #f9fafb;
  color: #9ca3af;
  border-top: 1px dashed #d1d5db;
  border-right: 1px dashed #d1d5db;
  border-bottom: 1px dashed #d1d5db;
}

.da-tag--category {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.da-tag--category + .da-summary-count {
  background: #eef2ff;
  color: #4338ca;
  border-top: 1px solid #c7d2fe;
  border-right: 1px solid #c7d2fe;
  border-bottom: 1px solid #c7d2fe;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
  .da-course-outline {
    margin: 2rem 0;
  }

  .da-course-summary {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  .da-summary-title {
    font-size: 1.125rem;
  }

  .da-summary-list {
    gap: 0.5rem;
  }

  .da-summary-item {
    font-size: 0.8125rem;
  }

  .da-module {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  .da-module-title {
    font-size: 1.5rem;
  }

  .da-unit {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .da-unit-toggle {
    font-size: 1.125rem;
  }

  .da-language {
    padding: 1rem;
  }

  .da-chapter-item {
    padding: 0.625rem 0.875rem;
  }

  .da-chapter-item a {
    font-size: 0.875rem;
  }

  .da-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .da-module {
    padding: 1.25rem;
  }

  .da-module-title {
    font-size: 1.25rem;
  }

  .da-unit {
    padding: 1rem;
  }

  .da-toggle-label::before {
    display: none;
  }

  .da-chapter-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }

  .da-meta-separator {
    display: none;
  }
}

@media print {
  .da-course-outline {
    margin: 0;
  }

  .da-module {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }

  .da-chapter-item {
    page-break-inside: avoid;
  }

  .da-tag {
    border: 1px solid currentColor;
  }
  
  .da-toggle-icon {
    display: none;
  }
  
  .da-unit-content.da-collapsed,
  .da-language-content.da-collapsed {
    max-height: none !important;
    opacity: 1 !important;
  }
}