/**
 * Responsive & Print Styles for EDMS Khmer
 */

/* Mobile Drawer Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Tablet & Desktop Large */
@media (min-width: 992px) {
    .app-container.sidebar-collapsed .app-sidebar {
        width: var(--sidebar-collapsed-width);
    }

    .app-container.sidebar-collapsed .app-sidebar .brand-info,
    .app-container.sidebar-collapsed .app-sidebar .nav-label,
    .app-container.sidebar-collapsed .app-sidebar .nav-link span,
    .app-container.sidebar-collapsed .app-sidebar .nav-badge,
    .app-container.sidebar-collapsed .app-sidebar .user-mini-info {
        display: none;
    }

    .app-container.sidebar-collapsed .app-sidebar .nav-link {
        justify-content: center;
        padding: 0.85rem 0;
    }

    .app-container.sidebar-collapsed .app-sidebar .nav-link i {
        font-size: 1.35rem;
    }

    .app-container.sidebar-collapsed .app-main {
        margin-left: var(--sidebar-collapsed-width);
    }
}

/* Tablet & Mobile Devices (< 992px) */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .app-main {
        margin-left: 0 !important;
        width: 100%;
    }

    .page-content {
        padding: 1.15rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.85rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.85rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .notif-menu {
        width: 300px;
        right: -50px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: 100%;
    }
}

/* Small Mobile (< 576px) */
@media (max-width: 575.98px) {
    .app-topbar {
        padding: 0 1rem;
    }

    .user-top-name {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .notif-menu {
        width: 280px;
        right: -80px;
    }

    .modal-backdrop {
        padding: 0.75rem;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Print Stylesheet for Reports & Official Khmer PDF/Paper Export */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    .app-sidebar,
    .app-topbar,
    .btn,
    .filter-bar,
    .modal-backdrop,
    .page-actions,
    .action-buttons,
    .pagination {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    .data-table {
        width: 100% !important;
        border: 1px solid #000 !important;
        font-size: 10pt;
    }

    .data-table th, .data-table td {
        border: 1px solid #000 !important;
        padding: 6px 8px !important;
        color: #000 !important;
    }

    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 25px;
    }

    .print-kingdom {
        font-family: 'Battambang', serif;
        font-weight: 700;
        font-size: 14pt;
        line-height: 1.5;
    }

    .print-moto {
        font-family: 'Battambang', serif;
        font-size: 12pt;
        margin-bottom: 10px;
    }

    .print-office {
        text-align: left;
        font-size: 11pt;
        font-weight: bold;
        margin-bottom: 15px;
    }

    .print-title {
        font-family: 'Battambang', serif;
        font-size: 15pt;
        font-weight: bold;
        margin-top: 15px;
        margin-bottom: 15px;
    }

    .print-signatures {
        display: flex !important;
        justify-content: space-between;
        margin-top: 40px;
        page-break-inside: avoid;
    }

    .print-sign-col {
        text-align: center;
        width: 250px;
        font-family: 'Battambang', serif;
    }
}
