/* Base table styles */
.kota-table {
    width: 100%;
    border-collapse: collapse;
    /* Fixed shift issue */
    border-spacing: 0;
}

/* Table header styles */
.kota-table thead th {
    font-weight: bold;
    color: #333;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    border-top: none;
    border-left: none;
    border-right: none;
}

.kota-table th.kota-sortable .flex {
    font-weight: bold;
}

/* Table cell styles */
.kota-table tbody td {
    padding: 0.75rem 1.5rem;
    color: #4b5563;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
    border-top: none;
    border-left: none;
    border-right: none;
}

/* Striped table rows */
.kota-table-striped tbody tr:nth-child(odd) {
    background-color: #f9fafb;
}

/* Bordered table - modified to only show horizontal borders */
.kota-table-bordered {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.kota-table-bordered th,
.kota-table-bordered td {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
}

/* Remove bottom border from last row if needed */
.kota-table-bordered tbody tr:last-child td {
    border-bottom: none;
}

/* Hover effect */
.kota-table-hover tbody tr:hover {
    background-color: #f3f4f6;
}

/* Responsive table wrapper */
.kota-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Row variations */
.kota-table .kota-table-row-active {
    background-color: #ecfdf5 !important;
}

.kota-table .kota-table-row-warning {
    background-color: #fffbeb !important;
}

.kota-table .kota-table-row-danger {
    background-color: #fee2e2 !important;
}

/* Status indicators */
.kota-table .kota-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.kota-table .kota-status-indicator-success {
    background-color: #10b981;
}

.kota-table .kota-status-indicator-warning {
    background-color: #f59e0b;
}

.kota-table .kota-status-indicator-danger {
    background-color: #ef4444;
}

/* Sortable table headers */
.kota-table th.kota-sortable {
    cursor: pointer;
    user-select: none;
}

/* Remove the default indicators we added before */
.kota-table th.kota-sort-asc:after,
.kota-table th.kota-sort-desc:after {
    content: none;
}

/* Make sure we only display one set of sort icons */
.kota-table th svg:not(.kota-sort-icon) {
    display: none;
}

/* Sort icon styling */
.kota-sort-icon {
    display: inline-flex;
    margin-left: 4px;
    vertical-align: middle;
}

.kota-sort-icon svg {
    width: 12px;
    height: 12px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

/* Hover states */
.kota-table th.kota-sortable:hover .kota-sort-icon svg {
    opacity: 0.7;
}

/* Active sort states */
.kota-table th.kota-sort-asc .kota-sort-icon svg,
.kota-table th.kota-sort-desc .kota-sort-icon svg {
    opacity: 1;
}

/* Remove any other arrows that might be present */
.kota-table th>img[src*="arrow"],
.kota-table th>.sort-icon:not(.kota-sort-icon) {
    display: none;
}


.kota-table-group {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: solid 1px #ddd;
}

.kota-table-group h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.taxonomy-card .card-title {
    margin-bottom: 25px;
}




/* KOTA Table Rows and Headers */

.kt-head-date {
    display: flex;
    justify-content: flex-start;
}

.kt-cell-date {
    display: flex;
    justify-content: flex-start;
}

.kt-head-actions {
    display: flex;
    justify-content: flex-end;
}

.kt-cell-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}


/* KOTA Table Tooltips */
.kota-tooltip-container {
    display: inline-block;
    position: relative;
    cursor: pointer;
}

.kota-tooltip {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s linear;
    min-width: 150px;
    max-width: 250px;
    width: max-content;
    background-color: #121827;

    /* Dashboard specific tweaks */
    .tc-dashboard-main .kota-table {
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    /* Product Link */
    .product-link {
        font-weight: 500;
        color: #111827;
        text-decoration: none;
        transition: color 0.15s ease;
    }

    .product-link:hover {
        color: #2563EB;
    }

    /* SKU */
    .tc-sku {
        font-size: 0.875rem;
        color: #6B7280;
    }

    /* Stats */
    .tc-stat {
        text-align: center;
        font-variant-numeric: tabular-nums;
    }

    /* Columns Filter Dropdown */
    .tc-column-toggle {
        position: relative;
        margin-left: 1rem;
    }

    .tc-columns-btn {
        list-style: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        font-size: 0.875rem;
        font-weight: 500;
        color: #374151;
        background-color: #fff;
        border: 1px solid #D1D5DB;
        border-radius: 0.375rem;
        padding: 0.5rem 0.75rem;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
        transition: all 0.2s;
    }

    .tc-columns-btn:hover {
        background-color: #F9FAFB;
    }

    .tc-columns-btn::-webkit-details-marker {
        display: none;
    }

    .tc-columns-dropdown {
        position: absolute;
        right: 0;
        top: 100%;
        margin-top: 0.5rem;
        width: 12rem;
        background-color: #fff;
        border: 1px solid #E5E7EB;
        border-radius: 0.375rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        padding: 0.5rem;
        z-index: 50;
    }

    .tc-col-option {
        display: flex;
        align-items: center;
        padding: 0.5rem;
        border-radius: 0.25rem;
        cursor: pointer;
        transition: background-color 0.15s;
        user-select: none;
    }

    .tc-col-option:hover {
        background-color: #F3F4F6;
    }

    .tc-col-option input[type="checkbox"] {
        border-radius: 0.25rem;
        color: #4F46E5;
        border-color: #D1D5DB;
        width: 1rem;
        height: 1rem;
        margin-right: 0.5rem;
    }

    .tc-col-option .label-text {
        font-size: 0.875rem;
        color: #374151;
    }

    color: white;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    overflow-wrap: break-word;
    z-index: 10;
    white-space: normal;
    word-break: break-word;
}

/* This ensures the tooltip container doesn't extend beyond the screen */
.kota-action-icon {
    position: relative;
}

/* For tooltips that might extend outside the viewport on the right */
.kota-tooltip-container:last-child .kota-tooltip {
    right: 0;
    left: auto;
    transform: none;
}

.kota-tooltip-container:hover .kota-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Add a subtle arrow pointing down from the tooltip */
.kota-tooltip:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #121827 transparent transparent transparent;
}

/* Add this to the parent container to prevent horizontal scrolling */
.kota-table-responsive {
    overflow-x: visible;
}

/* Expandable Rows */
.kota-table-row-expanded-content {
    display: none;
    background-color: #f9fafb;
}

.kota-table-row-expanded-content.is-expanded {
    display: table-row;
}

.kota-table-row-expanded-content td {
    padding: 1rem 2rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.kota-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #6b7280;
    transition: all 0.2s;
}

.kota-toggle-btn:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.kota-toggle-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

/* Pagination */
.tc-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid #E5E7EB;
}

.tc-pagination-info {
    font-size: 0.875rem;
    color: #374151;
}

.tc-pagination-nav {
    display: flex;
    gap: -1px;
    /* Overlap borders */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-radius: 0.375rem;
}

.tc-pagination-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: white;
    border: 1px solid #D1D5DB;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.15s;
}

.tc-pagination-link:hover {
    background-color: #F9FAFB;
    color: #374151;
}

.tc-pagination-link.prev {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.tc-pagination-link.next {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    margin-left: -1px;
}

/* Sub Product List Styling */

/* Sub Product List Styling */
.tc-sub-prod-container {
    padding: 0;
    margin-top: -1px;
    /* Overlap border */
}

.tc-sub-prod-title {
    display: none;
    /* Hide title as per request for compactness */
}

.tc-sub-prod-row {
    display: flex;
    flex-direction: row;
    /* One line */
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 1rem 0.5rem 3rem;
    /* Indent to align with parent name roughly or hierarchy */
    border-bottom: 1px solid #f3f4f6;
}

.tc-sub-prod-row:last-child {
    border-bottom: none;
}

.tc-sub-prod-name {
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1rem;
    width: 30%;
}

.tc-sub-prod-name a {
    color: #4b5563;
    text-decoration: none;
    font-weight: normal;
}

.tc-sub-prod-name a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.tc-sub-prod-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.tc-sub-prod-stat {
    width: 6rem;
    /* Keep fixed width for alignment columns */
    display: block;
    /* No flex column */
}

.tc-stat-sold {
    text-align: center;
}

.tc-stat-sales {
    text-align: right;
}

.tc-stat-label {
    display: none;
    /* Hide compact labels for cleaner look */
}

.tc-stat-value {
    color: #6b7280;
    font-size: 0.85rem;
}

/* Sort Icon Styling */
.kota-sort-icon {
    width: 1rem;
    height: 1rem;
    margin-left: 0.25rem;
    color: #9ca3af;
    /* gray-400 */
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    vertical-align: middle;
}

.kota-table-head-col:hover .kota-sort-icon,
.kota-table-head-col.sorted-asc .kota-sort-icon,
.kota-table-head-col.sorted-desc .kota-sort-icon {
    opacity: 1;
}

.kota-table-head-col.sorted-desc .kota-sort-icon {
    transform: rotate(180deg);
}