/**
 * AI推荐结果样式
 * 与deepseek_styles.css配合使用，提供AI结果展示的增强样式
 * 版本: 1.1.0 - UI统一更新
 */

/* AI搜索结果样式 */

/* 结果标题 */
.ai-results-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 195, 255, 0.3);
}

.ai-results-title h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #00ffaa;
}

.ai-results-title .highlight {
    color: #00c6d8;
    font-weight: 600;
}

.ai-explanation {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

/* 结果网格 */
.ai-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 解释说明 */
.ai-results-explanation {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 195, 255, 0.2);
}

.note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* 加载动画 */
.ai-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.loading-animation {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 255, 170, 0.2);
    border-top: 4px solid #00ffaa;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 标签样式 */
.ai-tag-pill {
    display: inline-block;
    background-color: rgba(0, 195, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 20px;
    margin: 0 8px 8px 0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 195, 255, 0.3);
}

.ai-tag-pill:hover {
    background-color: rgba(0, 195, 255, 0.3);
    transform: translateY(-2px);
}

.ai-tag-pill.selected {
    background-color: rgba(0, 255, 170, 0.8);
    color: #0a192f;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .ai-results-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .ai-results-title h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .ai-results-grid {
        grid-template-columns: 1fr;
    }
}

/* AI推荐容器 */
#ai-recommender-section {
    animation: fadeIn 0.5s ease;
    position: relative;
}

/* 输入组样式优化 */
.input-group {
    display: flex;
    margin-bottom: 10px;
    position: relative;
}

#ai-prompt {
    flex: 1;
    padding: 12px 15px;
    border-radius: 8px 0 0 8px;
    border: 1px solid rgba(0, 195, 255, 0.3);
    background: rgba(13, 33, 61, 0.8);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

#ai-prompt::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#get-recommendations {
    padding: 0 20px;
    border-radius: 0 8px 8px 0;
    border: 1px solid rgba(0, 195, 255, 0.3);
    background: rgba(0, 195, 255, 0.2);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#get-recommendations:hover {
    background: rgba(0, 195, 255, 0.4);
}

#get-recommendations i {
    margin-right: 8px;
    font-size: 18px;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
    
    #ai-prompt {
        border-radius: 8px 8px 0 0;
    }
    
    #get-recommendations {
        border-radius: 0 0 8px 8px;
        padding: 10px;
    }
}

#ai-prompt:focus + #get-recommendations {
    border-color: rgba(0, 255, 170, 0.5);
}

#get-recommendations:active {
    transform: scale(0.98);
}

/* 联系按钮样式 */
.contact-btn {
    display: none;
}

@keyframes borderPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 170, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 170, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 170, 0); }
}

#ai-prompt {
    box-shadow: 0 0 0 0 rgba(0, 255, 170, 0);
    animation: none;
}

.loading-animation .spinner {
    animation: spin 0.8s linear infinite;
}

.ai-recommender-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.ai-recommender-header i {
    font-size: 2rem;
    color: #00ffaa;
    background: rgba(0, 255, 170, 0.1);
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.2);
}

.ai-recommender-header h3 {
    font-size: 1.8rem;
    margin: 0;
    color: white;
}

.recommender-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 800px;
}

@media (max-width: 480px) {
    .ai-recommender-header h3 {
        font-size: 1.5rem;
    }
    
    .recommender-desc {
        font-size: 0.9rem;
    }
    
    #get-recommendations span {
        display: none;
    }
    
    #get-recommendations i {
        margin-right: 0;
    }
}

.ai-results-placeholder {
    text-align: center;
    padding: 40px 0;
    color: rgba(255, 255, 255, 0.5);
}

/* 新增匹配原因样式 */
.match-reason {
    background: rgba(52, 152, 219, 0.15);
    border-radius: 4px;
    padding: 6px 8px;
    margin: 6px 0;
    font-size: 12px;
    color: #9cdbfe;
    line-height: 1.4;
}

/* 气味ID标签样式 */
.scent-id-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 255, 170, 0.8);
    color: #0a192f;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 卡片图片样式 */
.card-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.scent-card:hover .card-image img {
    transform: scale(1.05);
}

/* 位置标签样式 */
.location-badge {
    display: inline-block;
    background: rgba(0, 195, 255, 0.15);
    color: #4facfe;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 5px;
    border: 1px solid rgba(0, 195, 255, 0.3);
}

/* 卡片分类文本 */
.category-text {
    color: rgba(255, 255, 255, 0.7);
}

/* 联系部分样式 */
.contact-section {
    display: none;
}

.contact-icon {
    display: none;
}

.contact-content {
    display: none;
}

.contact-content h4 {
    display: none;
}

.contact-btn:hover {
    display: none;
}

/* 结果容器样式 */
.results-container {
    animation: fadeIn 0.5s ease;
}

.results-header {
    margin-bottom: 20px;
}

.results-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00ffaa;
    margin-bottom: 10px;
}

.prompt-display {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.prompt-display span {
    color: #4facfe;
    font-weight: 500;
}

.recommendations-section {
    margin-bottom: 30px;
}

.recommendations-section h4 {
    color: white;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 195, 255, 0.2);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommendations-section h4 i {
    font-size: 1.5rem;
    color: #00ffaa;
}

/* API错误样式 */
.api-error {
    text-align: center;
    padding: 40px 20px;
    background: rgba(13, 33, 61, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.error-icon {
    font-size: 2.5rem;
    color: rgba(255, 59, 48, 0.8);
    margin-bottom: 15px;
}

.api-error h4 {
    color: rgba(255, 59, 48, 0.8);
    margin-bottom: 10px;
}

.error-detail {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 4px;
    margin: 15px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.retry-btn {
    background: rgba(0, 195, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.retry-btn:hover {
    background: rgba(0, 195, 255, 0.4);
}

/* Library recommendations specific styling (if any needed beyond generic .recommendations-section) */
.library-recommendations {
    /* Можно добавить специфичные стили для этого блока, если нужно */
}

/* External (innovative) recommendations styling */
.external-recommendations {
    margin-top: 40px;
}

.external-scent-card {
    border: 1px solid rgba(0, 255, 170, 0.3);
    background-color: rgba(10, 30, 50, 0.5);
}

.external-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 255, 170, 0.8);
    color: #0a192f;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
}

.external-badge i {
    font-size: 1rem;
}

.external-scent-card .card-reason i, 
.external-scent-card .card-category i {
    color: #00ffaa;
}

/* Contact for customization section */
.contact-customization-section {
    margin-top: 30px;
    padding: 25px;
    text-align: center;
    background-color: rgba(10, 25, 40, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(0, 195, 255, 0.2);
}

.contact-customization-section p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.contact-customization-section p i {
    font-size: 1.3rem;
    color: #00ffaa;
}

/* Make the new contact button visible and styled */
#contact-for-customization.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #00ffaa;
    color: #0a192f;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 255, 170, 0.2);
}

#contact-for-customization.contact-btn:hover {
    background-color: #00e099;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 170, 0.3);
}

#contact-for-customization.contact-btn i {
    font-size: 1.2rem;
}

/* Ensure any previous generic .contact-btn display:none does not override */
/* This can be handled by specificity or by removing the old rule if no longer needed */
.contact-btn#contact-for-customization {
    display: inline-flex !important;
}

/* Ensure the icons in the new sections are styled if not covered by global icon styles */
.recommendations-section h4 i,
.external-badge i,
.contact-customization-section p i,
#contact-for-customization.contact-btn i {
    /* Basic reset or common style if needed, e.g., vertical-align: middle; */
}

/* General styling for scent cards if not already present or needing override */
.scent-card {
    /* ... ensure common scent card styles like background, border-radius, padding, box-shadow ... */
    /* Example, assuming these are already in deepseek_styles.css or similar */
    background-color: rgba(13, 33, 61, 0.7);
    border: 1px solid rgba(0, 195, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.scent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 195, 255, 0.2);
}

.scent-card .card-image {
    height: 180px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.scent-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scent-card .card-title {
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 10px;
}

.scent-card .card-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin-bottom: 12px;
    min-height: 50px;
}

.scent-card .card-reason {
    font-size: 0.85rem;
    color: rgba(0, 255, 170, 0.9);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scent-card .card-category {
    font-size: 0.85rem;
    color: rgba(0, 195, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.scent-card .category-tag {
    background-color: rgba(0, 195, 255, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Ensure API error message is styled well */
.api-error {
    padding: 20px;
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 8px;
    text-align: center;
    color: rgba(255,255,255,0.8);
}
.api-error .error-icon i {
    font-size: 2rem;
    color: rgba(255,100,100,0.9);
    margin-bottom: 10px;
}
.api-error h4 {
    color: white;
    margin-bottom: 10px;
}

/* AI结果卡片样式优化 */
.library-scent-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.library-scent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* 图片加载优化 */
.library-scent-card img {
    transition: opacity 0.3s ease;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.library-scent-card img[loading="lazy"]:not(.loaded) {
    opacity: 0;
}

.library-scent-card img.loaded, 
.library-scent-card img:not([loading="lazy"]) {
    opacity: 1;
}

/* 优化延迟加载过程中的用户体验 */
.card-image {
    position: relative;
    background-color: rgba(10, 25, 47, 0.6);
    min-height: 180px;
}

/* 图片加载中的placeholder效果 */
.card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        rgba(10, 25, 47, 0.1) 25%, 
        rgba(20, 40, 70, 0.3) 37%, 
        rgba(10, 25, 47, 0.1) 63%
    );
    background-size: 400% 100%;
    animation: loading 1.4s ease infinite;
    z-index: 0;
}

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

.card-image img {
    position: relative;
    z-index: 1;
}

/* 卡片内容样式优化 */
.library-scent-card .card-content {
    padding: 12px;
}

/* 推荐理由样式增强 */
.card-reason {
    color: rgba(0, 255, 170, 0.85);
    font-weight: 300;
    margin: 8px 0;
    font-style: italic;
    font-size: 0.9em;
    line-height: 1.4;
} 