/* ================================================================
   FILE: assets/css/theme/theme-config.css
   PURPOSE: Responsive Breakpoints & Desktop Shell Configuration (100% Preserved)
   ================================================================ */

/* Desktop Default (Large Screens) */
@media (min-width: 1024px) {
    .sidebar {
        left: 0;
        position: relative;
        z-index: 1;
        height: 100vh;
        max-height: 100vh;
    }
    .sidebar-overlay {
        display: none !important;
    }
    .sidebar-close-btn {
        display: none;
    }
    .menu-toggle-btn {
        display: none;
    }
    .mobile-close-btn {
        display: none;
    }
}

/* Tablet Overrides & Sidebar Toggle (< 1024px) */
@media (max-width: 1023px) {
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    .app-container {
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        display: block !important;
    }

    .layout-body {
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow-x: hidden !important;
    }

    .main-content {
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .sidebar-menu {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
        padding-bottom: max(2rem, env(safe-area-inset-bottom, 24px)) !important;
    }

    .menu-item-logout {
        margin-top: auto !important;
        flex-shrink: 0 !important;
    }

    .sidebar-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    .mobile-close-btn {
        display: block !important;
    }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
    .main-content {
        padding: 1.25rem 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .card {
        padding: 1.25rem 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .cards-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    .file-card {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .top-navbar {
        margin-bottom: 1.25rem !important;
        width: 100% !important;
    }

    .search-bar-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .search-bar-form {
        width: 100% !important;
        max-width: 100% !important;
    }

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

    .page-header > div:last-child {
        width: 100%;
        flex-direction: column;
    }

    .page-header input {
        width: 100% !important;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
    }
}

/* Small Handhelds (<= 500px) */
@media (max-width: 500px) {
    .profile-badge .badge-name {
        display: none;
    }
    .profile-badge {
        padding: 4px;
    }
    .page-title {
        font-size: 1.25rem;
    }
    .main-content {
        padding: 0.85rem 0.65rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .card {
        padding: 1rem 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .top-navbar {
        margin-bottom: 1rem !important;
        width: 100% !important;
    }
    .cards-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    .file-card {
        padding: 1rem 0.85rem;
        width: 100% !important;
        max-width: 100% !important;
    }
    .file-card-title {
        font-size: 1rem;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }
    .file-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        width: 100% !important;
    }
    .action-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
        min-width: 60px;
    }
    .search-btn span {
        display: none;
    }
}
