/* Gallery Admin Dashboard - Tabulator Custom Styling */
/* Adapted from Pathroot design to match Gallery aesthetic */

.tabulator {
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    overflow: hidden !important;
}

.tabulator .tabulator-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.tabulator .tabulator-header .tabulator-col {
    background: transparent !important;
    border-right: none !important;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 14px 20px !important;
}

.tabulator .tabulator-header .tabulator-col-title {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #94a3b8 !important;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {
    padding-right: 20px !important;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter {
    right: 8px !important;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-sorter .tabulator-arrow {
    border-top: none !important;
    border-bottom: 6px solid #cbd5e1 !important;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-sorter .tabulator-arrow {
    border-top: none !important;
    border-bottom: 6px solid #4A5D4A !important;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-sorter .tabulator-arrow {
    border-top: 6px solid #4A5D4A !important;
    border-bottom: none !important;
}

.tabulator .tabulator-tableholder {
    background: white !important;
    overflow-x: auto !important;
}

.tabulator .tabulator-table {
    background: white !important;
}

.tabulator .tabulator-row {
    background: white !important;
    border-bottom: 1px solid #f1f5f9 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    min-height: auto !important;
}

.tabulator .tabulator-row:last-child {
    border-bottom: none !important;
}

.tabulator .tabulator-row:hover {
    background: #f8fafc !important;
}

.tabulator .tabulator-row.tabulator-row-even {
    background: white !important;
}

.tabulator .tabulator-row.tabulator-row-even:hover {
    background: #f8fafc !important;
}

.tabulator .tabulator-row .tabulator-cell {
    padding: 16px 20px !important;
    border-right: none !important;
    border-bottom: none !important;
    vertical-align: middle !important;
}

.tabulator .tabulator-row .tabulator-cell.tabulator-frozen {
    background: inherit !important;
}

/* Action buttons - dropdown menu pattern */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    position: relative;
}

.actions-menu-btn {
    font-size: 1.25rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    color: #64748b;
    transition: background-color 0.15s ease;
}

.actions-menu-btn:hover {
    background-color: #f1f5f9;
    color: #4A5D4A;
}

.actions-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.actions-dropdown.show {
    display: flex;
}

.actions-dropdown-item {
    padding: 0.5rem 1rem;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    transition: background-color 0.15s ease;
    white-space: nowrap;
    color: #475569;
}

.actions-dropdown-item:hover {
    background-color: #f8fafc;
}

.actions-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.actions-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.actions-dropdown-item.delete-action {
    color: #dc2626;
}

.actions-dropdown-item.delete-action:hover {
    background-color: #fef2f2;
}

/* Allow overflow for action dropdowns */
.tabulator-cell:has(.action-buttons) {
    overflow: visible !important;
}

.tabulator-row:has(.action-buttons) {
    overflow: visible !important;
}

.tabulator .tabulator-table {
    overflow: visible !important;
}

.tabulator .tabulator-tableholder {
    overflow: visible !important;
}

/* Footer/Pagination */
.tabulator .tabulator-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e5e7eb !important;
    border-bottom: none !important;
    padding: 12px 20px !important;
}

.tabulator .tabulator-footer .tabulator-footer-contents {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.tabulator .tabulator-footer .tabulator-paginator {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #64748b !important;
    font-size: 14px !important;
}

.tabulator .tabulator-footer .tabulator-paginator label {
    color: #64748b !important;
    font-size: 13px !important;
}

.tabulator .tabulator-footer .tabulator-page-size {
    padding: 6px 10px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    background: white !important;
    font-family: inherit !important;
    font-size: 13px !important;
    color: #475569 !important;
    margin-left: 8px !important;
}

.tabulator .tabulator-footer .tabulator-page {
    padding: 6px 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    background: white !important;
    color: #475569 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 13px !important;
    transition: all 0.15s ease !important;
}

.tabulator .tabulator-footer .tabulator-page:hover:not(:disabled):not(.active) {
    background: #f1f5f9 !important;
    border-color: #4A5D4A !important;
}

.tabulator .tabulator-footer .tabulator-page.active {
    background: #4A5D4A !important;
    border-color: #4A5D4A !important;
    color: white !important;
}

.tabulator .tabulator-footer .tabulator-page:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* Placeholder/Empty state */
.tabulator .tabulator-placeholder {
    padding: 60px 20px !important;
    text-align: center !important;
    color: #94a3b8 !important;
}

.tabulator .tabulator-placeholder-contents {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Loading indicator */
.tabulator .tabulator-loader {
    background: rgba(255, 255, 255, 0.8) !important;
}

.tabulator .tabulator-loader .tabulator-loader-msg {
    background: #4A5D4A !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
}

/* Image thumbnails in table cells */
.table-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    background: #f1f5f9;
}

.table-thumbnail-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.25rem;
}

/* Round thumbnails for artists */
.table-thumbnail-round {
    border-radius: 50%;
}

.table-thumbnail-placeholder.table-thumbnail-round {
    background: #4A5D4A;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

/* Artist/Artwork info cell */
.table-info-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-info-title {
    font-weight: 600;
    color: #1e293b;
}

.table-info-subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

/* Status cell styling */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-available {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-sold {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.status-on_hold {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-not_for_sale {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

/* Price formatting */
.price-cell {
    font-weight: 600;
    color: #1e293b;
}

/* Action buttons - inline style */
.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn-edit {
    background: #f1f5f9;
    color: #475569;
}

.action-btn-edit:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.action-btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.action-btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.action-btn-view {
    background: rgba(74, 93, 74, 0.1);
    color: #4A5D4A;
}

.action-btn-view:hover {
    background: rgba(74, 93, 74, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .tabulator {
        border-radius: 8px !important;
    }

    .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
        padding: 12px 12px !important;
    }

    .tabulator .tabulator-row .tabulator-cell {
        padding: 12px 12px !important;
    }

    .tabulator .tabulator-footer {
        padding: 10px 12px !important;
    }

    .table-thumbnail {
        width: 40px;
        height: 40px;
    }

    .table-thumbnail-placeholder {
        width: 40px;
        height: 40px;
    }
}
