/* Simple Table Search & Sort - Shared Styles */

/* ============================================
   UPPERCASE UTILITY CLASS
   ============================================ */

/* Single universal uppercase class */
.text-uppercase {
    text-transform: uppercase !important;
}

/* Apply to any element (th, td, div, span, etc.) */
th.text-uppercase,
td.text-uppercase,
span.text-uppercase,
div.text-uppercase {
    text-transform: uppercase !important;
}

/* Default table header styling - applies to any table with search controls */
.simple-table-controls + .table-responsive thead th,
.simple-table-controls + table thead th,
.simple-table-search-sort thead th,
table.simple-table-search-sort thead th {
    background-color: #43BDD5 !important;
    color: #fff !important;
    font-weight: 600;
    padding: 0.5rem !important;
    white-space: nowrap;
}

/* Search highlight styling */
.search-highlight {
    background-color: #fff3cd;
    padding: 2px 0;
    border-radius: 2px;
    font-weight: 500;
}

/* Sort indicator - Pure CSS arrows for maximum compatibility */
.sort-indicator {
    display: inline-block;
    width: 12px;
    height: 18px;
    margin-left: 8px;
    position: relative;
    vertical-align: middle;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* Unsorted state - both arrows */
.sort-indicator.sort-both::before,
.sort-indicator.sort-both::after {
    content: '';
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.sort-indicator.sort-both::before {
    top: 2px;
    border-bottom: 6px solid #6c757d;
}

.sort-indicator.sort-both::after {
    bottom: 2px;
    border-top: 6px solid #6c757d;
}

/* Ascending state - up arrow only */
.sort-indicator.sort-asc::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #007bff;
}

/* Descending state - down arrow only */
.sort-indicator.sort-desc::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #007bff;
}

/* Active state */
.sort-indicator.active {
    opacity: 1 !important;
}

/* Hover effect on sortable headers */
th:hover .sort-indicator {
    opacity: 0.8;
}

th:hover .sort-indicator.active {
    opacity: 1;
}

/* Sortable header cursor */
th[style*="cursor: pointer"] {
    position: relative;
    padding-right: 30px !important;
}

th[style*="cursor: pointer"]:hover {
    background-color: #e9ecef;
    transition: background-color 0.2s ease;
}

/* Search controls container */
.simple-table-controls {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.simple-table-controls .form-control {
    max-width: 400px;
}

.simple-table-controls .search-info {
    font-size: 0.875rem;
    color: #6c757d;
    margin-left: 8px;
}

/* Action buttons styling */
.simple-table-controls .btn {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.simple-table-controls .btn i {
    font-size: 14px;
}

.simple-table-controls .btn:hover {
    background-color: #e9ecef;
    border-color: #6c757d;
}

.simple-table-controls .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}
