/* ========================================================================
   UIW Canvas Custom Styles
   Last Updated: August 2025
   
   This CSS file contains custom styling for UIW's Canvas LMS instance.
   Sections are organized by functionality for easier maintenance.
   
   IMPORTANT: Some styles are dynamically generated in the JavaScript file
   for components that require programmatic creation (like custom nav trays).
   ======================================================================== */

/* ========== Accessibility and User Experience Improvements ============= */

/* Subtle visual feedback for Canvas buttons - improves user interaction */
.btn:hover {
  filter: brightness(98%);
  transform: translateY(-0.7px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Button Row component for aligned button layouts in course content */
.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.button-row .btn {
  min-width: 200px;
  padding: 0.75rem 1.25rem;
  font-size: 1.125rem;
  font-weight: 500;
  text-align: center;
}

/* Mobile-responsive button layout */
@media (max-width: 600px) {
  .button-row {
    flex-direction: column;
    align-items: center;
  }
}

/* UIW-branded button styling */
.button-row a {
  background-color: #aa1010; /* UIW Red */
  color: #ffffff;
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
  transition: background-color 0.2s ease;
  min-width: 200px;
}

.button-row a:hover {
  background-color: #c22020; /* Darker UIW Red for hover */
}

/* Image hover effects for linked images in course content */
#content a img:hover {
  filter: brightness(92%) !important;
  transition: filter 0.2s ease-in-out !important;
  cursor: pointer !important;
}

/* ========== Course Content Formatting Components ============= */

/* UIW-branded blockquotes and highlight boxes */
.uiw-highlight-box,
blockquote {
  border-left: 4px solid #aa1010; /* UIW Red accent */
  background-color: #fafafa;
  padding: 0.75em 1.25em;
  margin: 1em 0 1.5em;
  color: #333;
  font-style: italic;
  border-radius: 4px;
}

/* Collapsible content sections for better course organization */
details.collapsible-section {
  margin: 1em 0;
  border: 1px solid #ccc;
  border-radius: 0.5em;
  background: #f9f9f9;
  overflow: hidden;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* Visual indicator when collapsible section is expanded */
details.collapsible-section[open] {
  box-shadow: 0 0 0 2px #aa1010; /* UIW Red highlight */
  background: #fff;
}

/* Collapsible section header styling */
summary.collapsible-heading {
  font-size: 1.2em;
  font-weight: 600;
  padding: 0.75em 1em;
  cursor: pointer;
  background-color: #fff;
  color: #aa1010; /* UIW Red text */
  border-bottom: 1px solid #ccc;
  position: relative;
  list-style: none;
  outline: none;
}

/* Expand/collapse icon for collapsible sections */
summary.collapsible-heading::after {
  content: "+";
  position: absolute;
  right: 1em;
  font-size: 1.2em;
  transition: transform 0.3s ease;
}

/* Icon change when section is expanded */
details.collapsible-section[open] summary.collapsible-heading::after {
  content: "−";
  transform: rotate(0deg);
}

/* Content area styling for collapsible sections */
.collapsible-content {
  padding: 1em;
  font-size: 1em;
  color: #333;
}

/* ========== UIW-Branded Header Components ============= */

/* Modern gradient header for H2 elements */
.modern-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: linear-gradient(90deg, #991010 0%, #aa1010 50%, #c22020 100%); /* UIW Red gradient */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  color: #ffffff;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.modern-header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

/* H3 Header styling with UIW branding */
.modern-header-h3 {
  background: linear-gradient(90deg, #991010 0%, #aa1010 50%, #c22020 100%);
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.modern-header-h3 h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* H4 Header styling with UIW branding */
.modern-header-h4 {
  background: linear-gradient(90deg, #991010 0%, #aa1010 50%, #c22020 100%);
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.modern-header-h4 h4 {
  margin: 0;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* ========== Custom Modals and Overlays ============= */

/* FERPA Modal Styling - Used by the People (+) button functionality */
.custom-modal {
  position: fixed;
  z-index: 10001 !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal-content {
  background-color: white;
  padding: 24px;
  border-radius: 8px;
  text-align: left;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  max-width: 700px;
  width: 95%;
  position: relative;
  font-family: inherit;
}

.custom-modal-close {
  position: absolute;
  right: 10px;
  top: 5px;
  font-size: 20px;
  cursor: pointer;
  border: none;
  background: none;
}

.custom-modal-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

/* Modal action buttons with UIW branding */
#modal-ok-button {
  padding: 10px 20px;
  background-color: #aa1010; /* UIW Red */
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1rem;
}

#modal-ok-button:hover {
  background-color: #880808; /* Darker red for hover */
}

/* Modal accessibility improvements */
.custom-modal a:hover,
.custom-modal a:focus {
  text-decoration: none;
  outline: 2px solid #aa1010; /* UIW Red focus indicator */
  outline-offset: 2px;
}

.custom-modal button:focus {
  outline: 2px solid #aa1010; /* UIW Red focus indicator */
  outline-offset: 2px;
}

/* ========== Course Settings Enhancements ============= */

/* Note: Canvas ID field uses inline styling in JavaScript to match 
   Canvas's responsive behavior exactly - no CSS classes needed */

/* ========== Content Migration Notifications ============= */

/* Custom notification styling for content migration page */
.migration-home-page-notice {
  color: rgb(0, 0, 0);
  background: rgb(255, 255, 255);
  box-sizing: border-box;
  display: flex;
  min-width: 12rem;
  border-width: 0.125rem;
  border-style: solid;
  border-radius: 0.25rem;
  border-color: #aa1010 !important; /* UIW Red border */
  box-shadow: rgba(0, 0, 0, 0.1) 0px 0.1875rem 0.375rem, rgba(0, 0, 0, 0.15) 0px 0.1875rem 0.375rem;
  margin: 0.5rem 0px;
  max-width: 100%;
  overflow: visible;
  transition: outline-color 0.2s, outline-offset 0.25s;
  outline-offset: -0.8rem;
  outline: rgba(170, 16, 16, 0) solid 0.125rem;
}

/* Icon section for migration notice */
.migration-notice-icon {
  background-color: #aa1010 !important; /* UIW Red background */
  background: #aa1010 !important;
  color: white;
}

.migration-notice-icon i {
  color: white !important;
  font-size: 1em;
}

/* ========== Quiz Enhancement Styles ============= */

/* QTI Conversion menu item styling */
.qti-conversion-menu-item {
  font-family: LatoWeb, "Lato Extended", Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: bold;
  font-size: 0.875rem;
  -webkit-font-smoothing: antialiased;
  border-radius: 0;
  text-decoration: none;
  display: block;
  line-height: 1.5;
  background-color: transparent;
  color: var(--ic-brand-font-color-dark);
  min-width: 180px;
  padding: 6px 12px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.qti-conversion-menu-item:hover {
  background-color: #aa1010 !important; /* UIW Red hover */
  color: #ffffff !important;
}

.qti-conversion-menu-item:hover i {
  color: #ffffff !important; /* White icon on hover */
}

/* ========== Accessibility and Contrast Adjustments ============= */

/* Improved contrast for todo details */
.todo-details__context {
  color: #333 !important; /* Dark gray text for better contrast */
}

/* ========== Responsive Design Helpers ============= */

/* Mobile-specific adjustments for custom components */
@media (max-width: 768px) {
  .custom-modal-content {
    width: 98%;
    padding: 16px;
    margin: 10px;
  }
  
  .modern-header h2 {
    font-size: 1.5rem;
  }
  
  .modern-header-h3 h3 {
    font-size: 1.25rem;
  }
  
  .modern-header-h4 h4 {
    font-size: 1.1rem;
  }
}

/* ========== Utility Classes ============= */

/* Spacing utilities for custom components */
.gcn_tray-list-spaced {
  margin-top: 0.5rem;
}

/* Screen reader only content */
.screenreader-only {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ========== Complex Image Figures (Long Descriptions) ============= */

/* Figures section container - provides visual grouping for accessibility fields */
.figures-custom-container {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1rem 0;
}

/* Figure title (caption) field - improved vertical centering */
#image-caption-field {
  display: flex;
  align-items: center;
  padding-top: 0.5rem;
}

/* Tooltip styling for help icons - CUSTOM UIW CLASS */
.uiw-figure-tooltip {
  display: none;
  position: fixed;  /* Changed from absolute to fixed */
  z-index: 10000;
  background-color: #273540;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  min-width: 280px;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-family: LatoWeb, "Lato Extended", Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: left;
  white-space: normal;
}

/* Tooltip arrow styling */
.uiw-figure-tooltip div {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}

/* Arrow pointing down (tooltip above element) */
.uiw-figure-tooltip div.arrow-down {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-top: 6px solid #273540;
}

/* Arrow pointing up (tooltip below element) */
.uiw-figure-tooltip div.arrow-up {
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom: 6px solid #273540;
}

/* Figure details arrow rotation */
details.figure-details:not([open]) .arrow-icon {
  transform: rotate(-90deg);
}

details.figure-details[open] .arrow-icon {
  transform: rotate(0deg);
}