@import url('https://banglawebfonts.pages.dev/css/solaiman-lipi.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Solaiman Lipi', 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

.dashboard-body { display: block; min-height: 100vh; }
.mobile-container { width: 100%; max-width: 440px; margin: 0 auto; padding: 0 14px; }
.hidden { display: none !important; }

/* কার্ড স্টাইল */
.form-card {
    background-color: #ffffff;
    padding: 24px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.brand-header { text-align: center; border-bottom: 1.5px solid #f1f5f9; padding-bottom: 20px; margin-bottom: 24px; }
.logo { width: 70px; margin-bottom: 10px; }
.brand-name { color: #059669; font-size: 1.5rem; font-weight: 700; }
.sub-title { color: #64748b; font-size: 0.85rem; font-weight: 600; }

/* ইনপুট গ্রুপ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.9rem; color: #334155; margin-bottom: 6px; font-weight: 600; }
.form-group input {
    width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid #cbd5e1;
    border-radius: 10px; font-size: 0.95rem; font-family: inherit; background-color: #f8fafc;
}
.form-group input:focus { outline: none; border-color: #059669; background-color: #ffffff; }

/* বাটন */
.btn {
    width: 100%; height: 48px; border: none; border-radius: 10px;
    font-size: 1rem; font-weight: 700; cursor: pointer; display: flex;
    align-items: center; justify-content: center; font-family: inherit;
}
.btn-primary { background-color: #059669; color: #ffffff; }
.btn-primary:active { background-color: #047857; }

/* নেভিগেশন বার */
.navbar { background-color: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); padding: 12px 14px; position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 440px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.nav-brand { display: flex; align-items: center; }
.nav-title { font-size: 1.1rem; font-weight: 700; color: #059669; }
.btn-logout { background-color: #ef4444; color: white; border: none; padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 700; cursor: pointer; font-family: inherit; }

/* টিচার ও স্টুডেন্ট কার্ডের স্পেসিং সংকুচিত করা */
.student-card {
    background-color: #ffffff; 
    border: 1px solid #f1f5f9; 
    border-radius: 10px;
    padding: 8px 10px !important; 
    display: flex; 
    align-items: center; 
    gap: 10px !important; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02); 
    margin-bottom: 8px !important;
}
.student-card-img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; border: 1px solid #cbd5e1; }
.student-card-info { flex-grow: 1; min-width: 0; }
.student-card-name { font-size: 0.9rem; font-weight: 700; color: #1e293b; }
.student-card-meta { font-size: 0.75rem; color: #64748b; }

.badge-count { background: #d1fae5; color: #059669; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: bold; }

/* এপ্রুভাল ইনপুট ও বাটন */
.approval-box { text-align: right; }
.roll-input { width: 70px; height: 35px; border: 1.5px solid #cbd5e1; border-radius: 6px; text-align: center; font-weight: bold; font-family: inherit; margin-bottom: 5px; }
.btn-mini { background: #059669; color: white; border: none; padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: bold; cursor: pointer; }

.list-section-title { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin: 20px 0 12px; }

/* শো পাসওয়ার্ড চেক বক্স ডিজাইন */
.show-password-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #059669;
}

.show-password-container label {
    margin-bottom: 0 !important;
    cursor: pointer;
}

/* টগল সুইচ ডিজাইন */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: pointer;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
    z-index: 1;
    pointer-events: none;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #059669;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.status-text-pending {
    font-size: 11px;
    color: #ef4444;
    font-weight: 700;
    display: block;
    margin-top: 5px;
}

.btn-update {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 6px;
    width: 100%;
}

/* অ্যাকশন বাটন এরিয়া কম্প্যাক্ট করা */
.action-buttons {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px !important;
    min-width: 80px !important; 
}

.btn-approve, .btn-cancel {
    background-color: #059669;
    color: white;
    border: none;
    padding: 5px 10px !important; 
    border-radius: 6px;
    font-size: 11px !important; 
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

.btn-cancel {
    background-color: #ef4444;
}

.btn-approve:active, .btn-cancel:active {
    opacity: 0.7;
}

.exam-roll-display {
    background-color: #2563eb;
    color: white;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

.status-approved {
    color: #2563eb;
    font-weight: bold;
    font-size: 14px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.hidden { display: none !important; }

.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.custom-modal-overlay.active {
    opacity: 1; visibility: visible;
}

.custom-modal-card {
    background: white;
    width: 100%; max-width: 380px;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.active .custom-modal-card {
    transform: scale(1);
}

.modal-icon { font-size: 50px; margin-bottom: 15px; display: block; }
.modal-title { font-size: 1.3rem; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.modal-message { font-size: 0.95rem; color: #64748b; line-height: 1.5; margin-bottom: 25px; }
.modal-buttons { display: flex; gap: 12px; justify-content: center; }
.modal-btn { padding: 12px 24px; border-radius: 12px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.95rem; border: none; transition: 0.2s; flex: 1; }

.btn-confirm { background: #059669; color: white; }
.btn-confirm:hover { background: #047857; }
.btn-cancel { background: #f1f5f9; color: #64748b; }
.btn-cancel:hover { background: #e2e8f0; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

/* ==========================================================================
   কম্পিউটার (ডেস্কটপ) এবং ল্যাপটপ স্ক্রিনের জন্য বিশেষ প্রফেশনাল স্প্লিট-ভিউ
   ========================================================================== */
@media (min-width: 992px) {
    /* নেভিগেশন বার কম্পিউটারে দুই পাশে ছড়াবে */
    .nav-container {
        max-width: 1280px;
        padding: 0 20px;
    }

    /* মূল ড্যাশবোর্ড কন্টেইনার */
    .dashboard-main.mobile-container {
        max-width: 1280px;
        display: flex;
        gap: 24px;
        align-items: flex-start;
        padding: 24px 20px;
    }

    /* লগইন পেজ */
    #loginSection.mobile-container {
        max-width: 440px;
        margin-top: 80px;
    }

    /* বাম পাশের শিক্ষক তালিকা - স্টিকি সাইডবার আকারে থাকবে */
    #teacherListView {
        width: 380px;
        flex-shrink: 0;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 20px;
        height: calc(100vh - 110px);
        display: flex !important;
        flex-direction: column;
        position: sticky;
        top: 90px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }

    /* সাইডবারের ভেতরের গ্রিড সিঙ্গেল লাইনে স্ক্রোলযোগ্য হবে */
    #teacherListView .student-list-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow-y: auto;
        flex-grow: 1;
        padding-right: 6px;
        margin-top: 10px;
    }

    /* সাইডবার স্ক্রোলবার ডিজাইন */
    #teacherListView .student-list-container::-webkit-scrollbar {
        width: 6px;
    }
    #teacherListView .student-list-container::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }
    #teacherListView .student-list-container::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    /* শিক্ষাপ্রতিষ্ঠানের বাম পাশের কার্ডগুলোর উচ্চতা লেখার পরিমাণ অনুযায়ী টাইট করা হলো */
    #teacherListView .student-card {
        height: auto !important; 
        flex-shrink: 0;
    }

    /* ডান পাশের বিবরণী প্যানেল (নতুন ভিউসহ ডাইনামিক ফিল্টারিং) */
    #studentDetailView:not(.hidden),
    #homeView:not(.hidden) {
        flex-grow: 1;
        display: block !important;
        background: transparent;
        min-width: 0;
    }

    /* স্টুডেন্ট কার্ড গ্রিড - এক লাইনে ৩টি কার্ড */
    #studentListContainer,
    #homeStudentListContainer {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    /* স্টুডেন্ট কার্ডের প্যাডিং আরও ছোট ও কম্প্যাক্ট করা হলো */
    #studentListContainer .student-card,
    #homeStudentListContainer .student-card {
        margin-bottom: 0 !important;
        height: auto !important; 
        padding: 10px !important; 
        align-items: center;
    }

    /* ছবির সাইজ আরও ছোট ও মানানসই করা হলো */
    .student-card img {
        width: 44px !important;
        height: 44px !important;
        border-radius: 6px !important;
    }

    /* লেখার সাইজ অনুযায়ী টাইট ফিটিং */
    .student-card h4 {
        font-size: 13px !important; 
        line-height: 1.2 !important;
    }

    .student-card p {
        font-size: 11px !important;
        margin: 1px 0 !important;
    }

    /* এক্সাম রুলের টেক্সট ও এর নীল কালারের বক্সের সাইজ ছোট করা হলো */
    .student-card-info div[style*="background:#2563eb"],
    .student-card-info div[style*="background: rgb(37, 99, 235)"],
    .student-card-info div[style*="background:rgb(37, 99, 235)"] {
        font-size: 11px !important; 
        padding: 3px 6px !important; 
        margin: 2px 0 !important;
        width: auto !important; 
        display: inline-block !important; 
        text-align: center !important;
        border-radius: 4px !important;
    }

    /* কার্ডের ভেতরের বাটনগুলো সংকুচিত করা হলো */
    .student-card button {
        padding: 4px 6px !important; 
        font-size: 10px !important; 
        margin-top: 4px !important;
        height: auto !important;
        line-height: 1.2 !important;
    }

    /* ডানের অ্যাকশন বাটন এরিয়া */
    .student-card .action-buttons {
        min-width: 85px !important; 
        gap: 4px !important;
    }

    .student-card .action-buttons button {
        padding: 5px 6px !important; 
        font-size: 10.5px !important; 
        height: auto !important;
        line-height: 1.2 !important;
    }

    /* কম্পিউটারে মাউস নিলে কার্ডের ডিজাইন ইন্টারেক্টিভ হবে */
    .student-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }

    .student-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
        border-color: #cbd5e1 !important;
    }

    /* কম্পিউটারে ব্যাক বাটন হাইড থাকবে */
    #navBackBtn {
        display: none !important;
    }

    /* শ্রেণি ফিল্টার বার কম্পিউটারের সেন্টারে সুন্দর সাইজে থাকবে */
    .filter-wrapper {
        max-width: 100% !important;
        margin-bottom: 20px !important;
    }
}