/* css/views/syllabus.css */

/* Styles specific to the #syllabus section */

#syllabus .content-header {
    margin-bottom: 25px;
}
#syllabusSubjectName { /* The main H1 span for subject name */
    /* Color comes from generic span styling if needed, or from h1 */
}
#syllabusSubjectName .text-muted.small.d-block { /* For "Unit X: Title" subtitle when filtered */
    font-size: 0.8rem; /* Ensure it's smaller */
    margin-top: 0.25rem;
}

#syllabusPlaceholderMessage {
    padding: 30px 20px;
    font-size: 1.1rem;
    text-align: center;
    color: var(--text-muted);
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border: 1px dashed var(--border-color);
}

#syllabusContentArea {
    padding-top: 10px;
}

/* "Show All Units" Button (when a unit filter is active) */
.btn-clear-filter {
    /* Generic .btn .btn-sm .btn-outline-secondary styles apply from components.css */
    display: block; /* Centered by mx-auto in JS */
    margin-bottom: 25px; /* More space below it */
    max-width: 220px; /* Slightly wider */
}
.btn-clear-filter .mr-1 { margin-right: 0.4em; } /* Space for icon */

/* Unit Headers */
.unit-header {
    font-family: var(--font-secondary);
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 30px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}
.unit-header .unit-icon { /* Icon before unit title (e.g., fas fa-folder-open) */
    color: var(--accent-primary);
    font-size: 0.9em; /* Relative to header font size */
    margin-right: 0.6em; /* Increased space */
}
#syllabusContentArea > .syllabus-unit-container:first-child > .unit-header {
    margin-top: 10px;
}

/* Topic Cards */
.syllabus-topic.card {
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-primary); /* Prominent accent border */
    border-radius: var(--border-radius-md); /* Use smaller radius for less bulky cards */
    box-shadow: var(--shadow-color) 0 2px 6px; /* Softer shadow */
    transition: all var(--transition-speed-normal) ease, border-left-color var(--transition-speed-normal) ease;
}
.syllabus-topic.card:hover {
    box-shadow: var(--shadow-strong) 0 5px 15px;
    transform: translateY(-2px);
    border-left-color: var(--accent-secondary);
}

.syllabus-topic .card-header {
    background-color: var(--bg-secondary);
    padding: 12px 18px; /* Slightly adjusted padding */
}
.syllabus-topic .card-header .d-flex { /* The flex container in card-header */
    /* justify-content-between and align-items-center are already there */
}
.syllabus-topic .card-header h3.topic-title-in-card {
    font-family: var(--font-secondary);
    font-size: 1.1rem; /* Slightly smaller for better balance */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.topic-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topic-progress-text {
    font-size: 0.75rem; /* Smaller text for "X/Y Done" */
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    min-width: 60px; /* Give it some space */
    text-align: right;
    margin-left: 0.5rem;
}
.topic-mini-progress-bar {
    width: 70px; /* Width of the mini bar */
    height: 5px; /* Thinner bar */
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}
.topic-mini-progress-bar .progress-fill {
    height: 100%;
    width: 0%; /* JS updates this */
    border-radius: 3px;
    transition: width var(--transition-speed-normal) ease, background-color var(--transition-speed-normal) ease;
    /* JS will add .bg-success, .bg-primary etc. from components.css */
}
.topic-mini-progress-bar .progress-fill.bg-secondary { background-color: var(--text-muted) !important; opacity: 0.5; } /* For 0% fill */


/* Syllabus Checklist and Items */
.syllabus-checklist.list-group.list-group-flush {
    border-top: 1px solid var(--border-color);
}
.syllabus-checklist .list-group-item.text-muted {
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.syllabus-item.list-group-item {
    padding: 12px 18px; /* Adjusted padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color var(--transition-speed-fast) ease,
                border-left-color var(--transition-speed-fast) ease;
    border-left: 3px solid transparent; /* For saving indicator */
}
.syllabus-item.list-group-item:hover {
    background-color: var(--bg-interactive);
}
/* Saving Indicator for Syllabus Item */
.syllabus-item.item-saving {
    border-left-color: var(--accent-primary);
    background-color: rgba(var(--accent-primary-rgb), 0.05) !important; /* Subtle saving bg */
}
.syllabus-item.item-saving .status-select,
.syllabus-item.item-saving .explain-ai-btn {
    opacity: 0.7; /* Dim controls while saving */
}


.item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    margin-right: 15px;
}
.custom-checkbox + label.syllabus-point-label {
    /* Generic custom checkbox label styles from components.css apply */
    /* Specific adjustments if needed: */
    font-size: 0.95rem;
    line-height: 1.5;
}
.custom-checkbox:checked + label.syllabus-point-label {
    /* Generic checked styles apply (strikethrough, muted color) */
}

/* Item Actions: Status Selector, AI Button, Resource Links */
.item-actions {
    display: flex;
    align-items: center;
    gap: 10px; /* Consistent gap for all action items */
    flex-shrink: 0;
}

.status-selector-wrapper .status-select.status-badge {
    /* Generic .form-control .form-control-sm styles apply */
    font-size: 0.8rem;
    padding: 5px 8px; /* Tighter padding for badge look */
    padding-right: 25px; /* Space for arrow */
    min-width: 110px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    border-left-width: 4px; /* For status color indication */
    border-left-style: solid;
    /* Transition for status color change */
    transition: border-left-color var(--transition-speed-fast) ease, background-color var(--transition-speed-fast) ease, color var(--transition-speed-fast) ease;
}
/* Status colors for select "badge" */
.status-select.status-badge.status-todo { border-left-color: var(--status-todo-text); background-color: var(--status-todo-bg); color: var(--status-todo-text); }
.status-select.status-badge.status-revising { border-left-color: var(--revising); background-color: var(--status-revising-bg); color: var(--status-revising-text); }
.status-select.status-badge.status-learned { border-left-color: var(--success); background-color: var(--status-learned-bg); color: var(--status-learned-text); }
.status-select.status-badge.status-need-help { border-left-color: var(--danger); background-color: var(--status-need-help-bg); color: var(--status-need-help-text); }

.status-select.status-badge.status-saving { /* When individual item is saving */
    /* opacity: 0.7; (Handled by .item-saving parent) */
    animation: pulseBorderSubtle 1.5s infinite ease-in-out; /* More subtle than full item pulse */
}
@keyframes pulseBorderSubtle { /* More subtle pulse for select border */
    0%, 100% { border-left-color: inherit; /* Use current status color */ }
    50% { border-left-color: var(--accent-primary); }
}


.explain-ai-btn { /* Button specific to AI explain */
    /* Generic .btn .btn-xs .btn-icon .btn-outline-secondary styles apply */
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    padding: 4px 6px; /* Ensure it's small */
}
.explain-ai-btn:hover:not(:disabled) {
    background-color: var(--accent-secondary);
    color: white;
}
.explain-ai-btn .fa-brain { font-size: 0.9em; /* Adjust icon size within btn-xs */ }
.explain-ai-btn .spinner-border-xs { /* Spinner inside AI button */
    /* Generic .spinner styles from base.css will apply, this is for BS spinner */
    width: 0.75rem; height: 0.75rem; border-width: 0.12em;
}


.resource-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.resource-links a.resource-link {
    color: var(--text-muted);
    font-size: 1rem; /* Slightly smaller for better balance */
    transition: color var(--transition-speed-fast) ease, transform var(--transition-speed-fast) ease;
    text-decoration: none;
    display: inline-block;
}
.resource-links a.resource-link:hover {
    color: var(--accent-primary);
    transform: scale(1.1);
}

/* Styling for AI Explanation Modal Content (if you create a modal) */
.ai-explanation-content { /* This class would be on the modal's content div */
    max-height: 70vh; /* Allow more height */
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 5px; /* Add slight padding if modal itself doesn't have enough */
}
/* Styles for H1, p, pre, code within this modal can inherit from notesView styles if similar, or define here */
.ai-explanation-content h1, .ai-explanation-content h2, .ai-explanation-content h3 {
    margin-top: 0.8em; margin-bottom: 0.4em; color: var(--text-primary);
}
.ai-explanation-content h1 { font-size: 1.4em; }
.ai-explanation-content h2 { font-size: 1.2em; }
.ai-explanation-content p { margin-bottom: 0.8em; }
.ai-explanation-content ul, .ai-explanation-content ol { margin-bottom: 0.8em; padding-left: 20px; }
.ai-explanation-content pre {
    background-color: var(--bg-tertiary);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85em;
    margin: 0.5em 0;
}


/* Responsive Adjustments for Syllabus View */
@media (max-width: 768px) {
    .unit-header { font-size: 1.5rem; }
    .syllabus-topic .card-header { padding: 10px 15px; }
    .syllabus-topic .card-header h3.topic-title-in-card { font-size: 1rem; }
    .topic-progress-container { gap: 8px; }
    .topic-progress-text { font-size: 0.7rem; min-width: 50px; }
    .topic-mini-progress-bar { width: 60px; }

    .syllabus-item.list-group-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px; /* Increased gap when stacked */
        padding: 10px 15px;
    }
    .item-main { margin-right: 0; }
    .custom-checkbox + label.syllabus-point-label { font-size: 0.9rem; }
    .item-actions {
        width: 100%;
        justify-content: space-between;
        gap: 8px; /* Reduce gap in actions row */
    }
    .status-selector-wrapper { flex-grow: 1; }
    .status-selector-wrapper .status-select.status-badge { min-width: 100px; font-size: 0.75rem; }
    .explain-ai-btn { padding: 3px 5px; } /* Ensure it stays small */
    .resource-links { justify-content: flex-end; }
}

@media (max-width: 480px) { /* Further refinement for very small screens */
    .unit-header { font-size: 1.3rem; }
    .item-actions {
        flex-direction: column;
        align-items: flex-start; /* Align to start */
        gap: 10px;
    }
    .status-selector-wrapper { width: 100%; }
    .explain-ai-btn { align-self: flex-start; } /* Align AI button to start */
    .resource-links {
        justify-content: flex-start; /* Align resource links to start */
        padding-top: 8px;
    }
}