/* Teacher passive containers: keep styling, block clicks only */
.teacher-passive { position: relative; }
.teacher-passive * { cursor: default !important; }
/* Teacher view tabs: reuse student styling */
.dynamic-feedback-system .tab-container .tab-button {
    position: relative !important;
    z-index: 2 !important;
    background: #3b82f6 !important;
    border: 1px solid #d1d5db !important;
    border-bottom: none !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 6px 6px 0 0 !important;
    color: #ffffff !important;
    min-width: 140px !important;
    text-align: center !important;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1) !important;
    opacity: .6 !important;
}
.dynamic-feedback-system .tab-container .tab-button.active {
    opacity: 1 !important;
}

/* Teacher highlight styles align with student mode */
.dynamic-feedback-system .rwa-error-highlight.status-not-fixed {
    pointer-events: auto !important;
}
.dynamic-feedback-system .rwa-error-highlight.status-corrected,
.dynamic-feedback-system .rwa-error-highlight.corrected-word {
    color: #059669 !important;
}

/* MasterTable corrected word styling */
.dynamic-feedback-system .correction-cell .corrected-word,
.dynamic-feedback-system td.correction-cell .corrected-word,
.dynamic-feedback-system .correction-cell span.corrected-word {
    background: #e6fffa !important;
    color: #0f766e !important;
    border-radius: 3px !important;
    padding: 2px 4px !important;
}

/* Removed neutralising of What's Wrong cell to allow highlight colours in all views */
/**
 * Enhanced Panel CSS v1.0.3
 * 
 * Professional styling based on reference file patterns
 * Includes global CSS overrides and comprehensive UI styling
 */

/* =============================================================================
   GLOBAL CSS OVERRIDES (Based on Reference File)
   ============================================================================= */

/* Font Family Override for Professional Look */
.dynamic-feedback-system,
.dynamic-feedback-system *,
#error-tables-section,
#error-tables-section *,
#master-table-section,
#master-table-section * {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Reset WordPress Theme Button Interference */
.dynamic-feedback-system button,
#error-tables-section button,
#master-table-section button {
    all: unset !important;
    background: inherit !important;
    color: inherit !important;
    border: inherit !important;
    padding: inherit !important;
    border-radius: inherit !important;
    cursor: pointer !important;
    font-weight: inherit !important;
    position: inherit !important;
    box-shadow: inherit !important;
    transition: inherit !important;
    font-size: inherit !important;
    min-width: inherit !important;
    text-decoration: none !important;
    outline: none !important;
    font-family: inherit !important;
    line-height: inherit !important;
    margin: inherit !important;
    display: inline-block !important;
    pointer-events: auto !important;
    user-select: none !important;
}

/* =============================================================================
   MAIN TEXT CONTAINERS (Professional Reference Style)
   ============================================================================= */

.recount-output {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    line-height: 2.0 !important;
    font-size: 19px !important;
    color: #374151 !important;
    min-height: 200px !important;
    transition: all 0.3s ease !important;
    text-align: justify !important;
}

.recount-output:hover {
    border-color: #d1d5db !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

/* Container Headers */
.recount-header {
    background: #193852 !important;
    color: white !important;
    padding: 16px 24px !important;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600 !important;
    font-size: 14.4px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 2px 8px rgba(25, 56, 82, 0.3) !important;
}

/* =============================================================================
   MASTER TABLE STYLING (Professional Reference Style)
   ============================================================================= */

#master-errors-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

#master-errors-table thead tr {
    background: #f9fafb !important;
}

#master-errors-table th {
    padding: 10px !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: #374151 !important;
    border-bottom: 1px solid #e5e7eb !important;
    font-size: 14px !important;
}

#master-errors-table th[style*="center"] {
    text-align: center !important;
}

#master-errors-table tbody tr {
    transition: background-color 0.2s ease !important;
    cursor: pointer !important;
    border-bottom: 1px solid #e5e7eb !important;
}

#master-errors-table tbody tr:hover {
    background-color: #f9fafb !important;
}

#master-errors-table tbody tr.row-hidden {
    display: none !important;
}

#master-errors-table td {
    padding: 12px 10px !important;
    font-size: 14px !important;
    vertical-align: middle !important;
}

/* Increase line spacing for Your Correction column to improve readability with tick icons */
#master-errors-table .correction-cell {
    line-height: 1.8 !important;
}

/* Hidden columns for data storage */
.hidden-col {
    display: none !important;
}

/* Show hidden columns during development */
.debug-mode .hidden-col {
    display: table-cell !important;
    background: #ffe6e6 !important;
    font-size: 10px !important;
    color: #666 !important;
}

/* =============================================================================
   STATUS BADGES (Professional Reference Style)
   ============================================================================= */

.status-cell {
    position: relative !important;
    text-align: center !important;
}

.status-badge {
    padding: 6px 12px !important;
    border-radius: 16px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.status-unread {
    background: #dbeafe !important;
    color: #1e40af !important;
    border: 1px solid #93c5fd !important;
    border-radius: 16px !important;
}

.status-corrected {
    background: #d1fae5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
    border-radius: 16px !important;
}

.status-needs-help {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
    border-radius: 16px !important;
}

.status-in-progress {
    background: #fef3c7 !important;
    color: #d97706 !important;
    border: 1px solid #fde68a !important;
    border-radius: 16px !important;
}

.status-skipped {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 16px !important;
}

.status-unknown {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 16px !important;
}

.status-icon {
    font-size: 14px !important;
}

.status-meta {
    display: block !important;
    font-size: 10px !important;
    color: #6b7280 !important;
    margin-top: 2px !important;
}

/* =============================================================================
   ERROR TYPE BADGES (Professional Reference Style)
   ============================================================================= */

.error-type-badge {
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: white !important;
    display: inline-block !important;
}

/* Dynamic error type badges - colors set dynamically by JavaScript based on MWAI output */
.error-type-badge {
    /* Colors will be set dynamically via JavaScript using the color registry system */
    background: var(--error-type-color, #6b7280) !important;
}

/* =============================================================================
   FILTER BUTTONS (Professional Reference Style)
   ============================================================================= */

.filter-button-group {
    position: relative !important;
    display: inline-block !important;
    margin: 4px !important;
}

.filter-button-group button {
    border: none !important;
    padding: 12px 18px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    color: white !important;
    position: relative !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    min-width: 120px !important;
}

.filter-button-group button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    filter: brightness(0.9) !important;
}

.filter-button-group button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Simple filter group protection */
.simple-filter-group button {
    all: unset !important;
    background: inherit !important;
    color: inherit !important;
    border: inherit !important;
    padding: inherit !important;
    border-radius: inherit !important;
    cursor: pointer !important;
    font-weight: inherit !important;
    position: inherit !important;
    box-shadow: inherit !important;
    transition: inherit !important;
    font-size: inherit !important;
    min-width: inherit !important;
    text-decoration: none !important;
    outline: none !important;
    font-family: inherit !important;
    line-height: inherit !important;
    margin: inherit !important;
    display: inline-block !important;
    pointer-events: auto !important;
    user-select: none !important;
}

/* Counter badges */
.simple-filter-group span {
    position: absolute !important;
    border-radius: 50% !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid white !important;
    z-index: 10 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: inherit !important;
    color: inherit !important;
    text-decoration: none !important;
    outline: none !important;
    user-select: none !important;
    transform: none !important;
    left: auto !important;
    bottom: auto !important;
}

/* All filter button counters */
#language-buttons .simple-filter-group span,
#texttype-buttons .simple-filter-group span {
    top: -10px !important;
    right: -10px !important;
    width: 25px !important;
    height: 25px !important;
    font-size: 13px !important;
}

/* Counter colors */
.filter-button-group .unfixed-counter {
    top: -10px !important;
    right: -10px !important;
    background: #ef4444 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
}

.filter-button-group .fixed-counter {
    bottom: -10px !important;
    right: -10px !important;
    background: #10b981 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3) !important;
}



/* =============================================================================
   MAIN TEXT ERROR STYLING (JavaScript-Enhanced)
   ============================================================================= */

.main-text-error {
    display: inline !important;
    position: relative !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 3px !important;
    padding: 1px 2px !important;
}

.main-text-error:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2) !important;
    opacity: 0.9 !important;
}

/* Status indicators for main text errors */
.status-indicator {
    pointer-events: none !important;
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    font-size: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    border: 2px solid white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* Removed legacy error styling that conflicts with ErrorHighlighting module */

/* =============================================================================
   SKILLS SECTIONS (Professional Reference Style)
   ============================================================================= */

.skills-section {
    background: white !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    margin-bottom: 20px !important;
}

.skills-header {
    background: #007cba !important;
    color: white !important;
    padding: 16px 24px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}



/* =============================================================================
   ANIMATIONS AND TRANSITIONS
   ============================================================================= */

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(1); }
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    
    .filter-button-group .unfixed-counter {
        top: -8px !important;
        right: -8px !important;
        width: 16px !important;
        height: 16px !important;
        font-size: 10px !important;
    }
    
    .filter-button-group .fixed-counter {
        bottom: -8px !important;
        right: -8px !important;
        width: 16px !important;
        height: 16px !important;
        font-size: 10px !important;
    }
    
    .filter-button-group button {
        padding: 10px 14px !important;
        font-size: 13px !important;
        min-width: 100px !important;
    }
    
    .recount-output {
        padding: 21px !important;
        font-size: 17px !important;
    }
    
    #master-errors-table {
        font-size: 12px !important;
    }
    
    #master-errors-table th,
    #master-errors-table td {
        padding: 8px 6px !important;
    }
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

/* Remove old CSS pseudo-elements that conflict with JavaScript indicators */
.corrected-issue::after,
.needs-help-issue::after {
    display: none !important;
}

/* =============================================================================
   WORDPRESS THEME COMPATIBILITY OVERRIDES
   ============================================================================= */

/* Override common theme button styles */
.dynamic-feedback-system .wp-block-button__link,
#error-tables-section .wp-block-button__link,
#master-table-section .wp-block-button__link {
    all: unset !important;
}

/* Override theme table styles */
.dynamic-feedback-system table,
#error-tables-section table,
#master-table-section table {
    border: none !important;
    background: transparent !important;
}

/* Override theme link styles */
.dynamic-feedback-system a,
#error-tables-section a {
    text-decoration: none !important;
    color: inherit !important;
}

/* Override theme input styles */
.dynamic-feedback-system input,
#error-tables-section input,
#master-table-section input {
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-family: inherit !important;
}

/* Override theme heading styles */
.dynamic-feedback-system h1,
.dynamic-feedback-system h2,
.dynamic-feedback-system h3,
.dynamic-feedback-system h4,
.dynamic-feedback-system h5,
.dynamic-feedback-system h6 {
    margin: 0 !important;
    padding: 0 !important;
    font-weight: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
}

/* Akami Corrected Words styling for MainText and MasterTable - Green text with tick icon only */
.corrected-word {
    background-color: transparent !important;
    border: none !important;
    border-bottom: none !important;
    text-decoration: none !important;
    color: #059669 !important;
    font-weight: 600;
    position: relative;
    padding: 0 !important;
    border-radius: 0 !important;
    transition: color 0.2s ease;
}

/* Add tick icon as overlay */
.corrected-word::before {
    content: "" !important;
    display: none !important;
}

.corrected-word::after {
    content: "✓" !important;
    display: inline-block !important;
    position: absolute;
    top: -10px;
    right: -12px;
    background-color: #10b981;
    color: white;
    border-radius: 50%;
    width: 13px;
    height: 13px;
    font-size: 8px;
    line-height: 13px;
    text-align: center;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.corrected-word:hover {
    background-color: transparent !important;
    transform: none !important;
    box-shadow: none !important;
    color: #10b981 !important;
}