/* ============================================ */
/* PHASE 1 COMPLETION STYLES */
/* Loading States, Bulk Actions, Filters, Polish */
/* ============================================ */

/* ============================================ */
/* LOADING STATES & SKELETON SCREENS */
/* ============================================ */

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-content .loading-spinner {
    width: 60px;
    height: 60px;
    border-width: 6px;
    margin-bottom: 1rem;
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Skeleton Screens */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 120px;
    width: 100%;
}

.skeleton-row {
    height: 60px;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-text {
    height: 20px;
    width: 60%;
    margin-bottom: 0.5rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.empty-state-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ============================================ */
/* BULK ACTIONS */
/* ============================================ */

.bulk-actions-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    gap: 1.5rem;
    z-index: 50;
    animation: slideUpBounce 0.3s ease;
}

.bulk-actions-bar.active {
    display: flex;
}

@keyframes slideUpBounce {
    0% {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }

    70% {
        transform: translateX(-50%) translateY(-10px);
    }

    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.bulk-actions-info {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.bulk-actions-info strong {
    color: var(--primary);
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.8rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
}

.checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.checkbox:checked {
    background: var(--primary-gradient);
    border-color: var(--primary);
}

.checkbox:checked::before {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.checkbox:hover {
    border-color: var(--primary);
}

/* ============================================ */
/* DATE RANGE FILTER */
/* ============================================ */

.date-range-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
}

.date-range-filter input[type="date"] {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.2rem;
    cursor: pointer;
    outline: none;
}

.date-range-filter input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.date-quick-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.date-quick-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.date-quick-btn:hover,
.date-quick-btn.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-color: var(--primary);
}

/* ============================================ */
/* ENHANCED SEARCH & FILTERS */
/* ============================================ */

.advanced-filters {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.advanced-filters.active {
    display: grid;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 500px;
    }
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.filter-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.filter-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

/* ============================================ */
/* MICRO-INTERACTIONS & POLISH */
/* ============================================ */

.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .7;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .bulk-actions-bar {
        width: 90%;
        flex-direction: column;
        align-items: flex-start;
    }

    .bulk-actions-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .date-quick-filters {
        flex-wrap: wrap;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .glass-panel {
        border-width: 2px;
    }

    .btn {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}