/**
 * Aurevya Wealth - Search Interface Styles
 * Modern, responsive search overlay with smooth animations
 */

/* Search-wrap integration styles */
.search-wrap .aurevya-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 10px;
    width: 100%;
}

.search-wrap .search-cell {
    position: relative;
}

/* Basic suggestion styles for search-wrap */
.search-wrap .aurevya-search-suggestion {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-wrap .aurevya-search-suggestion:hover,
.search-wrap .aurevya-search-suggestion.selected {
    background-color: #f8f9fa;
}

.search-wrap .suggestion-content {
    flex: 1;
    margin-left: 12px;
}

.search-wrap .suggestion-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.search-wrap .suggestion-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.search-wrap .suggestion-category {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}

.search-wrap .suggestion-icon {
    color: #666;
    width: 20px;
    text-align: center;
}

.search-wrap .suggestion-shortcut {
    color: #999;
}

.search-wrap .aurevya-search-section-title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

.search-wrap .aurevya-search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

.search-wrap .aurevya-search-no-results i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.search-wrap mark {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* Search Overlay */
.aurevya-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 20px 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.aurevya-search-overlay.loading {
    cursor: wait;
}

/* Search Modal */
.aurevya-search-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.aurevya-search-overlay.active .aurevya-search-modal {
    transform: translateY(0) scale(1);
}

/* Dark mode support */
[data-theme="dark"] .aurevya-search-modal {
    background: #1a1a1a;
    color: #ffffff;
}

/* Search Header */
.aurevya-search-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

[data-theme="dark"] .aurevya-search-header {
    border-bottom-color: #374151;
}

.aurevya-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.aurevya-search-input-container .search-icon {
    color: #6b7280;
    font-size: 20px;
    flex-shrink: 0;
}

.aurevya-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    font-weight: 400;
    color: #111827;
    background: transparent;
    padding: 8px 0;
    font-family: inherit;
}

.aurevya-search-input::placeholder {
    color: #9ca3af;
}

[data-theme="dark"] .aurevya-search-input {
    color: #ffffff;
}

[data-theme="dark"] .aurevya-search-input::placeholder {
    color: #6b7280;
}

.aurevya-search-close {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.aurevya-search-close:hover {
    background: #f3f4f6;
    color: #374151;
}

[data-theme="dark"] .aurevya-search-close:hover {
    background: #374151;
    color: #d1d5db;
}

/* Search Results */
.aurevya-search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

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

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

.aurevya-search-results::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

[data-theme="dark"] .aurevya-search-results::-webkit-scrollbar-thumb {
    background: #4b5563;
}

/* Section Title */
.aurevya-search-section-title {
    padding: 16px 24px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .aurevya-search-section-title {
    color: #9ca3af;
}

/* Search Suggestions */
.aurevya-search-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.aurevya-search-suggestion:hover,
.aurevya-search-suggestion.selected {
    background: #f8fafc;
}

[data-theme="dark"] .aurevya-search-suggestion:hover,
[data-theme="dark"] .aurevya-search-suggestion.selected {
    background: #374151;
}

.suggestion-icon {
    width: 32px;
    height: 32px;
    background: #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.suggestion-icon i {
    font-size: 14px;
    color: #6b7280;
}

[data-theme="dark"] .suggestion-icon {
    background: #4b5563;
}

[data-theme="dark"] .suggestion-icon i {
    color: #d1d5db;
}

/* Category-specific icon colors */
.aurevya-search-suggestion[data-url*="index"] .suggestion-icon {
    background: #dbeafe;
}

.aurevya-search-suggestion[data-url*="index"] .suggestion-icon i {
    color: #3b82f6;
}

.aurevya-search-suggestion[data-url*="services"] .suggestion-icon,
.aurevya-search-suggestion[data-url*="enterprise"] .suggestion-icon,
.aurevya-search-suggestion[data-url*="fintech"] .suggestion-icon,
.aurevya-search-suggestion[data-url*="financial"] .suggestion-icon,
.aurevya-search-suggestion[data-url*="advisory"] .suggestion-icon {
    background: #dcfce7;
}

.aurevya-search-suggestion[data-url*="services"] .suggestion-icon i,
.aurevya-search-suggestion[data-url*="enterprise"] .suggestion-icon i,
.aurevya-search-suggestion[data-url*="fintech"] .suggestion-icon i,
.aurevya-search-suggestion[data-url*="financial"] .suggestion-icon i,
.aurevya-search-suggestion[data-url*="advisory"] .suggestion-icon i {
    color: #16a34a;
}

.aurevya-search-suggestion[data-url*="blog"] .suggestion-icon {
    background: #fef3c7;
}

.aurevya-search-suggestion[data-url*="blog"] .suggestion-icon i {
    color: #d97706;
}

.aurevya-search-suggestion[data-url*="contact"] .suggestion-icon {
    background: #fce7f3;
}

.aurevya-search-suggestion[data-url*="contact"] .suggestion-icon i {
    color: #be185d;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.4;
}

[data-theme="dark"] .suggestion-title {
    color: #ffffff;
}

.suggestion-title mark {
    background: #fbbf24;
    color: #111827;
    padding: 2px 4px;
    border-radius: 4px;
}

.suggestion-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="dark"] .suggestion-description {
    color: #9ca3af;
}

.suggestion-description mark {
    background: #fbbf24;
    color: #111827;
    padding: 1px 3px;
    border-radius: 3px;
}

.suggestion-category {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .suggestion-category {
    color: #6b7280;
}

.suggestion-shortcut {
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #9ca3af;
    font-size: 14px;
}

.aurevya-search-suggestion:hover .suggestion-shortcut,
.aurevya-search-suggestion.selected .suggestion-shortcut {
    opacity: 1;
}

/* No Results */
.aurevya-search-no-results {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

[data-theme="dark"] .aurevya-search-no-results {
    color: #9ca3af;
}

.aurevya-search-no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.aurevya-search-no-results p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.aurevya-search-no-results small {
    font-size: 14px;
    opacity: 0.7;
}

/* Search Footer */
.aurevya-search-footer {
    padding: 12px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

[data-theme="dark"] .aurevya-search-footer {
    border-top-color: #374151;
    background: #111827;
}

.aurevya-search-shortcuts {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #6b7280;
    align-items: center;
}

[data-theme="dark"] .aurevya-search-shortcuts {
    color: #9ca3af;
}

.aurevya-search-shortcuts kbd {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: inherit;
    margin-right: 4px;
}

[data-theme="dark"] .aurevya-search-shortcuts kbd {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

/* Body modifications when search is active */
body.search-active {
    overflow: hidden;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .aurevya-search-overlay {
        padding: 20px 16px;
        align-items: flex-start;
    }

    .aurevya-search-modal {
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }

    .aurevya-search-header {
        padding: 20px 16px 12px;
    }

    .aurevya-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .aurevya-search-suggestion {
        padding: 12px 16px;
    }

    .aurevya-search-section-title {
        padding: 12px 16px 8px;
    }

    .aurevya-search-footer {
        padding: 12px 16px;
    }

    .aurevya-search-shortcuts {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .suggestion-icon {
        width: 28px;
        height: 28px;
    }

    .suggestion-icon i {
        font-size: 12px;
    }

    .suggestion-title {
        font-size: 15px;
    }

    .suggestion-description {
        font-size: 13px;
    }
}

/* Animation for loading state */
.aurevya-search-overlay.loading .aurevya-search-modal {
    position: relative;
    overflow: hidden;
}

.aurevya-search-overlay.loading .aurevya-search-modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loading-shimmer 1.5s infinite;
}

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

/* Focus styles for accessibility */
.aurevya-search-suggestion:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.aurevya-search-close:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .aurevya-search-modal {
        border: 2px solid #000000;
    }

    .aurevya-search-suggestion:hover,
    .aurevya-search-suggestion.selected {
        background: #000000;
        color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .aurevya-search-overlay,
    .aurevya-search-modal,
    .aurevya-search-suggestion,
    .aurevya-search-close {
        transition: none;
    }

    .aurevya-search-overlay.loading .aurevya-search-modal::after {
        animation: none;
    }
}
