/* NexusSearch Custom Styles */

:root {
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --transition-base: 150ms ease;
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

*::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 0.25rem;
}

*::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.4); }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Search Mode Buttons */
.search-mode-btn {
    color: #9ca3af;
}

.search-mode-btn.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

.dark .search-mode-btn.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

/* View Mode Buttons */
.view-mode-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #6b7280;
    transition: all var(--transition-base);
}

.view-mode-btn:hover {
    color: #9ca3af;
}

.view-mode-btn.active {
    background: #3b82f6;
    color: white;
}

/* Search Container Focus */
.search-container:focus-within {
    animation: pulse-glow 2s infinite;
}

/* Result Cards */
.result-card {
    animation: fadeIn 0.3s ease-out;
    animation-fill-mode: both;
}

.result-card:nth-child(1) { animation-delay: 0ms; }
.result-card:nth-child(2) { animation-delay: 50ms; }
.result-card:nth-child(3) { animation-delay: 100ms; }
.result-card:nth-child(4) { animation-delay: 150ms; }
.result-card:nth-child(5) { animation-delay: 200ms; }

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.dark .skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

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

.modal {
    background: #1e293b;
    border-radius: 1rem;
    max-width: 40rem;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.dark .modal {
    background: white;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark .modal-header {
    border-bottom-color: #e5e7eb;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(85vh - 8rem);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #374151;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.dark .modal-footer {
    border-top-color: #e5e7eb;
}

/* Toast Notifications */
.toast {
    background: #1e293b;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dark .toast {
    background: white;
    border-color: #e5e7eb;
}

.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.warning { border-left: 4px solid #f59e0b; }
.toast.info { border-left: 4px solid #3b82f6; }

/* Prose Customization */
.prose-invert {
    --tw-prose-body: #d1d5db;
    --tw-prose-headings: #f3f4f6;
    --tw-prose-links: #60a5fa;
}

/* Media Thumbnails */
.media-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    aspect-ratio: 16/9;
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-thumb:hover img {
    transform: scale(1.05);
}

/* Line Clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 640px) {
    .search-container input {
        font-size: 1rem;
    }

    #btn-search {
        padding: 0.5rem 1rem;
    }
}
