.search-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.search-palette-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-palette {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    width: 90%;
    max-width: 640px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
                0 0 0 1px rgba(255, 255, 255, 0.1),
                0 0 80px rgba(99, 102, 241, 0.15);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.search-palette-overlay.active .search-palette {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.search-palette-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
}

.search-palette-icon {
    width: 24px;
    height: 24px;
    color: #818cf8;
    flex-shrink: 0;
}

.search-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 18px;
    color: #f8fafc;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    caret-color: #818cf8;
    caret-shape: block;
}

.search-palette-input:focus {
    outline: none;
}

.search-palette-input::placeholder {
    color: #64748b;
}

.search-palette-shortcut {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 12px;
}

.search-palette-shortcut kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 11px;
    color: #94a3b8;
}

.search-palette-excerpt {
    margin: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    display: none;
    position: relative;
    overflow: hidden;
}

.search-palette-excerpt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #818cf8 0%, #a78bfa 100%);
}

.search-palette-excerpt.active {
    display: block;
    animation: excerptFadeIn 0.25s ease;
}

@keyframes excerptFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-palette-excerpt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a5b4fc;
}

.search-palette-excerpt-header svg {
    width: 14px;
    height: 14px;
}

.search-palette-excerpt-content {
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
}

.search-palette-excerpt-content .excerpt-text {
    margin: 0 0 12px 0;
}

.search-palette-excerpt-content .excerpt-citations {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.search-palette-excerpt-content .excerpt-citations-label {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.search-palette-excerpt-content .excerpt-citation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 6px;
    color: #c7d2fe;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.search-palette-excerpt-content .excerpt-citation:hover {
    background: rgba(99, 102, 241, 0.5);
    border-color: rgba(99, 102, 241, 0.6);
    color: #fff;
    transform: translateY(-1px);
}

.search-palette-message {
    padding: 12px 20px;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #a5b4fc;
    font-size: 14px;
    display: none;
}

.search-palette-message.active {
    display: block;
}

.search-palette-item-icon.experience {
    background: linear-gradient(135deg, #ec4899, #be185d);
}

.search-palette-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.search-palette-results::-webkit-scrollbar {
    width: 6px;
}

.search-palette-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-palette-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.search-palette-empty {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}

.search-palette-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

.search-palette-group {
    margin-bottom: 8px;
}

.search-palette-group-title {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.search-palette-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 14px;
}

.search-palette-item:hover,
.search-palette-item.selected {
    background: rgba(99, 102, 241, 0.15);
}

.search-palette-item.selected {
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.search-palette-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-palette-item-icon.page {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.search-palette-item-icon.project {
    background: linear-gradient(135deg, #10b981, #059669);
}

.search-palette-item-icon.blog {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.search-palette-item-icon.action {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.search-palette-item-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

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

.search-palette-item-title {
    font-size: 15px;
    font-weight: 500;
    color: #f1f5f9;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-palette-item-desc {
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-palette-item-arrow {
    width: 20px;
    height: 20px;
    color: #475569;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.search-palette-item:hover .search-palette-item-arrow,
.search-palette-item.selected .search-palette-item-arrow {
    opacity: 1;
}

.search-palette-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.search-palette-footer-hint {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
}

.search-palette-footer-hint span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-palette-footer-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 10px;
    color: #94a3b8;
}

.search-palette-ai-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #818cf8;
    font-weight: 500;
}

.search-palette-ai-badge svg {
    width: 14px;
    height: 14px;
}

.search-palette-loading {
    display: none;
    padding: 40px 20px;
    text-align: center;
}

.search-palette-loading.active {
    display: block;
}

.search-palette-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #818cf8;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: search-spin 0.8s linear infinite;
}

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

.search-palette-loading-text {
    color: #94a3b8;
    font-size: 14px;
}

.search-trigger-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.search-trigger-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.5);
}

.search-trigger-btn svg {
    width: 24px;
    height: 24px;
    color: white;
}

.search-trigger-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.search-trigger-btn:hover .search-trigger-tooltip {
    opacity: 1;
    visibility: visible;
}

.search-trigger-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #1e293b;
}

@media (max-width: 640px) {
    .search-palette {
        top: 5%;
        width: 95%;
        max-height: 90vh;
    }
    
    .search-palette-results {
        max-height: 50vh;
    }
    
    .search-palette-footer-hint {
        display: none;
    }
    
    .search-trigger-btn {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
    }
}
