/**
 * Professional UI Enhancement Styles
 * Modern, clean, and professional design system
 */

:root {
    /* Professional Color Palette */
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
}

/* Professional Filter Card */
.professional-filter-card {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%) !important;
    border-radius: var(--radius-xl) !important;
    padding: 30px !important;
    margin-bottom: 30px !important;
    box-shadow: var(--shadow-xl) !important;
    border: none !important;
    position: relative !important;
    overflow: hidden !important;
}

.professional-filter-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.professional-filter-card .card-title {
    color: white !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    margin-bottom: 25px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative !important;
    z-index: 1 !important;
}

.professional-filter-card .card-title i {
    font-size: 26px;
    opacity: 0.95;
}

.professional-filter-form {
    background: white !important;
    border-radius: var(--radius-lg) !important;
    padding: 30px !important;
    box-shadow: var(--shadow-md) !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Professional Form Groups */
.professional-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.professional-filter-group {
    position: relative;
}

.professional-filter-group label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    display: block;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.professional-filter-group .form-control,
.professional-filter-group .SlectBox,
.professional-filter-group select {
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-200);
    padding: 0 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px !important;
    background: white;
    color: var(--gray-700);
    width: 100%;
}

.professional-filter-group .form-control:focus,
.professional-filter-group .SlectBox:focus,
.professional-filter-group select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1) !important;
    outline: none !important;
    background: white !important;
}

.professional-filter-group .form-control::placeholder {
    color: #475569 !important;
    opacity: 1 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
}

.professional-filter-group .form-control::-webkit-input-placeholder {
    color: #475569 !important;
    opacity: 1 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
}

.professional-filter-group .form-control::-moz-placeholder {
    color: #475569 !important;
    opacity: 1 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
}

.professional-filter-group .form-control:-ms-input-placeholder {
    color: #475569 !important;
    opacity: 1 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
}

/* Select dropdown placeholder styling */
.professional-filter-group select,
.professional-filter-group .SlectBox {
    font-size: 16px !important;
    color: var(--gray-700) !important;
    font-weight: 500 !important;
}

.professional-filter-group select option:first-child,
.professional-filter-group select option[value="null"] {
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    padding: 12px !important;
}

.professional-filter-group select option {
    color: var(--gray-700) !important;
    font-size: 16px !important;
    padding: 12px !important;
    font-weight: 500 !important;
}

/* Select2 placeholder styling - Enhanced */
.professional-filter-group .select2-container .select2-selection--single .select2-selection__placeholder {
    color: #475569 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 42px !important;
    letter-spacing: 0.2px !important;
}

.professional-filter-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--gray-700) !important;
    font-size: 16px !important;
    line-height: 42px !important;
    padding-right: 20px !important;
    font-weight: 500 !important;
}

.professional-filter-group .select2-container--default .select2-selection--single {
    height: 42px !important;
    border: 2px solid var(--gray-200) !important;
    border-radius: var(--radius-md) !important;
}

.professional-filter-group .select2-container--default .select2-selection--single:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1) !important;
}

/* When select has placeholder value selected */
.professional-filter-group select[value="null"],
.professional-filter-group select option[selected][value="null"] {
    color: #475569 !important;
    font-weight: 600 !important;
}

/* Professional Buttons */
.professional-btn {
    border: none;
    color: white;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.professional-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.professional-btn:hover::before {
    width: 300px;
    height: 300px;
}

.professional-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.professional-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.professional-btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
}

.professional-btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
}

.professional-btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #94a3b8 100%);
}

.professional-btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #fbbf24 100%);
}

.professional-btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #60a5fa 100%);
}

/* Professional Action Buttons */
.professional-filter-actions {
    display: flex;
    gap: 16px;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* Results Summary */
.professional-results-summary {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 24px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
}

.professional-results-summary i {
    font-size: 20px;
    opacity: 0.9;
}

/* Professional Table */
.professional-table-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    overflow-x: auto; /* Allow horizontal scroll for wide tables */
    overflow-y: visible;
    position: relative;
}

.professional-table {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

/* Override DataTables default styles */
.professional-table-wrapper table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: separate !important;
}

.professional-table thead {
    background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%) !important;
}

.professional-table thead th {
    padding: 10px 6px !important;
    font-weight: 700 !important;
    color: white !important;
    text-align: center !important;
    border-bottom: 2px solid #3b82f6 !important;
    font-size: 11px !important;
    letter-spacing: 0.2px;
    white-space: nowrap;
    background: transparent !important;
}

.professional-table tbody tr {
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--gray-100);
}

.professional-table tbody tr:hover {
    background: var(--gray-50) !important;
}

.professional-table tbody tr.even {
    background-color: white;
}

.professional-table tbody tr.odd {
    background-color: var(--gray-50);
}

.professional-table tbody td {
    padding: 8px 6px !important;
    color: var(--gray-700) !important;
    font-size: 12px !important;
    vertical-align: middle !important;
    text-align: center !important;
    white-space: nowrap;
    border-top: none !important;
}

/* Optimize table column widths for better fit */
.professional-table thead th:first-child,
.professional-table tbody td:first-child {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 8px 4px !important;
}

.professional-table thead th:nth-child(2),
.professional-table tbody td:nth-child(2) {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    padding: 6px 4px !important;
}

.professional-table thead th:nth-child(3),
.professional-table tbody td:nth-child(3) {
    min-width: 120px !important;
    max-width: 180px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    text-align: right !important;
}

.professional-table thead th:nth-child(4),
.professional-table thead th:nth-child(5),
.professional-table thead th:nth-child(6),
.professional-table tbody td:nth-child(4),
.professional-table tbody td:nth-child(5),
.professional-table tbody td:nth-child(6) {
    min-width: 90px !important;
    max-width: 110px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.professional-table thead th:nth-child(7),
.professional-table tbody td:nth-child(7) {
    min-width: 90px !important;
    max-width: 120px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.professional-table thead th:nth-child(8),
.professional-table tbody td:nth-child(8) {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
}

.professional-table thead th:nth-child(9),
.professional-table tbody td:nth-child(9) {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
}

.professional-table thead th:nth-child(10),
.professional-table tbody td:nth-child(10) {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
}

.professional-table thead th:last-child,
.professional-table tbody td:last-child {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    padding: 6px 4px !important;
}

/* Fix DataTables styling conflicts */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin: 0 8px;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Status Badges */
.professional-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.professional-badge-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
    color: white;
}

.professional-badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #fbbf24 100%);
    color: white;
}

.professional-badge-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
    color: white;
}

.professional-badge-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #60a5fa 100%);
    color: white;
}

.professional-badge-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.professional-badge-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.professional-badge-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #94a3b8 100%);
    color: white;
}

/* Professional Cards */
.professional-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.professional-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.professional-card-header {
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.professional-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

/* Professional Alerts */
.professional-alert {
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: none;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.professional-alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-right: 4px solid var(--success-color);
}

.professional-alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-right: 4px solid var(--danger-color);
}

.professional-alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-right: 4px solid var(--warning-color);
}

.professional-alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-right: 4px solid var(--info-color);
}

/* Professional Input Groups */
.professional-input-group {
    position: relative;
    margin-bottom: 20px;
}

.professional-input-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-size: 14px;
}

/* Action Links */
.professional-action-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.professional-action-link:hover {
    color: var(--primary-dark);
    background: var(--gray-100);
    text-decoration: none;
}

/* Operations Dropdown */
.operations-dropdown {
    position: relative;
    display: inline-block;
}

.professional-dropdown-btn {
    background: linear-gradient(135deg, #93c5fd 0%, #bfdbfe 100%) !important;
    border: none !important;
    color: #1e40af !important;
    font-weight: 600 !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(147, 197, 253, 0.3) !important;
}

.professional-dropdown-btn:hover,
.professional-dropdown-btn:focus {
    background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%) !important;
    color: #1e3a8a !important;
    box-shadow: 0 4px 8px rgba(96, 165, 250, 0.4) !important;
    transform: translateY(-1px) !important;
}

.professional-dropdown-btn:active {
    transform: translateY(0) !important;
}

.operations-dropdown .dropdown-menu {
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    padding: 8px 0 !important;
    margin-top: 8px !important;
    min-width: 180px !important;
}

.operations-dropdown .dropdown-item {
    padding: 10px 20px !important;
    font-size: 14px !important;
    color: var(--gray-700) !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: transparent !important;
    background-image: none !important;
}

/* Override any gradient styles for dropdown items */
.operations-dropdown .dropdown-item.btn-edit,
.operations-dropdown .dropdown-item.btn-delete,
.operations-dropdown .dropdown-item.btn-withdrawals,
.operations-dropdown .dropdown-item.btn-export,
.operations-dropdown .dropdown-item.btn-history {
    background: transparent !important;
    background-image: none !important;
    color: var(--gray-700) !important;
}

.operations-dropdown .dropdown-item i {
    font-size: 16px !important;
    width: 20px !important;
    text-align: center !important;
}

.operations-dropdown .dropdown-item:hover,
.operations-dropdown .dropdown-item.btn-edit:hover,
.operations-dropdown .dropdown-item.btn-delete:hover,
.operations-dropdown .dropdown-item.btn-withdrawals:hover,
.operations-dropdown .dropdown-item.btn-export:hover,
.operations-dropdown .dropdown-item.btn-history:hover {
    background: var(--gray-100) !important;
    background-image: none !important;
    color: var(--primary-color) !important;
    transform: none !important;
    box-shadow: none !important;
}

.operations-dropdown .dropdown-item.text-danger,
.operations-dropdown .dropdown-item.btn-delete.text-danger {
    color: var(--danger-color) !important;
}

.operations-dropdown .dropdown-item.text-danger:hover,
.operations-dropdown .dropdown-item.btn-delete.text-danger:hover {
    background: #fee2e2 !important;
    background-image: none !important;
    color: var(--danger-color) !important;
}

.operations-dropdown .dropdown-divider {
    margin: 6px 0 !important;
    border-top: 1px solid var(--gray-200) !important;
}

/* Custom Row Highlighting */
.professional-custom-row {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    border-right: 4px solid var(--success-color);
}

/* Pagination */
.professional-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.professional-pagination .page-link {
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
    padding: 10px 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.professional-pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.professional-pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .professional-filter-row {
        grid-template-columns: 1fr;
    }
    
    .professional-filter-actions {
        flex-direction: column;
    }
    
    .professional-btn {
        width: 100%;
        justify-content: center;
    }
    
    .professional-filter-card {
        padding: 20px;
    }
    
    .professional-filter-form {
        padding: 20px;
    }
}

/* Loading States */
.professional-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
