/* 포트폴리오 검색 팝업 스타일 */
.portfolio-search-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.portfolio-search-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: portfolioSearchSlideIn 0.3s ease-out;
}

@keyframes portfolioSearchSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.portfolio-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.portfolio-search-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.portfolio-search-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.portfolio-search-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.portfolio-search-body {
    padding: 30px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.search-input-group input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input-group button {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.search-examples {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.search-examples p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #333;
}

.search-examples ul {
    margin: 0;
    padding-left: 20px;
}

.search-examples li {
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.search-results {
    min-height: 200px;
}

.search-results.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.search-results.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.portfolio-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
    cursor:pointer;
}

.portfolio-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.portfolio-item-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.portfolio-item-content {
    flex: 1;
}

.portfolio-item-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
}

.portfolio-item-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    margin-bottom: 8px;
}

.portfolio-item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.portfolio-item-detail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.portfolio-item-detail strong {
    color: #333;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-results i {
    font-size: 48px;
    color: #e1e5e9;
    margin-bottom: 15px;
    display: block;
}

/* 검색 버튼 스타일 */
.portfolio-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.portfolio-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .portfolio-search-container {
        width: 95%;
        margin: 20px;
    }

    .portfolio-search-header {
        padding: 15px 20px;
    }

    .portfolio-search-header h3 {
        font-size: 20px;
    }

    .portfolio-search-body {
        padding: 20px;
    }

    .search-input-group {
        flex-direction: column;
    }

    .search-input-group button {
        width: 100%;
    }

    .portfolio-item {
        flex-direction: column;
        gap: 15px;
    }

    .portfolio-item-image {
        width: 100%;
        height: 150px;
    }

    .portfolio-item-details {
        grid-template-columns: 1fr;
    }
}

/* 에러 메시지 스타일 */
.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c33;
    margin-bottom: 20px;
}

/* 성공 메시지 스타일 */
.success-message {
    background: #efe;
    color: #363;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #363;
    margin-bottom: 20px;
}


/* 대화 기록 관련 스타일 */
.conversation-context {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: none;
}

.conversation-context-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
}

.conversation-context-content {
    max-height: 150px;
    overflow-y: auto;
}

.conversation-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.conversation-question {
    color: #6c757d;
    font-style: italic;
    display: block;
    margin-bottom: 5px;
}

.conversation-answer {
    color: #495057;
    font-size: 12px;
    background: #e9ecef;
    padding: 5px;
    border-radius: 3px;
    margin-top: 5px;
}

.conversation-help {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.conversation-help h4 {
    margin: 0 0 10px 0;
    color: #1976d2;
    font-size: 16px;
}

.conversation-help ul {
    margin: 0;
    padding-left: 20px;
}

.conversation-help li {
    margin-bottom: 5px;
    color: #424242;
    font-size: 14px;
}

.conversation-help-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s;
}

.conversation-help-btn:hover {
    background: #5a6268;
}

.conversation-clear-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s;
}

.conversation-clear-btn:hover {
    background: #c82333;
}