/**
 * LoyalChamp UI Utilities CSS
 * Styles for loading, validation, pagination, etc.
 */

/* ==================== LOADING SPINNERS ==================== */

.lc-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 31, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.lc-loading-spinner {
    text-align: center;
}

.lc-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #374151;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: lc-spin 1s linear infinite;
    margin: 0 auto 16px;
}

.lc-loading-text {
    color: #F9FAFB;
    font-size: 14px;
}

.lc-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: lc-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes lc-spin {
    to { transform: rotate(360deg); }
}

/* ==================== FORM VALIDATION ==================== */

.lc-input-error {
    border-color: #EF4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.lc-input-valid {
    border-color: #10B981 !important;
}

.lc-field-error {
    color: #EF4444;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lc-field-error::before {
    content: '⚠';
}

/* ==================== PAGINATION ==================== */

.lc-page-btn {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1F2937;
    border: 1px solid #374151;
    color: #F9FAFB;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.lc-page-btn:hover:not(.disabled):not(.active) {
    background: #374151;
    border-color: #4B5563;
}

.lc-page-btn.active {
    background: #3B82F6;
    border-color: #3B82F6;
}

.lc-page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== BREADCRUMBS ==================== */

.lc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 16px;
}

.lc-breadcrumb a {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.2s;
}

.lc-breadcrumb a:hover {
    color: #3B82F6;
}

.lc-breadcrumb .lc-breadcrumb-sep {
    color: #4B5563;
}

.lc-breadcrumb .lc-breadcrumb-current {
    color: #F9FAFB;
}

/* ==================== SEARCH ==================== */

.lc-search-wrapper {
    position: relative;
}

.lc-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
    pointer-events: none;
}

.lc-search-input {
    padding-left: 40px !important;
}

.lc-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.lc-search-wrapper:focus-within .lc-search-clear,
.lc-search-input:not(:placeholder-shown) + .lc-search-clear {
    opacity: 1;
}

.lc-search-clear:hover {
    color: #F9FAFB;
}

/* ==================== SKELETON LOADING ==================== */

.lc-skeleton {
    background: linear-gradient(90deg, #1F2937 25%, #374151 50%, #1F2937 75%);
    background-size: 200% 100%;
    animation: lc-skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes lc-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== SORTABLE TABLES ==================== */

th[data-sortable] {
    cursor: pointer;
    user-select: none;
}

th[data-sortable]:hover {
    background: rgba(55, 65, 81, 0.5);
}

.lc-sort-icon {
    opacity: 0.5;
}

th[data-sort-dir="asc"] .lc-sort-icon,
th[data-sort-dir="desc"] .lc-sort-icon {
    opacity: 1;
}

/* ==================== CONFIRM DIALOG ==================== */

.lc-confirm-overlay {
    animation: lc-fade-in 0.2s ease-out;
}

@keyframes lc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== TOAST NOTIFICATIONS ==================== */

#lc-toast-container {
    pointer-events: none;
}

#lc-toast-container > div {
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
}

