/*
 * Universal Table Component Styles
 * =================================
 * 
 * Theme-aware styling for the reusable UniversalTable component
 * Adapts styling based on application area (BeoWorld, Multicare, Multiserve, Forum)
 * 
 * COMPONENT: /Pages/BeoWorld/Catalogue/Components/BeoWorldTable.razor
 * 
 * USAGE:
 * Include this CSS file in any page that uses <BeoWorldTable>:
 * <link rel="stylesheet" href="/css/beoworld-table.css" />
 * 
 * THEMES SUPPORTED:
 * - BeoWorld (purple/indigo)
 * - Multicare (professional blue)
 * - Multiserve (admin gray/blue)
 * - Forum (community teal/purple)
 * 
 * Created: 2026-01-03
 * Updated: 2026-01-29 - Made theme-aware
 */

/* ========================================================================
   BASE CONTAINER STYLES (All Themes)
   ======================================================================== */

.universal-table-container {
    width: 100%;
}

.universal-table-container .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.universal-table-container .table-header h5 {
    margin: 0;
}

.universal-table-container .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
}

.universal-table-container .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
}

.universal-table-container .empty-state-icon {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.universal-table-container .empty-state h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.universal-table-container .empty-state p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.universal-data-grid {
    width: 100%;
}

/* Thumbnail Images - Icon Size */
.universal-table-container .table-thumbnail {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
}

.universal-table-container .table-thumbnail-placeholder {
    width: 45px;
    height: 45px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.universal-table-container .product-name-cell strong {
    display: block;
    margin-bottom: 0.25rem;
}

.universal-table-container .product-name-cell small {
    color: #6c757d;
}

/* ========================================================================
   SCROLLABLE TABLE WITH STICKY HEADER & FOOTER
   ======================================================================== */

/* Sticky Table Approach - Applied to DataGrid */
.universal-table-container .sticky-table {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 350px);
    min-height: 400px;
}

/* Make table body scrollable */
.universal-table-container .sticky-table .rz-datatable-scrollable-body,
.universal-table-container .sticky-table .rz-grid-content {
    overflow-y: auto !important;
    flex: 1 1 auto;
}

/* Sticky Table Header */
.universal-table-container .sticky-table thead,
.universal-table-container .sticky-table .rz-datatable-scrollable-header-box {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Sticky Pagination Footer */
.universal-table-container .sticky-table .rz-paginator,
.universal-table-container .sticky-table .rz-datatable-pager {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
    background: white !important;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1) !important;
    padding: 0.75rem 0.5rem !important;
    margin: 0 !important;
}

/* Smooth scrolling */
.universal-table-container .sticky-table {
    scroll-behavior: smooth;
}

/* Custom scrollbar styling */
.universal-table-container .sticky-table .rz-datatable-scrollable-body::-webkit-scrollbar,
.universal-table-container .sticky-table .rz-grid-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.universal-table-container .sticky-table .rz-datatable-scrollable-body::-webkit-scrollbar-track,
.universal-table-container .sticky-table .rz-grid-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.universal-table-container .sticky-table .rz-datatable-scrollable-body::-webkit-scrollbar-thumb,
.universal-table-container .sticky-table .rz-grid-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.universal-table-container .sticky-table .rz-datatable-scrollable-body::-webkit-scrollbar-thumb:hover,
.universal-table-container .sticky-table .rz-grid-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================================================
   ROW HOVER & SELECTION STYLES
   ======================================================================== */

/* Row Hover Effect - Base */
.universal-table-container .sticky-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.universal-table-container .sticky-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

/* Selected Row - Base */
.universal-table-container .sticky-table tbody tr.rz-state-highlight,
.universal-table-container .sticky-table tbody tr[aria-selected="true"] {
    background-color: rgba(0, 0, 0, 0.08) !important;
    font-weight: 500;
}

/* ========================================================================
   THEME-SPECIFIC STYLES
   ======================================================================== */

/* BeoWorld Theme (Purple/Indigo) */
.universal-table-container.theme-beoworld .table-header h5 {
    color: #667eea;
}

.universal-table-container.theme-beoworld .empty-state-icon {
    color: #667eea;
    opacity: 0.3;
}

.universal-table-container.theme-beoworld .rz-paginator {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
}

/* BeoWorld Row Hover & Selection */
.universal-table-container.theme-beoworld .sticky-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.08) !important;
}

.universal-table-container.theme-beoworld .sticky-table tbody tr.rz-state-highlight,
.universal-table-container.theme-beoworld .sticky-table tbody tr[aria-selected="true"] {
    background-color: rgba(102, 126, 234, 0.15) !important;
    border-left: 3px solid #667eea;
}

/* Multicare Theme (Professional Blue) */
.universal-table-container.theme-multicare .table-header h5 {
    color: #0056b3;
}

.universal-table-container.theme-multicare .empty-state-icon {
    color: #0056b3;
    opacity: 0.3;
}

.universal-table-container.theme-multicare .rz-paginator {
    background: linear-gradient(135deg, #0056b320 0%, #004a9f20 100%);
}

/* Multicare Row Hover & Selection */
.universal-table-container.theme-multicare .sticky-table tbody tr:hover {
    background-color: rgba(0, 86, 179, 0.08) !important;
}

.universal-table-container.theme-multicare .sticky-table tbody tr.rz-state-highlight,
.universal-table-container.theme-multicare .sticky-table tbody tr[aria-selected="true"] {
    background-color: rgba(0, 86, 179, 0.15) !important;
    border-left: 3px solid #0056b3;
}

/* Multiserve Theme (Admin Gray/Blue) */
.universal-table-container.theme-multiserve .table-header h5 {
    color: #495057;
    font-weight: 600;
}

.universal-table-container.theme-multiserve .empty-state-icon {
    color: #6c757d;
    opacity: 0.4;
}

.universal-table-container.theme-multiserve .rz-paginator {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Multiserve Row Hover & Selection */
.universal-table-container.theme-multiserve .sticky-table tbody tr:hover {
    background-color: rgba(73, 80, 87, 0.06) !important;
}

.universal-table-container.theme-multiserve .sticky-table tbody tr.rz-state-highlight,
.universal-table-container.theme-multiserve .sticky-table tbody tr[aria-selected="true"] {
    background-color: rgba(73, 80, 87, 0.12) !important;
    border-left: 3px solid #495057;
}

/* Forum Theme (Community Teal/Purple) */
.universal-table-container.theme-forum .table-header h5 {
    color: #5c6ac4;
}

.universal-table-container.theme-forum .empty-state-icon {
    color: #5c6ac4;
    opacity: 0.3;
}

.universal-table-container.theme-forum .rz-paginator {
    background: linear-gradient(135deg, #5c6ac420 0%, #667eea20 100%);
}

/* Forum Row Hover & Selection */
.universal-table-container.theme-forum .sticky-table tbody tr:hover {
    background-color: rgba(92, 106, 196, 0.08) !important;
}

.universal-table-container.theme-forum .sticky-table tbody tr.rz-state-highlight,
.universal-table-container.theme-forum .sticky-table tbody tr[aria-selected="true"] {
    background-color: rgba(92, 106, 196, 0.15) !important;
    border-left: 3px solid #5c6ac4;
}

/* Responsive */
@media (max-width: 768px) {
    .universal-table-container .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
