:root { --ld-primary: #6eaf20; }
.ld-focus .ld-focus-header { background: #fff !important; border-bottom: 3px solid #6eaf20 !important; height: 75px !important; }
.iforest-ld-focus-nav { display: flex; align-items: center; gap: 20px; height: 100%; padding-left: 20px;}
.iforest-focus-logo img { height: 45px; width: auto; transition: transform 0.2s; vertical-align: middle;}
.iforest-focus-logo:hover img { transform: scale(1.05); }
.iforest-focus-dash-link { 
    color: #333 !important; font-family: 'Work Sans', sans-serif; font-weight: 600; 
    font-size: 15px; text-decoration: none !important; display: flex; align-items: center; 
    gap: 8px; transition: color 0.2s;
}
.iforest-focus-dash-link:hover { color: #6eaf20 !important; }
.iforest-focus-dash-link i { font-size: 1.1em; color: #6eaf20;}

/* Typography & Cleanup */
.learndash-wrapper { font-family: 'Work Sans', sans-serif !important; }
.ld-focus-header .ld-focus-header-center, .ld-focus-header .ld-course-navigation-steps-list-container { display: none !important; }
.ld-button, .ld-button-primary, .wpProQuiz_button { 
    background: #6eaf20 !important; font-family: 'Roboto', sans-serif !important; 
    color: #fff !important; border-radius: 4px !important; border: none !important;
}
.ld-button:hover, .wpProQuiz_button:hover { background: #ed1c24 !important; }

/* Sidebar current item highlight */
.ld-focus-sidebar .ld-is-current { border-left: 5px solid #6eaf20 !important; background: #f7fbf2 !important; }
.ld-progress-bar__fill { background: #6eaf20 !important; }

/* Header responsiveness */
@media (max-width: 768px) {
    .iforest-focus-dash-link span { display: none; }
    .iforest-ld-focus-nav { gap: 10px; padding-left: 10px; }
}

/* ── Fill-in-the-blank (Cloze) Question Styling ── */

/* Hide the duplicate question text that shows {answer} at top */
.wpProQuiz_questionList li[data-type="cloze_answer"] .wpProQuiz_question_text {
    display: none !important;
}

/* Style the cloze interactive container */
.wpProQuiz_questionList li[data-type="cloze_answer"] .wpProQuiz_cloze_str,
.wpProQuiz_cloze_str {
    font-size: 1rem;
    line-height: 1.9;
    color: #333;
    font-family: 'Work Sans', sans-serif;
}

/* Input field: underline style instead of box */
.wpProQuiz_cloze input[type="text"] {
    border: none !important;
    border-bottom: 2px solid #6eaf20 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 2px 6px !important;
    font-size: 1rem !important;
    font-family: 'Work Sans', sans-serif !important;
    color: #1a4a00 !important;
    font-weight: 600 !important;
    outline: none !important;
    box-shadow: none !important;
    min-width: 120px;
    transition: border-color 0.2s;
}
.wpProQuiz_cloze input[type="text"]:focus {
    border-bottom-color: #ed1c24 !important;
    background: rgba(110,175,32,0.05) !important;
}
.wpProQuiz_cloze input[type="text"]::placeholder {
    color: #ccc;
}

/* Correct/Incorrect feedback spans */
.wpProQuiz_clozeCorrect { font-style: italic; color: #6eaf20; font-weight: 600; margin-left: 4px; }

/* Style the [ Fill in the blank below ] hint text */
.wpProQuiz_questionList li[data-type="cloze_answer"] .wpProQuiz_question_text {
    display: block !important; /* re-show — we hid it before, now we style it */
}

/* ── LearnDash Topic / Lesson / Course Materials Styling ── */

/* Materials Tab Button */
.ld-tab-bar__tab#ld-tab-materials,
.ld-tabs-navigation .ld-tab[data-ld-tab*="materials"],
.ld-tabs-navigation .ld-tab#ld-materials-tab {
    font-family: 'Work Sans', sans-serif !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.ld-tab-bar__tab#ld-tab-materials[aria-selected="true"],
.ld-tabs-navigation .ld-tab.ld-active[data-ld-tab*="materials"] {
    color: #1a300a !important;
    border-bottom: 3px solid #6eaf20 !important;
}

.ld-tab-bar__tab#ld-tab-materials svg,
.ld-tab-bar__tab#ld-tab-materials .ld-icon {
    color: #6eaf20 !important;
}

/* Materials Container / Panel */
#ld-tab-panel-materials,
.ld-tab-content[id*="ld-tab-materials"],
.ld-tab-content[aria-labelledby*="materials"],
.ld-tab-materials,
.ld-materials-tab-content {
    background: #ffffff !important;
    border: 1px solid #e1edd6 !important;
    border-top: 3px solid #6eaf20 !important;
    border-radius: 8px !important;
    padding: 24px 28px !important;
    margin-top: 15px !important;
    margin-bottom: 25px !important;
    box-shadow: 0 4px 14px rgba(110, 175, 32, 0.06) !important;
}

/* Materials Header Notice */
.iforest-materials-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f3f9eb 0%, #eaf5dd 100%);
    border-left: 4px solid #6eaf20;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #244610;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Work Sans', sans-serif;
}

.iforest-materials-header i,
.iforest-materials-header svg {
    color: #6eaf20;
    font-size: 20px;
    flex-shrink: 0;
}

.iforest-materials-header-title {
    font-weight: 700;
    color: #1b3d0c;
    margin-right: 4px;
}

/* Base Material Card (Supports raw links & enhanced structure) */
#ld-tab-panel-materials a,
.ld-tab-content[id*="materials"] a,
.ld-tab-materials a,
.iforest-material-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-decoration: none !important;
    background: #ffffff !important;
    border: 1.5px solid #dcebcf !important;
    border-left: 5px solid #6eaf20 !important;
    border-radius: 8px !important;
    padding: 14px 18px !important;
    margin-bottom: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.25s ease-in-out !important;
    color: #1a300a !important;
    box-sizing: border-box !important;
    position: relative !important;
}

#ld-tab-panel-materials a:hover,
.ld-tab-content[id*="materials"] a:hover,
.ld-tab-materials a:hover,
.iforest-material-card:hover {
    background-color: #f7fbf2 !important;
    border-color: #6eaf20 !important;
    box-shadow: 0 6px 18px rgba(110, 175, 32, 0.18) !important;
    transform: translateY(-2px) !important;
    color: #142a07 !important;
}

#ld-tab-panel-materials p,
.ld-tab-content[id*="materials"] p {
    margin-bottom: 0 !important;
}

/* Material Card Layout */
.iforest-material-card-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-grow: 1;
    min-width: 0;
}

.iforest-material-icon-box {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 8px;
    background: #edf6e3;
    color: #6eaf20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.iforest-material-icon-box.is-pdf {
    background: #fdeeee;
    color: #e53935;
}

.iforest-material-icon-box.is-ppt {
    background: #fff4e6;
    color: #ea580c;
}

.iforest-material-icon-box.is-doc {
    background: #eff6ff;
    color: #2563eb;
}

.iforest-material-icon-box.is-zip {
    background: #fdf4ff;
    color: #9333ea;
}

.iforest-material-card:hover .iforest-material-icon-box {
    transform: scale(1.08);
}

.iforest-material-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.iforest-material-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #e8f3dc;
    color: #3b6e0b;
    width: fit-content;
    line-height: 1.3;
}

.iforest-material-badge.badge-pdf {
    background: #fde8e8;
    color: #c53030;
}

.iforest-material-badge.badge-ppt {
    background: #ffedd5;
    color: #c2410c;
}

.iforest-material-badge.badge-doc {
    background: #dbeafe;
    color: #1d4ed8;
}

.iforest-material-title {
    font-family: 'Work Sans', sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1a300a !important;
    line-height: 1.4 !important;
    word-break: break-word;
}

/* Download Action Button */
.iforest-material-action {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #6eaf20;
    color: #ffffff !important;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(110, 175, 32, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-left: 16px;
    flex-shrink: 0;
}

.iforest-material-card:hover .iforest-material-action {
    background: #588c1a;
    box-shadow: 0 4px 10px rgba(110, 175, 32, 0.4);
    transform: translateX(2px);
}

/* Fallback Icon for Unenhanced Links */
#ld-tab-panel-materials a:not(.iforest-material-card)::before,
.ld-tab-content[id*="materials"] a:not(.iforest-material-card)::before {
    content: "📥";
    font-size: 18px;
    margin-right: 12px;
}

/* Responsive adjustment for Mobile */
@media (max-width: 600px) {
    #ld-tab-panel-materials,
    .ld-tab-content[id*="ld-tab-materials"],
    .ld-tab-materials {
        padding: 16px 14px !important;
    }

    #ld-tab-panel-materials a,
    .ld-tab-content[id*="materials"] a,
    .iforest-material-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 12px 14px !important;
    }

    .iforest-material-action {
        margin-left: 0 !important;
        justify-content: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

