@font-face {
    font-family: 'Jameel';
    src: url('https://usamasarsari.com/fonts/Jameel-Noori-Nastaleeq-Regular.ttf');
}

@font-face {
    font-family: 'AlQalam';
    src: url('https://usamasarsari.com/fonts/al-qalam-web.ttf');
}

:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --card-bg: #ffffff;
    --primary-color: #198754;
    --secondary-color: #d4af37;
    --border-color: #dee2e6;
    --modal-overlay: rgba(0,0,0,0.6);
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --primary-color: #2fb344;
    --secondary-color: #e6c245;
    --border-color: #333333;
    --modal-overlay: rgba(255,255,255,0.1);
}

body {
    font-family: 'Jameel', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    font-size: 20px;
    transition: background-color 0.3s, color 0.3s;
}

#appLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.sidebar-section {
    margin-bottom: 10px;
}

.section-header {
    padding: 10px 15px;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(25, 135, 84, 0.1);
    font-size: 16px;
    border-radius: 5px;
    margin: 0 5px;
    font-family: 'Jameel', Arial, sans-serif;
}

.section-body {
    display: flex;
    flex-direction: column;
    margin-top: 5px;
}

.section-body .menu-btn {
    padding-right: 25px;
    border-bottom: none;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 10px;
}

.sidebar-content:hover::-webkit-scrollbar-thumb {
    background: #adb5bd;
}

.menu-btn.active {
    background-color: rgba(25, 135, 84, 0.1);
    border-right: 4px solid var(--primary-color);
    font-weight: bold;
}

.sidebar-profile {
    padding: 15px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-top: 5px;
}

.sidebar-profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    font-size: 25px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.sidebar-profile-name {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-profile-role {
    margin: 5px 0 0 0;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: bold;
}

.header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 45px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 {
    margin: 0;
    font-size: 18px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    padding: 0;
}

#notifBadge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    padding: 2px 6px;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    right: auto;
    width: 250px;
    height: 100%;
    background: var(--card-bg);
    z-index: 1002;
    transition: left 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 10px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.sidebar-content {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.menu-btn {
    background: none;
    border: none;
    width: 100%;
    padding: 8px 10px;
    color: var(--text-color);
    font-size: 17px;
    font-family: 'Jameel', Arial, sans-serif;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    text-decoration: none;
}

.menu-btn i {
    width: 25px;
    text-align: center;
    font-size: 18px;
}

.menu-btn:hover {
    background-color: var(--border-color);
}

.menu-badge {
    margin-right: auto;
    background: var(--secondary-color);
    color: black;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
}

.sidebar-footer {
    background-color: #dc3545;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 10px;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

input, select, button, textarea {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    font-family: 'Jameel', Arial, sans-serif;
    font-size: 18px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-primary:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
    font-size: 18px;
    padding: 10px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    width: auto;
    font-size: 16px;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #000;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    font-size: 16px;
}

.hidden {
    display: none !important;
}

.flex-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.flex-row input[type="radio"], .flex-row input[type="checkbox"] {
    width: auto;
    transform: scale(1.3);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.book-card {
    border-top: 4px solid var(--primary-color);
    text-align: center;
    transition: transform 0.2s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.book-card i {
    font-size: 30px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.book-card h3 {
    font-size: 20px;
    margin: 5px 0;
    line-height: 1.3;
}

.book-card p.intro-text {
    font-size: 14px;
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 5px 0;
    line-height: 1.4;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: 12px;
    color: white;
}

.bg-success {
    background-color: #28a745;
}

.bg-danger {
    background-color: #dc3545;
}

.certificate-badge {
    background: var(--secondary-color);
    color: black;
    padding: 5px 10px;
    text-align: center;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    margin-top: 5px;
    display: inline-block;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 16px;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: right;
    white-space: nowrap;
}

th {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

th:hover {
    background-color: #146c43;
}

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.custom-modal-overlay.show .custom-modal {
    transform: translateY(0);
}

.custom-modal i.icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.custom-modal h3 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 22px;
}

.custom-modal p {
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.custom-modal-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.custom-modal-btns button {
    margin: 0;
}

.sub-icon {
    color: var(--secondary-color);
}

.alert-icon {
    color: #dc3545;
}

.success-icon {
    color: #28a745;
}

.option-label {
    display: block;
    padding: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 18px;
}

.option-label.correct {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.option-label.wrong {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.teacher-feedback {
    background: #e9ecef;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    color: black;
    border-right: 4px solid var(--primary-color);
    text-align: right;
}

.progress-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    height: 10px;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.4s ease;
}

.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 15px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 4px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
    margin-top: 0;
    white-space: nowrap;
}

.tab-btn.active {
    border-bottom-color: var(--primary-color);
    font-weight: bold;
    color: var(--primary-color);
}

.user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    text-align: center;
    border-top: 4px solid var(--border-color);
    position: relative;
}

.user-card.is-teacher {
    border-top-color: var(--secondary-color);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    color: #6c757d;
    margin-bottom: 10px;
}

.role-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.role-teacher {
    background-color: var(--secondary-color);
    color: black;
}

.role-student {
    background-color: #17a2b8;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.tag {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.search-input {
    padding-left: 35px;
    font-size: 16px;
    padding: 10px;
}

.search-container {
    position: relative;
    margin-bottom: 15px;
}

.search-container i {
    position: absolute;
    left: 10px;
    top: 15px;
    color: #6c757d;
    font-size: 16px;
}

.digital-cert {
    border: 8px solid var(--secondary-color);
    padding: 20px;
    background: #fffcf0;
    text-align: center;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    color: black;
}

.digital-cert::before {
    content: "\f0a3";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    font-size: 100px;
    color: rgba(212, 175, 55, 0.1);
    top: -10px;
    right: -10px;
}

.digital-cert h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 30px;
}

.cert-list-item {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.cert-list-item:hover {
    background: #e9ecef;
}

.accordion-header {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    text-align: right;
    border: none;
    outline: none;
    transition: 0.4s;
    border-radius: 5px;
    font-size: 18px;
    font-family: 'Jameel', Arial, sans-serif;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.accordion-header.active {
    background-color: #146c43;
    border-radius: 5px 5px 0 0;
}

.accordion-content {
    padding: 15px;
    background-color: var(--bg-color);
    display: none;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    line-height: 2;
    white-space: pre-wrap;
    font-size: 20px;
}

.grading-card {
    border-right: 5px solid var(--secondary-color);
}

.coin-text {
    color: #d4af37;
    font-weight: bold;
    font-family: Arial, sans-serif;
    direction: ltr;
    display: inline-block;
}

.wallet-history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    align-items: center;
}

.wallet-history-item.plus {
    background: rgba(25, 135, 84, 0.05);
}

.wallet-history-item.minus {
    background: rgba(220, 53, 69, 0.05);
}

.shelf-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 40px 15px;
    padding: 20px 10px 30px 10px;
    background: #fdfbf7;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.shelf-book {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 10px 4px 4px 10px;
    box-shadow: -4px 0 5px rgba(0,0,0,0.05), 4px 4px 8px rgba(0,0,0,0.15);
    height: 190px;
    padding: 20px 10px 15px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-right: 8px solid #dc3545;
}

.shelf-book::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: -15px;
    right: -15px;
    height: 12px;
    background: linear-gradient(to bottom, #d2a679, #8b5a2b);
    border-radius: 3px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: -1;
}

.shelf-book:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: -4px 0 5px rgba(0,0,0,0.05), 6px 8px 12px rgba(0,0,0,0.2);
    z-index: 2;
}

.shelf-book h3 {
    font-size: 16px;
    margin: 0;
    color: #8b0000;
    line-height: 1.4;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
}

.shelf-book p {
    font-size: 12px;
    margin: 0;
    color: #495057;
    font-weight: bold;
}
