/**
 * LABINDUS - Custom CSS Overrides
 * 
 * This file contains custom styles that override the default theme
 * and library styles. Keep this file organized and well-commented.
 */

/* ============================================
   GLOBAL PLACEHOLDER FIX - DEFINITIVE SOLUTION
   ============================================ */

/* Override the aggressive global placeholder style from style.min.css line 36053
   Original: ::placeholder { color: #a1aab2 !important; opacity: 0.2; }
   This makes ALL placeholders barely visible (20% opacity)
   We're changing it to be more visible by default */

::placeholder {
    color: #6c757d !important;
    opacity: 0.8 !important;
}

::-webkit-input-placeholder {
    color: #6c757d !important;
    opacity: 0.8 !important;
}

::-moz-placeholder {
    color: #6c757d !important;
    opacity: 0.8 !important;
}

:-ms-input-placeholder {
    color: #6c757d !important;
    opacity: 0.8 !important;
}

:-moz-placeholder {
    color: #6c757d !important;
    opacity: 0.8 !important;
}

/* ============================================
   SELECT2 FILTER CUSTOMIZATION
   ============================================ */

/* Adjust Select2 container height */
.select2-container {
    height: 38px !important;
}

.select2-selection {
    height: 38px !important;
    padding: 5px 10px !important;
}

/* Single select styling */
.select2-container--default .select2-selection--single {
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
    color: #4f5467 !important;
}

/* Multiple select styling - COMPACT with vertical centering */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
    min-height: 38px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0px 5px !important;
}

/* Ensure the rendered selection area is centered */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Selected items (pills) styling - COMPACT and vertically centered */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #4798e8 !important;
    border: 1px solid #3587d8 !important;
    border-radius: 2px !important;
    color: #fff !important;
    padding: 0px 5px !important;
    margin: 3px 3px 3px 0 !important;
    font-size: 12px !important;
    line-height: 22px !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Remove button on selected items - COMPACT and vertically centered */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 3px !important;
    font-size: 14px !important;
    line-height: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #f8f9fa !important;
}

/* Dropdown styling */
.select2-dropdown {
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Search field in dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #e9ecef !important;
    border-radius: 3px !important;
    padding: 6px 10px !important;
}

/* Dropdown options */
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #e9ecef !important;
    color: #4798e8 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #4798e8 !important;
    color: #fff !important;
}

/* Focus state */
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #4798e8 !important;
}

/* Clear button (X) on the right - vertically centered */
.select2-container--default .select2-selection--multiple .select2-selection__clear {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 5px !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

/* ============================================
   SELECT2 SPECIFIC PLACEHOLDER STYLING
   ============================================ */

/* NUCLEAR OPTION: Target ALL input fields inside Select2 containers */
.select2-container input,
.select2-container input.select2-search__field,
.select2-container .select2-search--inline .select2-search__field,
.select2-container .select2-selection--multiple .select2-search__field,
.select2-search__field {
    color: #000 !important;
}

/* FIX: Force the search field to have a minimum width so placeholder is visible */
.select2-container .select2-search--inline .select2-search__field {
    min-width: 200px !important;
    width: auto !important;
    line-height: 24px !important;
    vertical-align: middle !important;
    padding: 0 !important;
    margin: 3px 0 !important;
    height: 24px !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    min-width: 200px !important;
    width: auto !important;
    line-height: 24px !important;
    vertical-align: middle !important;
    padding: 0 !important;
    margin: 3px 0 !important;
    height: 24px !important;
}

/* ALL placeholder pseudo-elements for Select2 inputs */
.select2-container input::placeholder,
.select2-container input::-webkit-input-placeholder,
.select2-container input::-moz-placeholder,
.select2-container input:-ms-input-placeholder,
.select2-container input:-moz-placeholder,
.select2-search__field::placeholder,
.select2-search__field::-webkit-input-placeholder,
.select2-search__field::-moz-placeholder,
.select2-search__field:-ms-input-placeholder,
.select2-search__field:-moz-placeholder,
input.select2-search__field::placeholder,
input.select2-search__field::-webkit-input-placeholder,
input.select2-search__field::-moz-placeholder,
input.select2-search__field:-ms-input-placeholder,
input.select2-search__field:-moz-placeholder {
    color: rgba(0, 0, 0, 0.6) !important;
    opacity: 0.6 !important;
    line-height: 28px !important;
}

/* More specific targeting for the filter placeholders */
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field::placeholder,
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field::-webkit-input-placeholder,
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field::-moz-placeholder,
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field:-ms-input-placeholder,
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field:-moz-placeholder {
    color: rgba(0, 0, 0, 0.6) !important;
    opacity: 1 !important;
}

/* ULTRA SPECIFIC - Target the exact placeholder with attribute selector */
input.select2-search__field[placeholder]::placeholder,
input.select2-search__field[placeholder]::-webkit-input-placeholder,
input.select2-search__field[placeholder]::-moz-placeholder,
input.select2-search__field[placeholder]:-ms-input-placeholder,
input.select2-search__field[placeholder]:-moz-placeholder {
    color: rgba(0, 0, 0, 0.6) !important;
    opacity: 1 !important;
}

/* Even more specific with the container */
.select2-container--default .select2-selection--multiple input.select2-search__field[placeholder]::placeholder,
.select2-container--default .select2-selection--multiple input.select2-search__field[placeholder]::-webkit-input-placeholder {
    color: rgba(0, 0, 0, 0.6) !important;
    opacity: 1 !important;
}

/* Select2 placeholder spans */
.select2-container--default .select2-selection--single .select2-selection__placeholder,
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #000 !important;
    opacity: 1 !important;
}

/* ============================================
   DATATABLE CUSTOMIZATION
   ============================================ */

/* Align all DataTable headers to the left */
table.dataTable thead th,
table.dataTable thead td {
    text-align: left !important;
}

/* Ensure proper column alignment */
.dt_code {
    width: 80px !important;
    text-align: left !important;
}

.dt_date {
    width: 120px !important;
    text-align: left !important;
}

.dt_amount {
    width: 120px !important;
    text-align: left !important;
}

.dt_status {
    width: 1% !important;
    text-align: left !important;
    white-space: nowrap !important;
}

/* ============================================
   FORM CUSTOMIZATION
   ============================================ */

/* Custom select dropdown styling */
.custom-select {
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
    padding: 6px 12px !important;
    height: 38px !important;
}

.custom-select:focus {
    border-color: #4798e8 !important;
    box-shadow: 0 0 0 0.2rem rgba(71, 152, 232, 0.25) !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Add spacing utilities if needed */
.mb-15 {
    margin-bottom: 15px !important;
}

.mt-15 {
    margin-top: 15px !important;
}

/* ============================================
   FILTER CARD HEADER - CLICKABLE
   ============================================ */

/* Make the entire filter header clickable */
#headingFilters {
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    transition: background-color 0.2s ease !important;
}

/* Hover effect on header */
#headingFilters:hover {
    background-color: #1fa67a !important;
    opacity: 0.95 !important;
}

/* Make the h5 inside take full width */
#headingFilters h5 {
    cursor: pointer !important;
    margin: 0 !important;
}

/* ============================================
   SIDEBAR LOGO - SHOW ONLY ICON WHEN COLLAPSED
   ============================================ */

/* Default state (sidebar expanded): Show full logo, hide icon */
.navbar-header .navbar-brand .logo-icon {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.navbar-header .navbar-brand .logo-text {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.navbar-header .navbar-brand .logo-text img {
    max-height: 50px !important;
    width: auto !important;
}

/* When sidebar is collapsed: Show only icon, hide full logo */
body[data-sidebartype="mini-sidebar"] .navbar-header .navbar-brand .logo-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 45px !important;
    text-align: center !important;
    margin: 0 auto !important;
}

body[data-sidebartype="mini-sidebar"] .navbar-header .navbar-brand .logo-icon img {
    max-width: 40px !important;
    max-height: 40px !important;
    height: auto !important;
    width: auto !important;
}

body[data-sidebartype="mini-sidebar"] .navbar-header .navbar-brand .logo-text {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Center the logo in collapsed state */
body[data-sidebartype="mini-sidebar"] .navbar-header .navbar-brand {
    justify-content: center !important;
    display: flex !important;
    padding: 0 !important;
}

/* Adjust navbar header width when collapsed */
body[data-sidebartype="mini-sidebar"] .navbar-header {
    width: 60px !important;
    min-width: 60px !important;
}

/* Also target the mini-sidebar class directly (fallback) */
.mini-sidebar .navbar-header .navbar-brand .logo-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mini-sidebar .navbar-header .navbar-brand .logo-text {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */

/* Notification badge on bell icon */
.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px !important;
    font-size: 10px !important;
    font-weight: bold !important;
    border-radius: 10px !important;
    min-width: 18px !important;
    text-align: center !important;
}

/* Notification dropdown */
#notification-dropdown .dropdown-menu {
    padding: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* Notification list container */
.notifications-scroll {
    position: relative;
}

.notifications-scroll::-webkit-scrollbar {
    width: 6px;
}

.notifications-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notifications-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.notifications-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Individual notification item */
.message-item {
    display: flex !important;
    padding: 15px !important;
    border-bottom: 1px solid #e9ecef !important;
    transition: background-color 0.2s ease !important;
    cursor: pointer !important;
}

.message-item:hover {
    background-color: #f8f9fa !important;
}

.message-item:last-child {
    border-bottom: none !important;
}

/* Unread notification highlight */
.message-item.bg-light {
    background-color: #e3f2fd !important;
}

.message-item.bg-light:hover {
    background-color: #bbdefb !important;
}

/* Notification icon circle */
.message-item .btn-circle {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin-right: 15px !important;
}

.message-item .btn-circle i {
    font-size: 20px !important;
}

/* Notification content */
.message-item .mail-contnet {
    flex: 1 !important;
    min-width: 0 !important;
}

.message-item .message-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
    color: #263238 !important;
}

.message-item .mail-desc {
    font-size: 13px !important;
    color: #67757c !important;
    display: block !important;
    margin-bottom: 5px !important;
    line-height: 1.4 !important;
}

.message-item .time {
    font-size: 11px !important;
    color: #99abb4 !important;
    display: block !important;
    margin-top: 5px !important;
}

/* Action button in notification */
.message-item .btn-sm {
    font-size: 11px !important;
    padding: 4px 10px !important;
    margin-top: 8px !important;
}

/* Notification type colors */
.btn-info {
    background-color: #1e88e5 !important;
    border-color: #1e88e5 !important;
}

.btn-success {
    background-color: #26c6da !important;
    border-color: #26c6da !important;
}

.btn-warning {
    background-color: #ffb22b !important;
    border-color: #ffb22b !important;
}

.btn-error,
.btn-danger {
    background-color: #fc4b6c !important;
    border-color: #fc4b6c !important;
}

/* Mark all as read button */
#mark-all-read {
    font-size: 18px !important;
    padding: 5px !important;
    transition: opacity 0.2s ease !important;
}

#mark-all-read:hover {
    opacity: 0.8 !important;
}

/* Load more link */
#load-more-notifications {
    display: block !important;
    padding: 12px !important;
    text-align: center !important;
    border-top: 1px solid #e9ecef !important;
    color: #1e88e5 !important;
    transition: background-color 0.2s ease !important;
}

#load-more-notifications:hover {
    background-color: #f8f9fa !important;
    text-decoration: none !important;
}

/* Empty state */
.notifications-scroll .text-center {
    color: #99abb4 !important;
}

/* Loading spinner */
.mdi-loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .select2-container {
        height: 36px !important;
    }
    
    .select2-selection {
        height: 36px !important;
    }
    
    /* Notification dropdown on mobile */
    #notification-dropdown .dropdown-menu {
        width: 320px !important;
        right: -20px !important;
    }
    
    .message-item {
        padding: 12px !important;
    }
    
    .message-item .btn-circle {
        width: 35px !important;
        height: 35px !important;
        margin-right: 10px !important;
    }
}

