/**
 * PooPrints Global - Table Sorter Styles
 * Universal styles for the table sorting functionality
 * 
 * @version 1.0.0
 */

/* Sortable header styles */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sortable-header:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Sort icon styles */
.sort-icon {
    margin-left: 5px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    font-size: 0.8em;
}

.sortable-header:hover .sort-icon {
    opacity: 1;
}

/* Active sort icon */
.sortable-header .sort-icon.fa-sort-up,
.sortable-header .sort-icon.fa-sort-down {
    opacity: 1;
    color: var(--pooprints-primary)
}

/* Row highlighting for new/updated rows */
.new-row-highlight {
    animation: highlightPulse 4s ease-in-out;
}

@keyframes highlightPulse {
    0% {
        background-color: rgba(76, 175, 80, 0.3);
        border-left: 4px solid #4CAF50;
    }
    25% {
        background-color: rgba(76, 175, 80, 0.2);
        border-left: 4px solid #4CAF50;
    }
    50% {
        background-color: rgba(76, 175, 80, 0.1);
        border-left: 3px solid #4CAF50;
    }
    75% {
        background-color: rgba(76, 175, 80, 0.05);
        border-left: 2px solid #4CAF50;
    }
    100% {
        background-color: transparent;
        border-left: none;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .sortable-header:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .sortable-header:active {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .sortable-header .sort-icon.fa-sort-up,
    .sortable-header .sort-icon.fa-sort-down {
        color: var(--color-primary-light, #5ea3d9);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sort-icon {
        margin-left: 3px;
        font-size: 0.7em;
    }
    
    .sortable-header {
        font-size: 0.9em;
    }
}

/* Print styles - hide sort icons when printing */
@media print {
    .sort-icon {
        display: none !important;
    }
    
    .sortable-header {
        cursor: default;
    }
    
    .new-row-highlight {
        animation: none;
        background-color: transparent !important;
        border-left: none !important;
    }
}
