/**
 * E-School Panel — Panel Page Styles (login uses inline)
 * This file is loaded on /admin-panel/* pages
 */

/* ── Hide ALL theme/plugin elements that leak into panel ── */
/* Common scroll-to-top selectors from popular plugins */
#backToTop, .back-to-top, .scroll-to-top, .scrollToTop,
#scroll-to-top, .go-to-top, .to-top, #to-top,
.scrollTop, .scroll-top, #scrollTop, a.scroll-top,
.wpstt-scroll-to-top, .heateor_sc_scroll, #heateor_sc_scroll,
.ct-back-to-top, .fl-scroll-top, .wp-return-to-top,
.page-scroll-to-top, .jetpack-scroll-to-top,
.upb_back_btn, .a3-scroll-to-top, #a3-scroll-to-top,
.et-pb-to-top, .to-top-wrapper, .totop, #totop,
.scroll-up, .scrollup, #scrollUp,
/* Admin bar, theme chrome */
#wpadminbar, .site-header, .site-footer, .top-bar, .mobile-menu-bar,
/* Dark mode toggles */
.dark-mode-toggle, [data-dark-mode-toggle], .darkmode-toggle,
/* Common floating buttons from plugins */
.floating-button, .float-button, .sticky-button,
.wp-floating-button, .ht-ctc, .ht-ctc-chat,
/* WP chat widgets */
.wpcf7-form, .ninja-forms-cont, .nf-form-cont,
/* GDPR/cookie banners */
.moove-gdpr-info-bar, .cky-consent-bar, .cc-window,
/* Social share floating bars */
.heateor_sss_floating, .ssba_share_icons,
/* Custom logo, site content */
.custom-logo-link, .site-content, #content, #page,
/* Catch-all: hide everything outside .esp-app */
#page > :not(.esp-app), body > :not(.esp-app):not(.esp-login-card):not(script):not(style):not(link) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}
/* Ensure esp-app is visible */
.esp-app { display: flex !important; visibility: visible !important; }

/* ── Mobile Bottom Navigation ── */
@media (max-width: 768px) {
    .esp-sidebar {
        transform: translateX(-100%);
        width: 280px;
        max-width: 85vw;
        z-index: 100;
        -webkit-overflow-scrolling: touch;
    }
    .esp-sidebar.open {
        transform: translateX(0);
    }
    .esp-sidebar-close { display: block; }
    .esp-topbar-toggle { display: block; }
    .esp-main { margin-left: 0; padding-bottom: 300px; } /* Space for bottom nav + mobile scroll safety */

    /* Stats grid — 2 col on mobile */
    .esp-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .esp-stat-card { padding: 12px; }
    .esp-stat-icon { font-size: 24px; }
    .esp-stat-num { font-size: 20px; }

    /* Dashboard row — single col */
    .esp-dashboard-row { grid-template-columns: 1fr; }

    /* Form — single col */
    .esp-form-row { grid-template-columns: 1fr; }

    /* Table — horizontal scroll with indicator */
    .esp-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    .esp-table-wrap::after {
        content: '← স্ক্রল →';
        position: sticky;
        right: 0;
        top: 0;
        background: rgba(26,35,126,0.9);
        color: #fff;
        padding: 4px 10px;
        font-size: 11px;
        border-radius: 4px 0 0 4px;
        pointer-events: none;
        opacity: 0.7;
    }
    .esp-table { min-width: 500px; }

    /* Touch-friendly buttons */
    .esp-btn { padding: 11px 22px; font-size: 15px; min-height: 44px; }
    .esp-btn-sm { padding: 8px 16px; font-size: 13px; min-height: 36px; }
    .esp-qa-btn { padding: 10px 18px; font-size: 14px; }

    /* Better input sizing for touch */
    .esp-input, .esp-select, .esp-textarea {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom */
        min-height: 44px;
    }

    /* Modal — full screen on mobile */
    .esp-modal-content {
        max-width: 100%;
        border-radius: 0;
        padding: 20px;
        max-height: 100vh;
    }
    .esp-modal { padding: 0; }

    /* Quick actions — wrap nicely */
    .esp-quick-actions { gap: 10px; }
    .esp-qa-btn { flex: 1; min-width: 120px; justify-content: center; text-align: center; }
    /* দ্রুত কার্য — ডেস্কটপ only, মোবাইলে হাইড + padding */
    .esp-quick-actions-heading,
    .esp-quick-actions { display: none !important; }
    .esp-quick-actions-spacer-mobile { display: block; height: 20px; }
    .esp-dashboard-col-applications { padding-bottom: 200px; }

    /* Filter row — wrap */
    .esp-filter-row { flex-wrap: wrap; }
    .esp-filter-select { max-width: 100%; flex: 1; min-width: 140px; }
}

/* ── Bottom Navigation Bar (Mobile) ── */
@media (max-width: 768px) {
    .esp-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 56px;
        z-index: 150;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    }
    .esp-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 3px 0;
        font-size: 10px;
        color: #777;
        text-decoration: none;
        flex: 1;
        min-width: 0;
        transition: color 0.15s;
    }
    .esp-bottom-nav-item.active {
        color: #1a237e;
        font-weight: 600;
    }
    .esp-bottom-nav-icon {
        font-size: 18px;
        margin-bottom: 1px;
    }
}
@media (min-width: 769px) {
    .esp-bottom-nav { display: none; }
}

/* ── Multi-Select Checkbox (Subjects) ────────────────────────── */
.esp-multi-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    max-height: 180px;
    overflow-y: auto;
}
.esp-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
    user-select: none;
}
.esp-checkbox-item:hover {
    border-color: #1a73e8;
    background: #eff6ff;
}
.esp-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1a73e8;
    cursor: pointer;
    flex-shrink: 0;
}
.esp-checkbox-item input[type="checkbox"]:checked + span {
    color: #1a73e8;
    font-weight: 600;
}
.esp-teacher-subjects-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.esp-teacher-subject-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #eff6ff;
    color: #1a73e8;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* ── Drag-and-Drop Sortable (Teachers) ─────────────────────────── */
.esp-drag-col {
    width: 36px;
    text-align: center;
    padding: 0 !important;
    user-select: none;
}
.esp-drag-handle {
    cursor: grab;
    color: #9ca3af;
    font-size: 18px;
    text-align: center;
    padding: 8px 4px !important;
    user-select: none;
    transition: color 0.15s;
    width: 36px;
    vertical-align: middle;
    /* Mobile: stop the browser's own scroll/pan gesture from fighting the
       tap-hold-drag gesture (needed for touch-punch to work smoothly) */
    touch-action: none;
    -ms-touch-action: none;
}
/* Bigger, easier-to-hit tap target on touch screens */
@media (max-width: 720px) {
    .esp-drag-handle {
        font-size: 22px;
        padding: 14px 8px !important;
        width: 44px;
    }
}
.esp-drag-handle:hover {
    color: #1a73e8;
}
.esp-drag-handle:active {
    cursor: grabbing;
    color: #1557b0;
}
/* Row while being dragged */
#esp-teacher-table tbody tr.ui-sortable-helper {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border-radius: 6px;
    z-index: 100;
}
/* Placeholder (drop target) */
#esp-teacher-table tbody tr.esp-sortable-placeholder td {
    background: #eff6ff;
    border: 2px dashed #1a73e8;
    border-radius: 4px;
}
/* Subtle row hover to hint drag-ability */
#esp-teacher-table tbody tr:hover .esp-drag-handle {
    color: #6b7280;
}

/* ── File Upload Preview ──────────────────────────────────────── */
.esp-upload-preview {
    margin-top: 4px;
}
.esp-upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}
