/* ================================================
   AI Search Modal Styles
   ================================================ */

/* 검색 모달 오버레이 */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.search-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

/* 검색 모달 콘텐츠 */
.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    z-index: 10000;
}

/* 검색 모달 헤더 */
.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.search-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.search-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.2rem;
}

.search-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 검색 모달 바디 */
.search-modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* 검색 결과 아이템 */
.search-result-item {
    background: #262019;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.search-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(196, 86, 61, 0.2);
    border-color: var(--primary-color);
}

.search-result-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-result-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.search-result-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.search-result-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 1rem;
}

.search-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.search-result-tag {
    padding: 0.375rem 0.75rem;
    background: rgba(196, 86, 61, 0.1);
    color: var(--primary-color);
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.search-result-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* 검색 결과 없음 */
.search-no-results {
    text-align: center;
    padding: 3rem 2rem;
}

.search-no-results-icon {
    font-size: 4rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.search-no-results h4 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.search-no-results p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 로딩 스피너 */
.search-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.search-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(196, 86, 61, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.search-loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 스크롤바 스타일 */
.search-modal-body::-webkit-scrollbar {
    width: 8px;
}

.search-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.search-modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.search-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .search-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .search-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .search-modal-header h3 {
        font-size: 1.25rem;
    }
    
    .search-modal-body {
        padding: 1.5rem;
    }
    
    .search-result-item {
        padding: 1rem;
    }
    
    .search-result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-result-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .search-result-title {
        font-size: 1.1rem;
    }
    
    .search-result-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .search-modal-content {
        width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
    }
    
    .search-modal-body {
        padding: 1rem;
    }
    
    .search-result-item {
        padding: 0.875rem;
        margin-bottom: 1rem;
    }
}
