/* ============================================
   FRONTEND - RESPONSIVE DESIGN
   ============================================ */
.msbte-wrapper {
    max-width: 1300px;
    margin: 30px auto;
    font-family: 'Segoe UI', system-ui, sans-serif;
    --primary: #0b1c3a;
    --accent: #f4b942;
    --bg: #f0f4f9;
}

/* Header */
.msbte-header {
    background: linear-gradient(135deg, var(--primary), #1a3b5c);
    color: #fff;
    padding: 28px 35px;
    border-radius: 20px 20px 0 0;
    border-left: 8px solid var(--accent);
}
.msbte-header h2 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: clamp(1.3rem, 4vw, 2rem); }
.msbte-header h2 i { color: var(--accent); }
.msbte-header p { opacity: 0.85; margin-top: 8px; }

/* Search */
.msbte-search-bar { padding: 18px 25px; background: #e6ecf3; }
.msbte-search-bar input {
    width: 100%; padding: 15px 22px; border: 2px solid #d9e2ec;
    border-radius: 50px; font-size: 1rem; outline: none;
}
.msbte-search-bar input:focus { border-color: var(--accent); }

/* Department Tabs */
.msbte-tabs {
    display: flex; flex-wrap: wrap; gap: 10px;
    padding: 15px 25px; background: #e6ecf3;
}
.msbte-tab {
    padding: 12px 24px; border-radius: 50px; cursor: pointer;
    font-weight: 600; background: #fff; border: 2px solid transparent;
    display: flex; align-items: center; gap: 8px; font-size: 0.95rem;
}
.msbte-tab.active { background: var(--primary); color: #fff; border-color: var(--accent); }
.msbte-tab:hover:not(.active) { border-color: #2563eb; }

/* Content */
.msbte-content { padding: 20px; background: #e6ecf3; border-radius: 0 0 20px 20px; }
.msbte-dept-panel { display: none; }
.msbte-dept-panel.active { display: block; }

/* Semester */
.msbte-semester {
    background: #fff; border-radius: 16px; margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid #e0e7ef; overflow: hidden;
}
.msbte-sem-title {
    background: linear-gradient(135deg, #13294b, #1a3a5c); color: #fff;
    padding: 15px 22px; cursor: pointer; font-weight: 700; font-size: 1.1rem;
    display: flex; align-items: center; gap: 10px;
}
.msbte-sem-title i { color: var(--accent); }
.msbte-sem-content { display: none; }
.msbte-semester.open .msbte-sem-content { display: block; }

/* Subject */
.msbte-subject { border-bottom: 1px solid #eef2f6; }
.msbte-subj-header {
    padding: 13px 22px; cursor: pointer; display: flex; align-items: center; gap: 10px;
    font-weight: 600; transition: background 0.15s;
}
.msbte-subj-header:hover { background: #f9fbfe; }
.msbte-code {
    background: #eef6ff; color: #2563eb; padding: 5px 12px; border-radius: 20px;
    font-family: monospace; font-size: 0.85rem; min-width: 80px; text-align: center; font-weight: 700;
}

/* Resources */
.msbte-resources {
    display: none; grid-template-columns: repeat(3, 1fr); gap: 8px;
    padding: 10px 20px 18px 105px; background: #fbfdff;
}
.msbte-subject.open .msbte-resources { display: grid; }

.msbte-res-link {
    background: #fff; border: 1px solid #cbd5e1; border-radius: 30px;
    padding: 8px 6px; text-align: center; text-decoration: none;
    color: #1e293b; font-weight: 500; font-size: 0.82rem;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    transition: all 0.2s; white-space: nowrap;
}
.msbte-res-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); }
.msbte-res-link i { color: #1e4a7a; }
.msbte-res-link:hover i { color: var(--accent); }

/* PDF Viewer Modal */
.msbte-pdf-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 99999;
}
.msbte-pdf-modal.active { display: flex; flex-direction: column; }
.msbte-pdf-header {
    background: #0a1628; color: #fff; padding: 15px 25px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 3px solid var(--accent);
}
.msbte-pdf-close { background: rgba(220,38,38,0.2); color: #fff; border: none; padding: 10px 20px; border-radius: 40px; cursor: pointer; }
.msbte-pdf-iframe { flex: 1; border: none; }

/* Card Template */
.msbte-card-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.msbte-card {
    background: #fff; border-radius: 16px; padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid #e0e7ef;
}

/* Minimal Template */
.msbte-minimal-list { list-style: none; padding: 0; }
.msbte-minimal-item {
    padding: 12px 20px; background: #fff; margin-bottom: 6px;
    border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 15px;
}

/* Footer */
.msbte-footer { text-align: center; padding: 20px; color: #888; margin-top: 30px; }

/* Responsive */
@media (max-width: 768px) {
    .msbte-resources { grid-template-columns: repeat(2, 1fr); padding-left: 20px; }
    .msbte-header { padding: 20px; }
    .msbte-tab { padding: 10px 16px; font-size: 0.85rem; }
    .msbte-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .msbte-resources { grid-template-columns: repeat(2, 1fr); }
    .msbte-code { min-width: 60px; font-size: 0.75rem; }
    .msbte-tabs { flex-direction: column; }
}