/* Modern Search Modal - Lightweight, CSS-only animations */

/* Search Modal Overlay */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: opacity 200ms ease-out;
}

.search-modal-overlay.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 1;
}

/* Search Modal Container */
.search-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 200ms ease-out, opacity 200ms ease-out;
    overflow: hidden;
}

.search-modal-overlay.show .search-modal {
    transform: translateY(0);
    opacity: 1;
}

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

/* Search Input Section */
.search-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

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

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

.search-input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    pointer-events: none;
    font-size: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
    background: #ffffff;
    color: #1a1a1a;
}

[data-bs-theme="dark"] .search-input {
    background: #111827;
    border-color: #374151;
    color: #f9fafb;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Search Type Selector */
.search-type-selector {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.search-type-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease-out;
}

[data-bs-theme="dark"] .search-type-btn {
    background: #111827;
    border-color: #374151;
    color: #d1d5db;
}

.search-type-btn:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
    color: #374151;
}

[data-bs-theme="dark"] .search-type-btn:hover {
    background: #1f2937;
    border-color: #4b5563;
    color: #f9fafb;
}

.search-type-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
}

/* Search Results Container */
.search-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 200px;
    max-height: calc(80vh - 140px);
}

/* Loading State */
.search-loading {
    display: none;
    padding: 40px;
    text-align: center;
    color: #6b7280;
}

.search-loading.show {
    display: block;
}

.search-loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.skeleton-item {
    height: 60px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

[data-bs-theme="dark"] .skeleton-item {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Empty State */
.search-empty {
    display: none;
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

.search-empty.show {
    display: block;
}

.search-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-empty-text {
    font-size: 14px;
    margin-top: 8px;
}

/* Result Groups */
.search-result-group {
    margin-bottom: 16px;
}

.search-result-group-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
}

[data-bs-theme="dark"] .search-result-group-header {
    background: #111827;
    color: #9ca3af;
}

/* Result Items */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 100ms ease-out, transform 150ms ease-out;
    margin-bottom: 4px;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

[data-bs-theme="dark"] .search-result-item:hover {
    background-color: #1f2937;
}

.search-result-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 20px;
    flex-shrink: 0;
}

.search-result-icon.domains {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.search-result-icon.contacts {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.search-result-icon.monitoring {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.search-result-icon.watchlist {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.search-result-icon.ai {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.search-result-icon.tickets {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.search-result-icon.folders {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.search-result-icon.status-pages {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.search-result-icon.users {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

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

.search-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-bs-theme="dark"] .search-result-title {
    color: #f9fafb;
}

.search-result-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

[data-bs-theme="dark"] .search-result-meta {
    color: #9ca3af;
}

.search-result-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    background: #e5e7eb;
    color: #374151;
}

[data-bs-theme="dark"] .search-result-badge {
    background: #374151;
    color: #d1d5db;
}

.search-result-badge.active {
    background: #d1fae5;
    color: #065f46;
}

[data-bs-theme="dark"] .search-result-badge.active {
    background: #064e3b;
    color: #6ee7b7;
}

.search-result-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

[data-bs-theme="dark"] .search-result-badge.inactive {
    background: #7f1d1d;
    color: #fca5a5;
}

/* Highlight matching text */
.search-result-title mark,
.search-result-meta mark {
    background: #fef08a;
    color: #854d0e;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

[data-bs-theme="dark"] .search-result-title mark,
[data-bs-theme="dark"] .search-result-meta mark {
    background: #854d0e;
    color: #fef08a;
}

/* Search Footer */
.search-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    background: #f8f9fa;
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-modal-overlay.show {
        padding-top: 0;
        align-items: stretch;
    }
    
    .search-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }
    
    .search-modal-body {
        max-height: calc(100vh - 140px);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .search-modal-overlay,
    .search-modal,
    .search-result-item,
    .search-input {
        transition: none;
    }
    
    .skeleton-item {
        animation: none;
    }
}

