/**
 * Mobility Trailblazers - Consolidated Hotfixes
 * 
 * This file consolidates multiple small hotfix CSS files to reduce HTTP requests
 * while preserving the exact loading order and CSS cascade.
 * 
 * Consolidated files (in exact loading order):
 * 1. photo-adjustments.css
 * 2. candidate-image-adjustments.css  
 * 3. evaluation-fix.css
 * 4. language-switcher-enhanced.css
 * 5. mt-jury-dashboard-fix.css
 * 6. emergency-fixes.css
 * 
 * @version 1.0.0
 * @since 2025-08-20
 * @package MobilityTrailblazers
 */

/* ===================================
   1. PHOTO ADJUSTMENTS
   From: photo-adjustments.css
   =================================== */

/**
 * Photo Adjustments for Specific Candidates
 * Purpose: Fix photo positioning for candidates where face is not properly visible
 * Created: 2025-08-18
 */

/* Friedrich Dräxlmaier - Adjust photo to show face */
.postid-4627 .mt-photo-frame img,
.candidate-4627 .mt-photo-frame img,
.mt-candidate-photo-4627 {
    object-position: center 20%; /* Adjust vertical position to show face */
    object-fit: cover;
}

/* Generic class for photo adjustments */
.mt-photo-adjust-top .mt-photo-frame img {
    object-position: center 20%;
}

.mt-photo-adjust-center .mt-photo-frame img {
    object-position: center center;
}

.mt-photo-adjust-bottom .mt-photo-frame img {
    object-position: center 80%;
}

/* Candidate grid photo adjustments */
.mt-candidate-card[data-candidate-id="4627"] .mt-candidate-image img {
    object-position: center 20%;
}

/* Archive page photo adjustments */
.type-mt_candidate.post-4627 .mt-candidate-photo {
    object-position: center 20%;
}

/* Evaluation page photo adjustments */
.mt-candidate-photo-eval[data-candidate="4627"] {
    object-position: center 20%;
}

/* Add hover effect to indicate interactive photo */
.mt-photo-frame img {
    transition: object-position 0.3s ease;
}

.mt-photo-frame:hover img {
    transform: scale(1.05);
}

/* ===================================
   2. CANDIDATE IMAGE ADJUSTMENTS
   From: candidate-image-adjustments.css
   =================================== */

/**
 * Candidate Image Adjustments
 * Version: 1.0.0
 * Created: 2025-08-18
 * 
 * Description: Specific image positioning adjustments for candidates
 * where faces are not properly visible with default cropping
 */

/* ===================================
   GENERAL IMAGE POSITIONING FIX
   =================================== */

/* Default object-position adjustment for better face visibility */
.mt-candidate-hero-photo,
.mt-candidate-photo,
.mt-candidate-image img {
    object-position: center 30% !important; /* Move focus point up to show faces better */
}

/* ===================================
   SPECIFIC CANDIDATE ADJUSTMENTS
   =================================== */

/* Friedrich Dräxlmaier - Face visible in upper portion */
body.postid-4627 .mt-candidate-hero-photo,
body[class*="friedrich-draexlmaier"] .mt-candidate-hero-photo,
.candidate-friedrich-draexlmaier .mt-candidate-hero-photo {
    object-position: center 25% !important; /* Adjust to show face properly */
}

/* Alternative selector for candidate grid - targeting the img directly */
[data-candidate-id="4627"] .mt-candidate-photo,
[data-candidate-id="4627"] .mt-candidate-image img,
[data-candidate-id="4627"] img.mt-candidate-photo {
    object-position: center 25% !important;
}

/* Candidate cards on grid view - all possible selectors */
.mt-candidate-grid-item[data-candidate-id="4627"] .mt-candidate-photo,
.mt-candidate-grid-item[data-candidate-id="4627"] .mt-candidate-image img,
.mt-candidate-grid-item[data-candidate-id="4627"] img.mt-candidate-photo,
.mt-candidate-grid-item a[href*="friedrich-draexlmaier"] .mt-candidate-photo,
.mt-candidate-grid-item a[href*="friedrich-draexlmaier"] .mt-candidate-image img,
.mt-candidate-grid-item a[href*="friedrich-draexlmaier"] img.mt-candidate-photo {
    object-position: center 25% !important;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (width <= 768px) {
    /* Adjust for mobile where images are smaller */
    .mt-candidate-hero-photo,
    .mt-candidate-photo,
    .mt-candidate-image img {
        object-position: center 35% !important;
    }
    
    body.postid-4627 .mt-candidate-hero-photo,
    body[class*="friedrich-draexlmaier"] .mt-candidate-hero-photo,
    .candidate-friedrich-draexlmaier .mt-candidate-hero-photo {
        object-position: center 30% !important;
    }
}

/* ===================================
   ENHANCED GRID VIEW FIX
   =================================== */

/* Better default for all candidate grid images */
.mt-candidates-grid .mt-candidate-photo,
.mt-candidates-grid .mt-candidate-image img,
.mt-candidate-card .mt-candidate-photo,
.mt-candidate-card .mt-candidate-image img {
    object-position: center 30% !important; /* Better default for face visibility */
}

/* Specific fix for Friedrich Dräxlmaier on candidate grid - more specific selectors */
.mt-candidates-grid .mt-candidate-grid-item[data-candidate-id="4627"] img,
.mt-candidates-grid [data-candidate-id="4627"] img,
.mt-candidate-grid-item[data-candidate-id="4627"] img,
article.post-4627 .mt-candidate-image img,
article.post-4627 img.mt-candidate-photo,
.type-mt_candidate.post-4627 img {
    object-position: center 20% !important; /* Show face properly */
    object-fit: cover !important;
}

/* ===================================
   ELEMENTOR WIDGET SPECIFIC FIXES
   =================================== */

/* Elementor widget default image positioning */
.elementor-widget-mt_candidates_grid .mt-candidate-photo,
.elementor-widget-mt_candidates_grid .mt-candidate-image img,
.elementor-widget .mt-candidates-grid .mt-candidate-photo,
.elementor-widget .mt-candidates-grid .mt-candidate-image img {
    object-position: center 30% !important;
    object-fit: cover !important;
}

/* Friedrich Dräxlmaier fix for Elementor widget - Issue #13 */
.elementor-widget-mt_candidates_grid [data-candidate-id="4627"] .mt-candidate-photo,
.elementor-widget-mt_candidates_grid [data-candidate-id="4627"] .mt-candidate-image img,
.elementor-widget-mt_candidates_grid .mt-candidate-grid-item[data-candidate-id="4627"] img,
.elementor-widget [data-candidate-id="4627"] .mt-candidate-photo,
.elementor-widget [data-candidate-id="4627"] .mt-candidate-image img,
.elementor-widget .mt-candidate-grid-item[data-candidate-id="4627"] img,
.elementor .mt-candidate-grid-item[data-candidate-id="4627"] img,
.elementor .mt-candidates-grid [data-candidate-id="4627"] img {
    object-position: center 20% !important;
    object-fit: cover !important;
}

/* ===================================
   AGGRESSIVE FIX FOR ISSUE #13
   =================================== */

/* Force fix for Friedrich Dräxlmaier on ANY grid view */
[data-candidate-id="4627"] img,
[data-candidate-id="4627"] .mt-candidate-photo,
[data-candidate-id="4627"] .mt-candidate-image img,
.mt-candidate-grid-item[data-candidate-id="4627"] img.mt-candidate-photo,
.mt-candidate-grid-item[data-candidate-id="4627"] img.wp-post-image {
    object-position: center 15% !important;
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

/* Container fix for the image wrapper */
[data-candidate-id="4627"] .mt-candidate-image,
.mt-candidate-grid-item[data-candidate-id="4627"] .mt-candidate-image {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 75% !important; /* 4:3 aspect ratio */
    overflow: hidden !important;
}

[data-candidate-id="4627"] .mt-candidate-image img,
.mt-candidate-grid-item[data-candidate-id="4627"] .mt-candidate-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-position: center 15% !important;
    object-fit: cover !important;
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .mt-candidate-hero-photo,
    .mt-candidate-photo,
    .mt-candidate-image img {
        object-position: center center !important; /* Reset for print */
    }
}

/* ===================================
   3. EVALUATION RATING FIX
   From: evaluation-fix.css
   =================================== */

/**
 * Evaluation Rating Visual Fix
 * Purpose: Fix the visual issue where multiple selected buttons don't appear selected
 * Issue #21: Visual bug - only one button appears selected even though multiple are selected
 * Created: 2025-08-19
 */

/* Ensure each button group maintains its own selected state */
.mt-button-group .mt-score-button {
    margin: 2px;
    padding: 8px 12px;
    color: #333;
    background: #f5f5f5;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mt-button-group .mt-score-button:hover {
    background: #e9e9e9;
    border-color: #bbb;
    transform: scale(1.05);
}

/* CRITICAL: Make sure active/selected buttons are visually distinct */
.mt-button-group .mt-score-button.active,
.mt-button-group .mt-score-button.selected {
    font-weight: 700 !important;
    color: white !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    box-shadow: 0 2px 4px rgb(220 53 69 / 30%) !important;
    transform: scale(1.1) !important;
}

/* Ensure the selected state persists */
.mt-criterion-card .mt-button-group .mt-score-button.active,
.mt-criterion-card .mt-button-group .mt-score-button.selected {
    position: relative;
    z-index: 10;
    color: white !important;
    background: #dc3545 !important;
}

/* Add visual feedback that multiple selections are allowed */
.mt-button-group::before {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    content: "";
    pointer-events: none;
}

/* Make sure each criterion's buttons are independent */
.mt-criterion-card:nth-child(1) .mt-button-group .mt-score-button.active,
.mt-criterion-card:nth-child(1) .mt-button-group .mt-score-button.selected {
    background: #dc3545 !important;
}

.mt-criterion-card:nth-child(2) .mt-button-group .mt-score-button.active,
.mt-criterion-card:nth-child(2) .mt-button-group .mt-score-button.selected {
    background: #dc3545 !important;
}

.mt-criterion-card:nth-child(3) .mt-button-group .mt-score-button.active,
.mt-criterion-card:nth-child(3) .mt-button-group .mt-score-button.selected {
    background: #dc3545 !important;
}

.mt-criterion-card:nth-child(4) .mt-button-group .mt-score-button.active,
.mt-criterion-card:nth-child(4) .mt-button-group .mt-score-button.selected {
    background: #dc3545 !important;
}

.mt-criterion-card:nth-child(5) .mt-button-group .mt-score-button.active,
.mt-criterion-card:nth-child(5) .mt-button-group .mt-score-button.selected {
    background: #dc3545 !important;
}


body.debug-mode .mt-button-group .mt-score-button.active::after,
body.debug-mode .mt-button-group .mt-score-button.selected::after {
    position: absolute;
    top: -5px;
    right: -5px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    font-size: 12px;
    color: white;
    background: green;
    border-radius: 50%;
    content: "✓";
}

/* ===================================
   4. LANGUAGE SWITCHER ENHANCED
   From: language-switcher-enhanced.css
   =================================== */

/**
 * Enhanced Language Switcher Visibility
 * Purpose: Fix Issue #24 - Make language switcher more visible but elegant
 * Created: 2025-08-19
 * Updated: 2025-08-19 - Made more subtle and professional
 */

/* ===================================
   SUBTLE ENHANCED VISIBILITY
   =================================== */

/* Position language switcher in a less intrusive spot */
.mt-language-switcher {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 999 !important;
    margin: 0 !important;
}

/* Subtle but visible toggle button */
.mt-language-switcher-toggle {
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #084452 !important;
    background: rgb(255 255 255 / 95%) !important;
    border: 2px solid #084452 !important;
    box-shadow: 0 2px 8px rgb(0 76 95 / 15%) !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
}

/* Remove pulse animation - too distracting */
.mt-language-switcher-toggle {
    animation: none !important;
}

/* Subtle hover state */
.mt-language-switcher-toggle:hover {
    color: white !important;
    background: #084452 !important;
    border-color: #084452 !important;
    box-shadow: 0 4px 12px rgb(0 76 95 / 25%) !important;
    transform: translateY(-2px) !important;
}

/* Normal-sized flag icons */
.mt-language-switcher-flag {
    font-size: 18px !important;
    filter: none !important;
}

/* Arrow indicator subtle */
.mt-language-switcher-arrow {
    font-size: 10px !important;
    font-weight: 400 !important;
    color: inherit !important;
}

/* Enhanced dropdown styling */
.mt-language-switcher-dropdown {
    min-width: 180px !important;
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%) !important;
}

/* Option hover state enhancement */
.mt-language-switcher-option:hover {
    padding-left: 22px !important;
    font-weight: 400 !important;
    background: #f5f5f5 !important;
}

/* Active language indication */
.mt-language-switcher-option.active {
    font-weight: 600 !important;
    background: #f8f8f8 !important;
    border-left: 3px solid #084452 !important;
}

/* Mobile responsiveness */
@media (width <= 768px) {
    .mt-language-switcher {
        top: 10px !important;
        right: 10px !important;
    }
    
    .mt-language-switcher-toggle {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
    
    .mt-language-switcher-flag {
        font-size: 16px !important;
    }
}

/* Inline switcher - keep it simple */
.mt-language-switcher-inline {
    margin: 15px 0 !important;
    padding: 12px !important;
    background: #f9f9f9 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.mt-language-switcher-inline .mt-language-option {
    padding: 8px 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    background: white !important;
    border: 1px solid #d0d0d0 !important;
    box-shadow: 0 1px 3px rgb(0 0 0 / 10%) !important;
}

.mt-language-switcher-inline .mt-language-option:hover {
    color: white !important;
    background: #084452 !important;
    border-color: #084452 !important;
    box-shadow: 0 2px 6px rgb(0 76 95 / 20%) !important;
    transform: translateY(-1px) !important;
}

.mt-language-switcher-inline .mt-language-option.current {
    color: white !important;
    background: #084452 !important;
    border-color: #084452 !important;
}

/* Remove distracting decorative elements */
.mt-language-switcher::before {
    display: none !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mt-language-switcher-toggle {
        font-weight: 900 !important;
        border-width: 4px !important;
    }
    
    .mt-language-switcher-dropdown {
        border-width: 4px !important;
    }
}

/* Print styles - hide on print */
@media print {
    .mt-language-switcher {
        display: none !important;
    }
}

/* ===================================
   5. JURY DASHBOARD FIX
   From: mt-jury-dashboard-fix.css
   =================================== */

/**
 * Jury Dashboard Card Fix
 * Fixes evaluation status card content cutoff issue
 * 
 * @since 2.5.34
 * @package MobilityTrailblazers
 */

/* Fix viewport and zoom issues */
.mt-jury-dashboard {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Fix card height and overflow issues */
.mt-candidate-card:not(.hidden) {
    display: flex;
    flex-direction: column;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Ensure hidden cards are actually hidden */
.mt-candidate-card.hidden {
    display: none !important;
}

.mt-candidate-header {
    flex-shrink: 0;
    min-height: auto !important;
    overflow: visible !important;
}

.mt-candidate-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: auto !important;
    overflow: visible !important;
    gap: 15px;
}

/* Ensure evaluation status is visible */
.mt-evaluation-status {
    display: block !important;
    width: 100% !important;
    min-height: 45px !important;
    margin: 15px 0 !important;
    overflow: visible !important;
    text-align: center;
}

.mt-status-badge {
    display: inline-block !important;
    padding: 8px 18px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    vertical-align: middle !important;
}

/* Ensure evaluate button is visible */
.mt-evaluate-btn {
    display: inline-block;
    margin-top: auto;
    white-space: nowrap;
}

/* Fix category badge */
.mt-candidate-category {
    align-self: center;
    margin-bottom: 10px;
}

/* Ensure proper spacing */
.mt-candidate-name {
    margin-bottom: 5px !important;
    overflow: visible !important;
}

.mt-candidate-org {
    margin-bottom: 0 !important;
    overflow: visible !important;
}

/* Grid adjustments to prevent overlap */
.mt-candidates-grid {
    gap: 30px !important;
}

/* Ensure cards expand to content */
.mt-candidates-grid .mt-candidate-card {
    height: auto !important;
    min-height: 320px;
}

/* Responsive viewport fixes */
@media screen and (width <= 1920px) {
    .mt-jury-dashboard {
        padding: 30px !important;
    }
    
    .mt-dashboard-header {
        padding: 30px !important;
    }
    
    .mt-stats-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr)) !important;
    }
    
    .mt-candidates-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }
}

/* Fix for standard desktop viewports */
@media screen and (width >= 1024px) and (width <= 1440px) {
    .mt-jury-dashboard {
        margin: 15px auto !important;
        padding: 25px !important;
    }
    
    .mt-candidates-list {
        gap: 20px !important;
    }
    
    .mt-stat-card {
        padding: 20px !important;
    }
}

/* Ensure content fits at 100% zoom */
html {
    overflow-x: hidden !important;
}

body .mt-jury-dashboard * {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
}

/* Fix table overflow at 100% zoom */
.mt-evaluation-table-wrap {
    max-width: 100% !important;
    overflow-x: auto !important;
}

.mt-evaluation-table {
    width: 100% !important;
    min-width: auto !important;
}

/* Mobile-specific fixes for candidate display */
@media screen and (width <= 768px) {
    /* Ensure candidates list is always visible on mobile */
    .mt-jury-dashboard .mt-candidates-list {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
        padding: 10px 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        gap: 15px !important;
    }
    
    /* Force candidate cards to be visible - COMMENTED OUT as it interferes with filtering */

    /* .mt-jury-dashboard .mt-candidate-card {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        transform: none !important;
        margin: 0 !important;
        width: 100% !important;
    } */
    
    /* Allow cards to be hidden by JavaScript filters */
    .mt-jury-dashboard .mt-candidate-card.hidden {
        display: none !important;
    }
    
    /* Ensure cards content is visible */
    .mt-candidate-header,
    .mt-candidate-body {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Fix search and filter controls */
    .mt-search-filters {
        margin-bottom: 20px !important;
    }
    
    .mt-search-box {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .mt-search-input {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Small mobile devices */
@media screen and (width <= 480px) {
    .mt-jury-dashboard .mt-candidates-list {
        grid-template-columns: 1fr !important;
        padding: 10px 0 !important;
    }
    
    .mt-jury-dashboard .mt-candidate-card {
        margin-bottom: 10px !important;
    }
    
    /* Ensure stats grid is responsive */
    .mt-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    /* Optimize card spacing on small screens */
    .mt-candidate-header {
        padding: 12px !important;
    }
    
    .mt-candidate-body {
        padding: 12px !important;
    }
}

/* Fix for iOS Safari specific issues */
@supports (-webkit-overflow-scrolling: touch) {
    .mt-jury-dashboard {
        -webkit-overflow-scrolling: touch !important;
    }
    
    .mt-candidates-list {
        transform: translateZ(0) !important;
    }
}

/* ===================================
   6. EMERGENCY FIXES (HIGHEST PRIORITY)
   From: emergency-fixes.css
   =================================== */

/**
 * Emergency Fixes for Mobility Trailblazers
 * Date: 2025-08-19
 * Purpose: Critical fixes for evaluation criteria descriptions and German translations
 */

/* CRITICAL FIX 1: Force display of evaluation criteria descriptions */
.mt-criterion-description,
body .mt-criterion-description,
.mt-criteria-grid .mt-criterion-description {
    position: static !important;
    z-index: auto !important;
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-top: 5px !important;
    overflow: visible !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: #6c757d !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-style: normal !important;
    clip: auto !important;
    clip-path: none !important;
}

/* Ensure parent containers don't hide children */
.mt-criterion-info,
.mt-criterion-header,
.mt-criterion-card {
    overflow: visible !important;
}

/* Additional specificity to override any conflicting styles */
#mt-evaluation-form .mt-criterion-description,
.mt-evaluation-page .mt-criterion-description,
.mt-form-cards .mt-criterion-description {
    display: block !important;
    visibility: visible !important;
}

/* Ensure the text is readable */
.mt-criterion-description::before,
.mt-criterion-description::after {
    content: none !important;
}

/* CRITICAL FIX 2: Ensure German text is properly displayed */
body[lang="de-DE"] .mt-criterion-description,
html[lang="de-DE"] .mt-criterion-description {
    display: block !important;
    visibility: visible !important;
}

/* ===================================
   7. V3 COMPATIBILITY FIXES
   From: v3-compatibility-overrides
   =================================== */

/**
 * V3 Compatibility Overrides
 * Purpose: Ensure v3 CSS takes priority over conflicting hotfixes
 * Created: 2025-08-22
 */

/* Preserve v3 card styles - override conflicting hotfixes */
.mt-candidates-v3 .mt-candidate-card:not(.hidden),
.mt-dashboard-v3 .mt-candidate-card:not(.hidden) {
    /* Override hotfix display properties */
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 280px !important;
    padding: var(--mt-v3-space-lg, 24px) !important;
    overflow: visible !important;

    /* Preserve v3 variables */
    background: var(--mt-v3-card-bg, #FFF) !important;
    border: 1px solid var(--mt-v3-border-soft, #E8DCC9) !important;
    border-radius: var(--mt-v3-radius, 16px) !important;
    box-shadow: var(--mt-v3-shadow, 0 2px 10px rgb(0 0 0 / 7%)) !important;
}

/* Ensure v3 grid layout is preserved */
.mt-candidates-v3.mt-candidates-grid,
.mt-candidates-v3.mt-candidates-list {
    display: grid !important;
    gap: var(--mt-v3-space-lg, 24px) !important;
}

/* Override specific mobile fixes that break v3 */
@media screen and (width <= 768px) {
    .mt-dashboard-v3 .mt-candidates-v3 .mt-candidate-card:not(.hidden) {
        /* Preserve v3 mobile styling */
        display: flex !important;
        width: 100% !important;
    }
}

/* ===================================
   7. V3 COMPATIBILITY FIXES
   =================================== */

/**
 * V3 Candidate Cards Compatibility 
 * Purpose: Ensure hotfixes don't break v3 card design
 * Priority: Preserve v3 styling while allowing necessary hotfixes
 */

/* OVERRIDE CONFLICTING HOTFIX RULES FOR V3 CARDS */

/* Reset conflicting jury dashboard fixes for v3 containers */
.mt-dashboard-v3 .mt-candidate-card:not(.hidden),
.mt-candidates-v3 .mt-candidate-card:not(.hidden) {
    display: flex !important; /* Match v3 spec */
    flex-direction: column !important; /* Match v3 spec */
    height: auto !important;

    /* Let v3 CSS handle the card styling completely */
    min-height: 280px !important; /* Match v3 spec */
    padding: var(--mt-v3-space-lg) !important;
    overflow: hidden !important; /* Match v3 spec */
    background: var(--mt-v3-card-bg) !important; /* Use v3 variables */
    border: 1px solid var(--mt-v3-border-soft) !important;
    border-radius: var(--mt-v3-radius) !important;
    box-shadow: var(--mt-v3-shadow) !important;
}

/* Ensure v3 grid layout is preserved */
.mt-candidates-v3 {
    /* Override any conflicting grid rules */
    display: grid !important;
    gap: var(--mt-v3-space-lg) !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
}

/* Reset header styling for v3 */
.mt-dashboard-v3 .mt-candidate-header,
.mt-candidates-v3 .mt-candidate-header {
    flex-shrink: 0 !important;
    margin-bottom: var(--mt-v3-space-md) !important;
    padding-bottom: var(--mt-v3-space-md) !important;
    overflow: visible !important;
    border-bottom: 2px solid var(--mt-v3-border-soft) !important;
}

/* Reset body styling for v3 */
.mt-dashboard-v3 .mt-candidate-body,
.mt-candidates-v3 .mt-candidate-body {
    display: flex !important;
    flex: 1 !important;
    flex-direction: column !important;
    min-height: auto !important;
    overflow: visible !important;
    gap: var(--mt-v3-space-md) !important;
}

/* Ensure evaluation status styling is preserved in v3 */
.mt-dashboard-v3 .mt-evaluation-status,
.mt-candidates-v3 .mt-evaluation-status {
    display: block !important;
    width: 100% !important;
    min-height: 45px !important;
    margin: auto 0 var(--mt-v3-space-md) 0 !important;
    overflow: visible !important;
    text-align: center !important;
}

/* Preserve v3 button styling */
.mt-dashboard-v3 .mt-evaluate-btn,
.mt-candidates-v3 .mt-evaluate-btn {
    display: inline-block !important;
    width: 100% !important;
    margin-top: auto !important;
    padding: var(--mt-v3-space-md) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    color: white !important;
    background: linear-gradient(135deg, var(--mt-v3-primary), var(--mt-v3-secondary)) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgb(0 60 61 / 20%) !important;
    transition: var(--mt-v3-transition) !important;
    white-space: nowrap !important;
}

/* Responsive grid adjustments for v3 that don't conflict with hotfixes */
@media screen and (width <= 1023px) {
    .mt-candidates-v3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media screen and (width <= 767px) {
    .mt-candidates-v3 {
        grid-template-columns: 1fr !important;
        padding: var(--mt-v3-space-md) !important;
    }
}