/* Example for multi-select container */
body[data-bs-theme="dark"] .multi-select-container {
    background-color: black;
    color: white;
    border: 1px solid #555;
}

body[data-bs-theme="dark"] .dropdown {
    background-color: #333;
    color: white;
}

body[data-bs-theme="dark"] .dropdown div:hover {
    background-color: #555;
}

@media (max-width: 768px) {
    .modal-side-right .modal-dialog {
        width: 100% !important; /* Full width on smaller screens */
    }
}

/* Make input responsive */
@media (max-width: 770px) {
    #searchInput6 {
        width: 300px !important; /* Adjusts to 300px for small screens */
    }

    /* Hide datalist */
    #left-side-panel-col {
        display: none !important;
    }
}

@media (min-width: 770px) and (max-width: 1450px) {
    #searchInput6 {
        width: 100% !important; /* Adjusts to container width */
    }
}


/* Responsive Design for pdf iframe */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }

    .pdf-display iframe {
        height: 60vh;
    }
}

@media (max-width: 600px) {
    .pdf-display iframe {
        height: 50vh;
    }

    button {
        padding: 10px;
        font-size: 14px;
    }
}

/* Site-wide styles */

/* PWA-specific styles */
@media (display-mode: standalone) {
    /* Styles when app is installed and running as PWA */
    body {
        user-select: none; /* Prevent text selection for app-like feel */
        -webkit-touch-callout: none; /* Disable callout on iOS */
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    /* Allow text selection in specific areas */
    input, textarea, [contenteditable="true"], .selectable {
        user-select: text;
        -webkit-user-select: text;
        -khtml-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
    }
    
    /* Hide elements that are not needed in PWA mode */
    .browser-only {
        display: none !important;
    }
    
    /* Adjust spacing for PWA mode */
    .main-content {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
       
    .btn-sm {
        min-height: 38px;
        padding: 8px 12px;
    }
    
    
    /* Improve table scrolling on mobile */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better spacing for mobile */
   /* .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }*/
    
    /* Improve modal experience on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* iOS PWA specific styles */
@supports (-webkit-touch-callout: none) {
    .ios-pwa-adjustments {
        /* Status bar spacing for iOS PWA */
        padding-top: env(safe-area-inset-top);
    }
    
    /* Fix for iOS PWA bottom spacing */
    .main-wrapper {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Android PWA specific styles */
@media (display-mode: standalone) and (orientation: portrait) {
    /* Android PWA adjustments */
    .android-pwa-header {
        padding-top: env(safe-area-inset-top, 20px);
    }
}

/* Offline indicator styles */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f39c12;
    color: white;
    text-align: center;
    padding: 8px;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.offline-indicator.show {
    transform: translateY(0);
}

.offline-indicator.online {
    background: #27ae60;
}

/* Loading animation for PWA */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 30, 46, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pwa-loading.show {
    opacity: 1;
    visibility: visible;
}

.pwa-loading-content {
    text-align: center;
    color: white;
}

.pwa-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Install prompt styles */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.pwa-install-text h6 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.pwa-install-text p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.pwa-install-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.pwa-install-actions .btn {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.pwa-install-actions .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.pwa-install-actions .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments for install banner */
@media (max-width: 576px) {
    .pwa-install-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .pwa-install-actions {
        margin-left: 0;
        justify-content: center;
    }
}

/* Dark mode adjustments for PWA */
[data-bs-theme="dark"] .offline-indicator {
    background: #e67e22;
}

[data-bs-theme="dark"] .offline-indicator.online {
    background: #2ecc71;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pwa-install-banner {
        background: #000;
        border-top: 2px solid #fff;
    }
    
    .offline-indicator {
        border-bottom: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pwa-loading-spinner {
        animation: none;
    }
    
    .pwa-install-banner,
    .offline-indicator {
        transition: none;
    }
}

/* Print styles - hide PWA elements when printing */
@media print {
    .pwa-install-banner,
    .offline-indicator,
    .pwa-loading,
    #pwa-install-btn {
        display: none !important;
    }
}

/* Login page theme toggle button styles */
.app-blank .position-fixed {
    /* Enhanced styling for login page theme toggle */
}

.app-blank .btn-active-light-primary {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.app-blank .btn-active-light-primary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Theme-specific adjustments for login page toggle */
[data-bs-theme="dark"] .app-blank .btn-active-light-primary {
    background-color: rgba(0, 0, 0, 0.1);
    /*border: 1px solid rgba(255, 255, 255, 0.1);*/
    color: rgba(255, 255, 255, 0.8);
}

[data-bs-theme="dark"] .app-blank .btn-active-light-primary:hover {
    background-color: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 1);
}

/* Mobile adjustments for login theme toggle */
@media (max-width: 768px) {
    .app-blank .position-fixed.top-0.end-0 {
        top: 10px !important;
        right: 10px !important;
        padding: 0.5rem !important;
    }
    
    .app-blank .btn-sm {
        padding: 6px 10px;
        min-height: 36px;
    }
}

#datatable {
    margin-top: 5px !important;
    border: #393434;
    border-bottom: 1px solid #393434;
    border-top: 1px solid #393434;
}

div.dt-container div.dt-search input {
    margin-left: 0.5em;
    display: inline-block;
    width: auto;
    margin-bottom: 10px !important;
}

@media (max-width: 991.98px) {
    .app-wrapper {
        padding: 5px !important;
    }
}