/* ===== Search Modal Styles ===== */

.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.search-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal-content {
    background: #fff;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

/* Header */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #000a3d, #e2002b);
    color: #fff;
}

.search-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.search-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    padding: 20px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    font-size: 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-input:focus {
    border-color: #000a3d;
    box-shadow: 0 0 0 3px rgba(0, 10, 61, 0.1);
}

.search-icon {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.2rem;
}

/* Results */
.search-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: 12px;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.search-results-count {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.search-placeholder,
.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.search-no-results i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.search-no-results p {
    margin: 12px 0;
    font-size: 1.1rem;
    color: #374151;
}

.search-no-results small {
    color: #6b7280;
}

/* Result Items */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.search-result-item:hover,
.search-result-item.active {
    background: #f3f4f6;
}

.search-result-item.active {
    background: #e5e7eb;
    border-left: 3px solid #000a3d;
}

.result-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #000a3d, #e2002b);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.result-title mark {
    background: #fef08a;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.result-category {
    font-size: 0.85rem;
    color: #6b7280;
}

.result-arrow {
    color: #9ca3af;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.search-result-item:hover .result-arrow,
.search-result-item.active .result-arrow {
    opacity: 1;
    color: #000a3d;
}

/* Footer */
.search-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 0.85rem;
    color: #6b7280;
}

.search-footer kbd {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-family: monospace;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-modal.active {
        padding-top: 0;
        align-items: stretch;
    }
    
    .search-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
    }
    
    .search-results {
        max-height: calc(100vh - 200px);
    }
    
    .search-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .result-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .result-title {
        font-size: 0.95rem;
    }
}
