/* Custom CSS to enhance Tailwind - Add to excel-data-display.css */

/* Ensure Tailwind doesn't break existing admin styles */
.excel-data-display-admin .wp-admin * {
    box-sizing: content-box;
}

/* Enhance popup styles with Tailwind-like design */
.ui-dialog {
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border: none !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.ui-dialog .ui-dialog-titlebar {
    background: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-radius: 0.5rem 0.5rem 0 0 !important;
    padding: 1rem 1.5rem !important;
}

.ui-dialog .ui-dialog-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
}

.ui-dialog .ui-dialog-titlebar-close {
    background: transparent !important;
    border: none !important;
    color: #6b7280 !important;
}

.ui-dialog .ui-dialog-content {
    padding: 1.5rem !important;
}

.ui-dialog .ui-dialog-buttonpane {
    margin-top: 0 !important;
    padding: 1rem 1.5rem !important;
    border-top: 1px solid #e5e7eb !important;
    background: #f9fafb !important;
}

/* Autocomplete styling */
.ui-autocomplete {
    max-height: 300px !important;
    overflow-y: auto !important;
    border-radius: 0 0 0.375rem 0.375rem !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    padding: 0.25rem 0 !important;
    background-color: white !important;
}

.ui-autocomplete .ui-menu-item {
    padding: 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.ui-autocomplete .ui-menu-item:last-child {
    border-bottom: none !important;
}

.ui-autocomplete .ui-menu-item-wrapper {
    padding: 0.75rem 1rem !important;
    color: #4b5563 !important;
    font-size: 0.875rem !important;
}

.ui-autocomplete .ui-menu-item-wrapper.ui-state-active {
    background-color: #f3f4f6 !important;
    border: none !important;
    color: #1f2937 !important;
    margin: 0 !important;
}

/* Custom responsive classes to supplement Tailwind */
@media (max-width: 768px) {
    .excel-data-modern-controls {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .excel-data-search-wrapper {
        flex-direction: column !important;
    }
    
    .excel-data-filter-item {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .excel-data-display-table th,
    .excel-data-display-table td {
        white-space: normal !important;
    }
    
    /* Mobile table view */
    .excel-data-display-table thead {
        display: none !important;
    }
    
    .excel-data-display-table tbody tr {
        display: block !important;
        margin-bottom: 1rem !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 0.375rem !important;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    }
    
    .excel-data-display-table tbody td {
        display: block !important;
        text-align: right !important;
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #f3f4f6 !important;
    }
    
    .excel-data-display-table tbody td:last-child {
        border-bottom: none !important;
    }
    
    .excel-data-display-table tbody td:before {
        content: attr(data-label) !important;
        float: left !important;
        font-weight: 600 !important;
        color: #4b5563 !important;
    }
    
    .excel-data-display-table tbody td[data-label="Detail"] {
        text-align: center !important;
    }
    
    .excel-data-display-pagination {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .excel-data-display-info {
        text-align: center !important;
        margin-bottom: 1rem !important;
    }
}

/* Fixed position headers for long tables */
.excel-data-responsive-table {
    position: relative !important;
}

@media (min-width: 769px) {
    .excel-data-display-table thead th {
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
        background-color: #f9fafb !important;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    }
}

/* Print styles for better printing */
@media print {
    .excel-data-modern-controls,
    .excel-data-display-pagination,
    .excel-data-display-detail-btn {
        display: none !important;
    }
    
    .excel-data-display-container {
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .excel-data-display-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    .excel-data-display-table th,
    .excel-data-display-table td {
        border: 1px solid #e5e7eb !important;
        padding: 0.5rem !important;
    }
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5) !important;
    outline-offset: 2px !important;
}

/* Custom scrollbar for better UX */
.excel-data-responsive-table::-webkit-scrollbar {
    height: 8px !important;
    width: 8px !important;
}

.excel-data-responsive-table::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px !important;
}

.excel-data-responsive-table::-webkit-scrollbar-thumb {
    background: #d1d5db !important;
    border-radius: 4px !important;
}

.excel-data-responsive-table::-webkit-scrollbar-thumb:hover {
    background: #9ca3af !important;
}

/* Loading indicator style */
.excel-data-loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2rem !important;
}

.excel-data-loading-spinner {
    border: 3px solid #f3f3f3 !important;
    border-top: 3px solid #3498db !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    animation: spin 1s linear infinite !important;
    margin-right: 0.5rem !important;
}

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