/**
 * Inline Search Dropdown Styles
 * Modern dropdown with glassmorphism design
 */

/* Search Container in Header */
.fulgura-search-wrapper {
    position: relative;
    min-width: 320px;
    max-width: 450px;
    flex: 1;
}

.fulgura-search-container {
    display: flex;
    align-items: center;
    background: rgba(20, 20, 40, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    padding: 0.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fulgura-search-container:focus-within {
    border-color: rgba(138, 43, 226, 0.6);
    box-shadow:
        0 0 20px rgba(138, 43, 226, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.3);
    background: rgba(20, 20, 40, 0.85);
}

.fulgura-search-input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.6rem 1rem;
    flex: 1;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
}

.fulgura-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-icon {
    color: rgba(138, 43, 226, 0.8);
    padding: 0 0.75rem;
    font-size: 0.9rem;
}

.search-shortcut {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-right: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
}

.search-shortcut kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-family: inherit;
    font-size: 0.7rem;
}

/* Dropdown Container */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(138, 43, 226, 0.15);
    z-index: 9999;
    max-height: 450px;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease-out;
}

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

.dropdown-results {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 43, 226, 0.3) transparent;
}

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

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

.dropdown-results::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.3);
    border-radius: 3px;
}

/* Quick Action */
.dropdown-quick-action {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.15);
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(65, 105, 225, 0.2));
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.quick-action-btn:hover,
.quick-action-btn.selected {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.35), rgba(65, 105, 225, 0.35));
    border-color: rgba(138, 43, 226, 0.5);
    transform: translateX(4px);
}

.quick-action-btn i {
    color: rgba(138, 43, 226, 0.9);
}

.quick-action-btn kbd {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Section */
.dropdown-section {
    padding: 0.5rem 0;
}

.dropdown-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-section-header i {
    color: rgba(138, 43, 226, 0.7);
    font-size: 0.7rem;
}

.section-count {
    margin-left: auto;
    background: rgba(138, 43, 226, 0.2);
    color: rgba(138, 43, 226, 0.9);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
}

/* Dropdown Items */
.dropdown-section-items {
    display: flex;
    flex-direction: column;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover,
.dropdown-item.selected {
    background: rgba(138, 43, 226, 0.12);
    border-left-color: rgba(138, 43, 226, 0.8);
}

.dropdown-item.selected {
    background: rgba(138, 43, 226, 0.18);
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.item-content > i {
    color: rgba(138, 43, 226, 0.7);
    margin-right: 0.5rem;
}

.recent-item .item-content {
    flex-direction: row;
    align-items: center;
}

.item-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.meta-badge {
    background: rgba(138, 43, 226, 0.15);
    color: rgba(138, 43, 226, 0.9);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: capitalize;
}

.item-meta i {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.dropdown-item:hover .item-meta i,
.dropdown-item.selected .item-meta i {
    color: rgba(138, 43, 226, 0.7);
    transform: translateX(3px);
}

/* Footer */
.dropdown-footer {
    padding: 0.6rem 1rem;
    border-top: 1px solid rgba(138, 43, 226, 0.15);
    background: rgba(10, 10, 25, 0.5);
}

.footer-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
}

.footer-hint kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    font-family: inherit;
    font-size: 0.65rem;
}

/* Tips */
.dropdown-tips {
    padding: 1rem;
}

.tips-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.tip-item i {
    color: rgba(138, 43, 226, 0.6);
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
}

/* Loading State */
.dropdown-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.dropdown-loading i {
    color: rgba(138, 43, 226, 0.8);
    font-size: 1.2rem;
}

/* Error State */
.dropdown-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: #ef4444;
}

/* No Results */
.dropdown-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.dropdown-no-results i {
    font-size: 2rem;
    color: rgba(138, 43, 226, 0.3);
    margin-bottom: 0.75rem;
}

.no-results-title {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.no-results-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Copy Toast - Bottom Right */
.copy-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    transform: translateY(100px);
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.copy-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Copy button styling */
.copy-btn {
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: rgba(138, 43, 226, 0.6);
}

.copy-btn:hover {
    color: rgba(138, 43, 226, 1);
    background: rgba(138, 43, 226, 0.1);
}

/* Light Theme */
[data-theme="light"] .fulgura-search-wrapper .search-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(138, 43, 226, 0.2);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(138, 43, 226, 0.08);
}

[data-theme="light"] .dropdown-item {
    color: #1a1a1a;
}

[data-theme="light"] .dropdown-item:hover,
[data-theme="light"] .dropdown-item.selected {
    background: rgba(138, 43, 226, 0.08);
}

[data-theme="light"] .item-title {
    color: #1a1a1a;
}

[data-theme="light"] .item-subtitle {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .dropdown-section-header {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .dropdown-footer {
    background: rgba(245, 245, 250, 0.8);
    border-top-color: rgba(138, 43, 226, 0.1);
}

[data-theme="light"] .footer-hint {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .tip-item {
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .quick-action-btn {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(65, 105, 225, 0.1));
    color: #1a1a1a;
}

[data-theme="light"] .quick-action-btn:hover,
[data-theme="light"] .quick-action-btn.selected {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.18), rgba(65, 105, 225, 0.18));
}

/* Responsive */
@media (max-width: 768px) {
    .fulgura-search-wrapper {
        min-width: 100%;
        max-width: 100%;
    }

    .search-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .search-shortcut {
        display: none;
    }
}
