/* ===================================
   PHASE 1: QUICK WINS - STYLES
   =================================== */

/* 1. SEARCH HISTORY */
.search-history {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 0.75rem;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-history-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.clear-history-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}


/* ===================================
   History Chips - MOVED
   Styles moved to: assets/css/components/chips.css
   =================================== */


.history-icon {
    font-size: 0.9rem;
}

.history-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 2. SORT & FILTER CONTROLS */
.sort-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.sort-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-section label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

#sortSelect {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#sortSelect:hover {
    border-color: var(--accent-color);
    background: rgba(139, 92, 246, 0.1);
}

#sortSelect:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.filter-checkbox:hover {
    color: var(--text-primary);
}

.filter-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 0.3rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.filter-checkbox input[type="checkbox"]:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.filter-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.filter-checkbox input[type="checkbox"]:hover {
    border-color: var(--accent-color);
    background: rgba(139, 92, 246, 0.1);
}

/* 3. KEYBOARD SHORTCUTS TOOLTIP */
.keyboard-tooltip {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
    transition: opacity 0.3s ease;
}

.tooltip-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.shortcut-item:last-child {
    margin-bottom: 0;
}

.shortcut-item kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent-color);
    min-width: 2rem;
    text-align: center;
}

.shortcut-item span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 4. LOADING STATES & SKELETON */
.loading-container {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.skeleton-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.skeleton-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
}

.skeleton-pincode {
    width: 120px;
    height: 1.5rem;
}

.skeleton-office {
    width: 200px;
}

.skeleton-badge {
    width: 60px;
    height: 1.5rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 0.5rem;
}

.skeleton-details {
    margin-top: 1rem;
}

.skeleton-details .skeleton-line:last-child {
    width: 80%;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sort-filter-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .keyboard-tooltip {
        right: auto;
        left: 0;
    }

    .skeleton-cards {
        grid-template-columns: 1fr;
    }
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}