/* Table Responsive Only - Just for horizontal scrolling of tables */

/* All Devices - Desktop, Laptop, Tablet, Mobile */
@media screen and (max-width: 1400px) {
    /* Make tables horizontally scrollable */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
    }
    
    /* Ensure table has minimum width for scrolling */
    .table-responsive .table {
        min-width: 1200px !important;
        margin-bottom: 0;
        white-space: nowrap;
    }
    
    /* Table styling for all devices */
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 12px 10px;
        font-size: 14px;
        white-space: nowrap;
        vertical-align: middle;
    }
    
    /* Table header styling */
    .table-responsive .table thead th {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-weight: 600;
        text-align: center;
        font-size: 13px;
        padding: 15px 10px;
        border: none;
    }
    
    /* Table body styling */
    .table-responsive .table tbody tr {
        transition: background-color 0.3s ease;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .table-responsive .table tbody tr:hover {
        background-color: rgba(102, 126, 234, 0.05);
    }
    
    .table-responsive .table tbody td {
        border: none;
        color: #4a5568;
        font-weight: 500;
    }
    
    /* Scroll indicator */
    .table-responsive::after {
        content: '← Swipe left/right to see more →';
        display: block;
        text-align: center;
        padding: 8px;
        font-size: 11px;
        color: #718096;
        background: rgba(102, 126, 234, 0.1);
        border-radius: 0 0 12px 12px;
        margin-top: -1px;
    }
    
    /* Hide scroll indicator when scrolled */
    .table-responsive.scrolled::after {
        display: none;
    }
    
    /* Badge styling in tables */
    .table-responsive .badge {
        font-size: 10px;
        padding: 4px 8px;
        border-radius: 6px;
        white-space: nowrap;
    }
    
    /* Button styling in tables - 30% bigger height */
    .table-responsive .btn {
        padding: 10px 16px;
        font-size: 12px;
        border-radius: 8px;
        white-space: nowrap;
        min-height: 38px;
        line-height: 1.4;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Action buttons container */
    .table-responsive .action-buttons {
        display: flex;
        gap: 4px;
        justify-content: center;
        flex-wrap: nowrap;
    }
}

/* Mobile specific adjustments */
@media screen and (max-width: 768px) {
    .table-responsive .table {
        min-width: 800px !important;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .table-responsive .table thead th {
        font-size: 11px;
        padding: 12px 8px;
    }
    
    /* Mobile button sizing */
    .table-responsive .btn {
        padding: 8px 14px;
        font-size: 11px;
        min-height: 34px;
        border-radius: 6px;
    }
}

/* Tablet specific adjustments */
@media screen and (max-width: 992px) and (min-width: 769px) {
    .table-responsive .table {
        min-width: 1000px !important;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 11px 9px;
        font-size: 13px;
    }
    
    /* Tablet button sizing */
    .table-responsive .btn {
        padding: 9px 15px;
        font-size: 12px;
        min-height: 36px;
        border-radius: 7px;
    }
}

/* Laptop specific adjustments */
@media screen and (max-width: 1200px) and (min-width: 993px) {
    .table-responsive .table {
        min-width: 1100px !important;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 12px 10px;
        font-size: 14px;
    }
    
    /* Laptop button sizing */
    .table-responsive .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
        border-radius: 8px;
    }
}

/* Custom scrollbar for tables */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #5a6fd8 0%, #6a4190 100%);
}

/* Ensure table container has proper styling */
.card .table-responsive {
    margin: -1px;
    border-radius: 0 0 20px 20px;
}

.card .table-responsive:first-child {
    border-radius: 20px 20px 0 0;
}

.card .table-responsive:only-child {
    border-radius: 20px;
}

/* Fix for DataTables if used */
.dataTables_wrapper .table-responsive {
    overflow-x: auto !important;
}

/* Print styles */
@media print {
    .table-responsive {
        overflow: visible !important;
    }
    
    .table-responsive .table {
        min-width: auto !important;
    }
    
    .table-responsive::after {
        display: none !important;
    }
}
