/**
 * MT Evaluation Spacing Consolidation Fix
 *
 * This file consolidates and standardizes all padding/margin values
 * for the evaluation interface, resolving conflicts between:
 * - mt-evaluation-forms.css
 * - mt-evaluation-fixes.css
 * - Other evaluation-related CSS files
 *
 * Version: 2.5.42+
 * Created: 2025-11-17
 * Priority: High (loaded last to override conflicts)
 */

/* ============================================
   1. EVALUATION HEADER
   ============================================ */

.mt-evaluation-header {
    margin-bottom: 24px !important;
    padding: 24px !important;
    padding-bottom: 20px !important;
    border-bottom: 2px solid #dee2e6;
}

.mt-evaluation-title {
    margin: 0 0 12px 0 !important;
    font-size: 28px;
    font-weight: 600;
    color: #0072BC;
    line-height: 1.3;
}

/* ============================================
   2. SECTION TITLES (BEWERTUNGSKRITERIEN)
   ============================================ */

.mt-section-title {
    margin: 0 0 24px 0 !important;
    padding-bottom: 16px !important;
    font-size: 28px;
    font-weight: 600;
    color: #0072BC;
    border-bottom: 2px solid #dee2e6;
}

/* Variant in criteria info section */
.mt-criteria-info-section .mt-section-title {
    margin-bottom: 24px !important;
    padding-bottom: 16px !important;
    font-size: 1.5rem;
}

/* ============================================
   3. CRITERIA INFO SECTION
   ============================================ */

.mt-criteria-info-section {
    margin: 24px auto !important;
    padding: 24px !important;
    width: 100%;
}

/* Full-width variant */
.mt-criteria-info-section.full-width {
    width: calc(100% + 48px) !important;
    margin-right: -24px !important;
    margin-left: -24px !important;
}

/* ============================================
   4. CRITERION CARDS
   ============================================ */

.mt-criterion-card {
    margin: 16px 0 !important;
    padding: 24px !important;
    background: #f8f0e3;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
}

.mt-criterion-card:hover {
    box-shadow: 0 2px 8px rgba(0, 60, 61, 0.1);
}

/* Criterion card header */
.mt-criterion-header {
    margin-bottom: 16px !important;
    padding-left: 12px !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mt-criterion-title {
    margin: 0 !important;
    font-size: 20px;
    font-weight: 600;
    color: #00694E;
}

.mt-criterion-description {
    margin: 12px 0 16px 0 !important;
    padding: 0 !important;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

/* ============================================
   5. SCORE DISPLAY (Rounded Box)
   ============================================ */

.mt-score-display {
    display: inline-block !important;
    float: right !important;
    margin-top: -8px !important;
    padding: 8px 16px !important;
    background: #084452;
    color: white;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 76, 95, 0.2);
}

.mt-score-value {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

/* Score display in criterion cards (circular variant) */
.mt-criterion-card .mt-score-display {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50%;
    float: none;
}

.mt-criterion-card .mt-score-value {
    font-size: 20px;
}

/* ============================================
   6. SCORING CONTROLS
   ============================================ */

.mt-scoring-control {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px !important;
}

.mt-score-slider-wrapper {
    position: relative;
    flex: 1;
    margin-top: 16px !important;
    padding: 12px 0 24px 0 !important;
}

.mt-scoring-section {
    margin-top: 20px !important;
    padding: 16px !important;
    background: white;
    border-radius: 6px;
}

/* ============================================
   7. BUTTONS
   ============================================ */

button.mt-submit-evaluation,
.mt-btn.mt-submit-evaluation,
.mt-button.mt-submit-evaluation {
    margin: 16px 8px !important;
    padding: 14px 36px !important;
    font-size: 16px;
    font-weight: 600;
    background: #084452;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button.mt-submit-evaluation:hover,
.mt-btn.mt-submit-evaluation:hover {
    background: #003C4D;
    box-shadow: 0 4px 8px rgba(0, 76, 95, 0.2);
}

/* Secondary buttons */
.mt-btn-secondary {
    margin: 16px 8px !important;
    padding: 14px 36px !important;
    background: #6c757d;
    color: white;
}

/* ============================================
   8. EVALUATION FORM CONTAINER
   ============================================ */

.mt-evaluation-form {
    margin: 0 !important;
    padding: 0 !important;
}

.mt-evaluation-container {
    margin: 0 auto !important;
    padding: 24px !important;
    max-width: 1200px;
}

/* ============================================
   9. RANKINGS AND LISTS
   ============================================ */

.mt-rankings-list .mt-ranking-item {
    padding: 12px 16px !important;
    margin: 8px 0 !important;
    gap: 12px;
    display: flex;
    align-items: center;
}

.mt-total-score-display {
    margin: 0 8px !important;
    padding: 6px 12px !important;
    background: var(--mt-primary);
    color: white;
    border-radius: 16px;
    font-weight: 600;
}

/* ============================================
   10. CANDIDATE INFO IN EVALUATION
   ============================================ */

.mt-candidate-description {
    margin-top: 24px !important;
    margin-bottom: 24px !important;
    padding: 20px !important;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #0072BC;
}

.mt-candidate-bio {
    margin-top: 16px !important;
    padding: 16px !important;
    background: #f8f9fa;
    border-radius: 6px;
}

/* ============================================
   11. RESPONSIVE DESIGN
   ============================================ */

/* Tablet (900px and below) */
@media (max-width: 900px) {
    .mt-evaluation-header {
        padding: 20px !important;
    }

    .mt-criterion-card {
        padding: 20px !important;
        margin: 12px 0 !important;
    }

    .mt-section-title {
        font-size: 24px;
        margin-bottom: 20px !important;
    }

    .mt-score-display {
        margin-top: 0 !important;
        float: none !important;
        display: block !important;
        width: fit-content;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .mt-evaluation-header {
        padding: 16px !important;
        margin-bottom: 20px !important;
    }

    .mt-evaluation-title {
        font-size: 22px;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .mt-section-title {
        font-size: 20px;
        margin-bottom: 16px !important;
        padding-bottom: 12px !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .mt-criterion-card {
        padding: 16px !important;
        margin: 12px 0 !important;
    }

    .mt-criterion-header {
        padding-left: 8px !important;
        margin-bottom: 12px !important;
    }

    .mt-criterion-title {
        font-size: 18px;
    }

    .mt-criterion-description {
        font-size: 13px;
        margin: 8px 0 12px 0 !important;
    }

    .mt-scoring-control {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    button.mt-submit-evaluation,
    .mt-btn.mt-submit-evaluation {
        padding: 12px 24px !important;
        width: 100%;
        margin: 8px 0 !important;
    }

    .mt-candidate-description {
        padding: 16px !important;
        margin-top: 20px !important;
    }

    /* HIGH SPECIFICITY CANDIDATE SHOWCASE MOBILE STYLES */
    body .mt-evaluation-page .mt-candidate-showcase,
    body.mt-evaluation-page .mt-candidate-showcase {
        padding: 20px !important;
        overflow: hidden !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-candidate-profile,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-profile {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        align-items: center !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-candidate-photo,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-photo {
        width: 150px !important;
        height: 150px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-candidate-name,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-name {
        font-size: 24px !important;
        text-align: center !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-candidate-meta,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-meta {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: center !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-meta-item,
    body.mt-evaluation-page .mt-candidate-showcase .mt-meta-item {
        padding: 6px 12px !important;
        font-size: 13px !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-innovation-summary,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-bio {
        padding: 18px !important;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .mt-evaluation-container {
        padding: 16px !important;
    }

    .mt-criterion-card {
        padding: 12px !important;
    }

    .mt-evaluation-title {
        font-size: 20px;
    }

    .mt-section-title {
        font-size: 18px;
    }

    /* HIGH SPECIFICITY CANDIDATE SHOWCASE SMALL MOBILE STYLES */
    body .mt-evaluation-page .mt-candidate-showcase,
    body.mt-evaluation-page .mt-candidate-showcase {
        margin: 15px 0 !important;
        padding: 15px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-candidate-profile,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-profile {
        gap: 15px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-candidate-photo,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-photo {
        width: 120px !important;
        height: 120px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-candidate-name,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-name {
        font-size: 20px !important;
        margin-bottom: 15px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-candidate-meta,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-meta {
        gap: 8px !important;
        margin-bottom: 20px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-meta-item,
    body.mt-evaluation-page .mt-candidate-showcase .mt-meta-item {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-innovation-summary,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-bio {
        padding: 12px !important;
        margin-bottom: 20px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-innovation-summary h3,
    body.mt-evaluation-page .mt-candidate-showcase .mt-candidate-bio h3 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }

    body .mt-evaluation-page .mt-candidate-showcase .mt-innovation-summary p,
    body.mt-evaluation-page .mt-candidate-showcase .mt-bio-content {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    /* Ultra-specific fixes for remaining mobile issues */
    /* Fix mt-total-score-display layout on mobile with text wrapping */
    .mt-total-score-display,
    body .mt-total-score-display,
    .mt-evaluation-container .mt-total-score-display,
    .mt-scoring-section .mt-total-score-display {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        padding: 12px 16px !important;
        margin: 8px auto !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
        white-space: normal !important;
        word-break: break-word !important;
        hyphens: auto !important;
        max-width: calc(100% - 24px) !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
        text-align: center !important;
        background: var(--mt-primary) !important; /* Changed from #00694E for consistency with desktop */
        color: #FFFFFF !important;
        border-radius: 16px !important;
    }

    /* Fix mt-evaluate-btn centering in candidate cards */
    .mt-candidate-card .mt-evaluate-btn,
    body .mt-jury-dashboard .mt-candidate-card .mt-evaluate-btn,
    .mt-candidates-v3 .mt-candidate-card .mt-evaluate-btn,
    .mt-dashboard-v3 .mt-candidate-card .mt-evaluate-btn {
        display: block !important;
        width: auto !important;
        max-width: 200px !important;
        margin: 15px auto 0 auto !important;
        text-align: center !important;
        padding: 10px 24px !important;
    }
}

/* Ultra-small screens (360px and below) */
@media (max-width: 360px) {
    .mt-total-score-display,
    body .mt-total-score-display,
    .mt-evaluation-container .mt-total-score-display,
    .mt-scoring-section .mt-total-score-display {
        font-size: 13px !important;
        padding: 10px 12px !important;
        max-width: calc(100% - 16px) !important;
    }
}

/* Tablet breakpoint for evaluate button */
@media (max-width: 768px) {
    .mt-candidate-card .mt-evaluate-btn,
    body .mt-jury-dashboard .mt-candidate-card .mt-evaluate-btn {
        width: 100% !important;
        max-width: none !important;
        margin: 12px 0 0 0 !important;
    }
}

/* ============================================
   12. PRINT STYLES
   ============================================ */

@media print {
    .mt-evaluation-header {
        padding: 12px !important;
        margin-bottom: 16px !important;
        border-bottom: 1px solid #dee2e6;
    }

    .mt-criterion-card {
        padding: 12px !important;
        margin: 8px 0 !important;
        page-break-inside: avoid;
    }

    button.mt-submit-evaluation,
    .mt-btn.mt-submit-evaluation {
        display: none !important;
    }
}

/* ============================================
   13. ACCESSIBILITY IMPROVEMENTS
   ============================================ */

.mt-criterion-card:focus-within {
    outline: 2px solid #084452;
    outline-offset: 2px;
}

.mt-score-display[aria-label] {
    position: relative;
}

/* Focus states for buttons */
button.mt-submit-evaluation:focus,
.mt-btn.mt-submit-evaluation:focus {
    outline: 3px solid #009879;
    outline-offset: 2px;
}

/* ============================================
   14. UTILITY OVERRIDES
   ============================================ */

/* Remove any conflicting body-scoped overrides */
body .mt-evaluation-header {
    padding: 24px !important;
}

body .mt-criterion-card {
    padding: 24px !important;
}

body .mt-criterion-header {
    margin-bottom: 16px !important;
    padding-left: 12px !important;
}

body .mt-score-slider-wrapper {
    padding: 12px 0 24px 0 !important;
}

/* Ensure consistent spacing even with WordPress admin bar */
body.admin-bar .mt-evaluation-container {
    padding-top: 24px !important;
}

/* ============================================
   END OF CONSOLIDATED SPACING FIX
   ============================================ */
