/* ============================================
   SPEEDGRADER DISCUSSION HELPER - THEME VERSION
   Version: 1.4 - Fixed for Canvas specificity
   Updated color scheme: Blue for top-level, Amber for replies
   ============================================ */

/* Color definitions for indicator borders and badges */
.indicator-toplevel {
  border: 2px solid #007bff !important; /* Blue for top-level */
}

.indicator-reply {
  border: 2px solid #F59E0B !important; /* Amber for replies */
}

.badge-toplevel {
  background: #007bff !important; /* Blue for top-level */
}

.badge-reply {
  background: #F59E0B !important; /* Amber for replies */
}

/* Force checkbox container visibility with maximum specificity */
#speedgrader_iframe .paragraph-checkbox-container,
.submission_description .paragraph-checkbox-container,
div[id^="entry_"] .paragraph-checkbox-container,
.discussion_entry .paragraph-checkbox-container,
.user_content .paragraph-checkbox-container,
.message .paragraph-checkbox-container,
.paragraph-checkbox-container {
  position: absolute !important;
  left: -30px !important;
  top: 0px !important;
  display: flex !important;
  align-items: center !important;
  z-index: 9999 !important;
  background: white !important;
  padding: 2px !important;
  border: 1px solid #ccc !important;
  border-radius: 3px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Force checkbox styling */
#speedgrader_iframe .paragraph-checkbox,
.submission_description .paragraph-checkbox,
div[id^="entry_"] .paragraph-checkbox,
.discussion_entry .paragraph-checkbox,
.user_content .paragraph-checkbox,
.message .paragraph-checkbox,
.paragraph-checkbox {
  width: 18px !important;
  height: 18px !important;
  cursor: pointer !important;
  accent-color: #4CAF50 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 10000 !important;
}

/* Paragraph container styling with high specificity */
#speedgrader_iframe .paragraph-with-checkbox,
.submission_description .paragraph-with-checkbox,
div[id^="entry_"] .paragraph-with-checkbox,
.discussion_entry .paragraph-with-checkbox,
.user_content .paragraph-with-checkbox,
.message .paragraph-with-checkbox,
.paragraph-with-checkbox {
  position: relative !important;
  padding-left: 15px !important;
  margin-left: 35px !important;
  transition: all 0.3s ease !important;
  min-height: 24px !important;
}

/* Included paragraph styling - green */
#speedgrader_iframe .paragraph-included,
.submission_description .paragraph-included,
div[id^="entry_"] .paragraph-included,
.discussion_entry .paragraph-included,
.user_content .paragraph-included,
.message .paragraph-included,
.paragraph-included {
  background-color: rgba(76, 175, 80, 0.08) !important;
  border-left: 3px solid #4CAF50 !important;
  padding-left: 12px !important;
  opacity: 1 !important;
  text-decoration: none !important;
  color: inherit !important;
}

/* Excluded paragraph styling - red */
#speedgrader_iframe .paragraph-excluded,
.submission_description .paragraph-excluded,
div[id^="entry_"] .paragraph-excluded,
.discussion_entry .paragraph-excluded,
.user_content .paragraph-excluded,
.message .paragraph-excluded,
.paragraph-excluded {
  opacity: 0.5 !important;
  background-color: rgba(255, 0, 0, 0.08) !important;
  border-left: 3px solid #ff6b6b !important;
  padding-left: 12px !important;
  text-decoration: line-through !important;
  color: #999 !important;
}

/* Override Canvas paragraph styles */
#speedgrader_iframe p.paragraph-with-checkbox,
.submission_description p.paragraph-with-checkbox,
div[id^="entry_"] p.paragraph-with-checkbox,
.discussion_entry p.paragraph-with-checkbox,
.user_content p.paragraph-with-checkbox,
.message p.paragraph-with-checkbox {
  margin-top: 0.5em !important;
  margin-bottom: 0.5em !important;
  display: block !important;
  position: relative !important;
}

/* Hover effects */
.paragraph-checkbox-container:hover {
  background: #f0f0f0 !important;
  transform: scale(1.05) !important;
}

.paragraph-with-checkbox:hover {
  background-color: rgba(0, 0, 0, 0.02) !important;
}

/* Dashboard and other styles */
.discussion-helper-badge {
  display: inline-block;
  padding: 4px 8px;
  margin: 5px 0;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
  text-transform: uppercase;
}

.discussion-helper-toplevel {
  background-color: #007bff; /* Blue for top-level */
  color: white;
}

.discussion-helper-reply {
  background-color: #F59E0B; /* Amber for replies */
  color: white;
}

.discussion-helper-wordcount {
  display: block;
  margin: 5px 0;
  padding: 4px 8px;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  color: #333;
}

.discussion-helper-container {
  border-left: 3px solid #0066cc;
  padding-left: 10px;
  margin: 10px 0;
  background-color: #f9f9f9;
}

.word-count-detail {
  font-size: 9px;
  color: #666;
  margin-top: 2px;
}

/* Dashboard styles */
.discussion-helper-dashboard {
  background: white;
  border: 2px solid #0066cc;
  border-radius: 8px;
  padding: 12px;
  margin: 15px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.dashboard-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
}

.dashboard-icon {
  font-size: 20px;
  margin-right: 8px;
}

.dashboard-title {
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

.dashboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  border: 1px solid #ddd;
}

.dashboard-table th,
.dashboard-table td {
  padding: 8px;
  text-align: center;
  border-right: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.dashboard-table th:last-child,
.dashboard-table td:last-child {
  border-right: none;
}

.dashboard-table tr:last-child td {
  border-bottom: none;
}

.dashboard-table th {
  background-color: #f5f5f5;
  font-weight: bold;
  color: #555;
}

.dashboard-table thead tr th {
  border-bottom: 2px solid #ddd;
}

.dashboard-table td {
  background-color: white;
}

.dashboard-table tr:last-child td {
  background-color: #f0f7ff;
  font-weight: bold;
}

.post-type-cell {
  text-align: left !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-type-icon {
  font-size: 16px;
}

.post-count {
  font-size: 13px;
  font-weight: bold;
  color: #0066cc;
}

.dashboard-note {
  margin-top: 8px;
  font-size: 11px;
  color: #666;
  font-style: italic;
}

.dashboard-threshold {
  font-size: 10px;
  color: #888;
  font-weight: normal;
}