/* Profile Search Modal Styles - Based on Spotlight */

.profile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.profile-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: profileSearchFadeIn 0.2s ease-out;
}

.profile-search-container {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: profileSearchSlideIn 0.3s ease-out;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.profile-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.profile-search-header h5 {
    margin: 0;
    color: #212529;
    font-weight: 600;
}

.profile-search-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.profile-search-close:hover {
    background: #e9ecef;
    color: #495057;
}

.profile-search-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.profile-search-input-container {
    position: relative;
    margin-bottom: 20px;
}

.profile-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
}

#profile-search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
    background: white;
    color: #212529;
}

#profile-search-input:focus {
    border-color: #2196f3;
}

#profile-search-input::placeholder {
    color: #6c757d;
}

.profile-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-search-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
    position: relative;
}

.profile-search-item:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.profile-search-item-active {
    background: #e3f2fd !important;
    border-color: #2196f3 !important;
}

.profile-search-item-selected {
    background: #e8f5e8;
    border-color: #28a745;
    position: relative;
}

.profile-search-item-selected::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: #28a745;
    border-radius: 0 2px 2px 0;
}

.profile-search-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    margin-right: 16px;
    color: #6c757d;
    font-size: 16px;
}

.profile-search-item-active .profile-search-item-icon,
.profile-search-item-selected .profile-search-item-icon {
    background: #2196f3;
    color: white;
}

.profile-search-item-selected .profile-search-item-icon {
    background: #28a745;
}

.profile-search-item-content {
    flex: 1;
    min-width: 0;
}

.profile-search-item-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.profile-search-item-description {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
}

.profile-search-item-check {
    color: #28a745;
    font-size: 16px;
    margin-left: 12px;
    animation: profileSearchCheckIn 0.3s ease-out;
}

.profile-search-footer {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.profile-search-shortcuts {
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 12px;
    color: #6c757d;
}

.shortcut-key {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
    color: #495057;
    font-size: 11px;
}

.profile-search-no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}



/* Profile text styles - Simple clickable link appearance */
.profile-text {
    display: inline;
    white-space: nowrap;
    transition: color 0.2s ease;
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 3px;
}

.profile-text:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: #0056b3;
    text-decoration: underline;
}

.profile-text:active {
    color: #004085;
    background-color: rgba(0, 123, 255, 0.2);
}

/* Highlight matching text */
.profile-search-item-title mark {
    background: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
    animation: profileSearchHighlight 0.3s ease-out;
}

/* Animations */
@keyframes profileSearchFadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

@keyframes profileSearchSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

@keyframes profileSearchItemIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes profileSearchCheckIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes profileSearchHighlight {
    from {
        background: #ffeb3b;
        transform: scale(1.1);
    }
    to {
        background: #fff3cd;
        transform: scale(1);
    }
}

.profile-search-item {
    animation: profileSearchItemIn 0.3s ease-out;
    animation-fill-mode: both;
}

.profile-search-item:nth-child(1) { animation-delay: 0.1s; }
.profile-search-item:nth-child(2) { animation-delay: 0.15s; }
.profile-search-item:nth-child(3) { animation-delay: 0.2s; }
.profile-search-item:nth-child(4) { animation-delay: 0.25s; }
.profile-search-item:nth-child(5) { animation-delay: 0.3s; }
.profile-search-item:nth-child(n+6) { animation-delay: 0.35s; }

/* Responsive design */
@media (max-width: 768px) {
    .profile-search-modal {
        padding-top: 5vh;
    }
    
    .profile-search-container {
        width: 95%;
        max-height: 80vh;
    }
    
    .profile-search-header {
        padding: 16px;
    }
    
    .profile-search-body {
        padding: 16px;
    }
    
    #profile-search-input {
        font-size: 16px;
        padding: 10px 10px 10px 36px;
    }
    
    .profile-search-item {
        padding: 12px;
    }
    
    .profile-search-item-icon {
        width: 36px;
        height: 36px;
        margin-right: 12px;
        font-size: 14px;
    }
    
    .profile-search-footer {
        padding: 12px 16px;
    }
    
    .profile-search-shortcuts {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* Focus styles for accessibility */
#profile-search-input:focus {
    outline: none;
}

.profile-search-item:focus {
    outline: 2px solid #2196f3;
    outline-offset: -2px;
}

/* Scrollbar styling */
.profile-search-body::-webkit-scrollbar {
    width: 6px;
}

.profile-search-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.profile-search-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    border: 1px solid #f1f1f1;
}

.profile-search-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar */
.profile-search-body {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}
