/* Expand search results dropdown for card layout */
.search-results-dropdown {
    position: fixed;
    top: 70px;
    left: 5%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin-top: 8px;
    max-height: 70vh;
    min-width: 600px;
    max-width: 70vw;
    overflow: hidden;
    display: none;
    z-index: 1200;
    animation: slideDown 0.3s ease-out;
}

/* Scrollable container inside dropdown */
.search-scrollable-container {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px;
}

/* Custom scrollbar for search results */
.search-scrollable-container::-webkit-scrollbar {
    width: 8px;
}

.search-scrollable-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-scrollable-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.search-scrollable-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Search Results Grid - exactly like your receipt cards */
.search-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Candidate Cards - using receipt card styling */
.candidate-card {
    background: #f9fafc;
    border: 1px solid #edf0f7;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 140px;
}

.candidate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
    border-color: #4a6cf7;
}

.candidate-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.candidate-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a6cf7, #3a5bc7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.candidate-basic-info {
    flex: 1;
    min-width: 0;
}

.candidate-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 4px;
}

.candidate-admission {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.access-restriction {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #856404;
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.candidate-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.candidate-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.3;
}

.candidate-detail i {
    width: 14px;
    color: #8E8E93;
    flex-shrink: 0;
}

.candidate-detail span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Restricted styling */
.candidate-card.search-result-restricted {
    background-color: #fffbf0;
    border-color: #ffc107;
    opacity: 0.85;
}

.candidate-card.search-result-restricted .candidate-name {
    color: #856404;
}

/* Loading and pagination states */
.search-loading-indicator {
    text-center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin: 10px 0;
}

.search-status {
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-results-dropdown {
        min-width: 90vw;
        max-width: 95vw;
        left: 50%;
        transform: translateX(-50%);
    }

    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .search-scrollable-container {
        padding: 12px;
    }

    .candidate-card {
        padding: 12px;
        min-height: auto;
    }
}

/* Empty and error states matching your existing design */
.search-empty, .search-error {
    padding: 32px 16px;
    text-align: center;
    color: #8E8E93;
}

.search-empty i, .search-error i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
    color: #C7C7CC;
}

.search-error button {
    margin-top: 12px;
    padding: 6px 12px;
    background: #4a6cf7;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.search-scrollable-container {
    max-height: 350px;
    overflow-y: auto;
    padding: 16px;
}

.status-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 4px;
}

.status-sponsored {
    background: #e3f2fd;
    color: #1976d2;
}

.status-deferred {
    background: #fff3e0;
    color: #f57c00;
}

.status-external {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-not-assigned {
    background: #fce4ec;
    color: #c62828;
}

.status-other {
    background: #f3e5f5;
    color: #7b1fa2;
}

.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    font-weight: 600;
    padding: 1px 2px;
    border-radius: 2px;
    border: none;
}

/* iOS-style Shimmer Loading Animation */
.candidate-card-shimmer {
    background: #f9fafc;
    border: 1px solid #edf0f7;
    border-radius: 10px;
    padding: 16px;
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.candidate-card-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.shimmer-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.shimmer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
}

.shimmer-info {
    flex: 1;
}

.shimmer-line {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
}

.shimmer-name {
    width: 70%;
    height: 14px;
}

.shimmer-admission {
    width: 50%;
    height: 10px;
}

.shimmer-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shimmer-detail {
    width: 80%;
    height: 10px;
}

.shimmer-detail:nth-child(2) {
    width: 65%;
}

.shimmer-detail:nth-child(3) {
    width: 75%;
}

/* Desktop search expansion */
@media (min-width: 768px) {
    .candidate-search-container.active {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(-50%) translateX(-20px) scale(1) !important;
    }

    .search-results-dropdown.show {
        display: block !important;
    }
}

