/**
 * 舌诊报告推荐模块样式
 * 包含推荐卡片、加载动画、交互效果等样式
 */

/* ========== 推荐板块容器 ========== */
.recommendations-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.recommendations-container {
    position: relative;
    min-height: 300px;
}

/* ========== 加载动画 ========== */
.recommendations-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.recommendations-loading p {
    color: #666;
    font-size: 15px;
    margin: 0;
}

/* ========== 推荐内容容器 ========== */
.recommendations-content {
    display: block;
}

.recommendation-category {
    margin-bottom: 40px;
}

.recommendation-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
    display: flex;
    align-items: center;
}

.category-icon {
    font-size: 24px;
    margin-right: 10px;
}

/* ========== 推荐列表 ========== */
.recommendation-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .recommendation-list {
        grid-template-columns: 1fr;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .recommendation-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== 推荐卡片通用样式 ========== */
.recommendation-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ========== 卡片图片 ========== */
.card-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f5f5f5;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recommendation-card:hover .card-image img {
    transform: scale(1.05);
}

.card-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* ========== 卡片内容 ========== */
.card-content {
    padding: 15px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
}

/* ========== 产品卡片特有样式 ========== */
.product-card .card-price {
    font-size: 20px;
    font-weight: 700;
    color: #FF6B6B;
}

.product-card .card-original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

/* ========== 门店卡片特有样式 ========== */
.store-card .card-location {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    color: #666;
    margin: 8px 0;
    line-height: 1.5;
}

.store-card .location-icon {
    font-size: 16px;
    margin-right: 6px;
    flex-shrink: 0;
}

.store-card .card-distance {
    font-size: 13px;
    color: #4CAF50;
    font-weight: 600;
}

.store-card .card-rating {
    font-size: 13px;
    color: #FFA000;
    font-weight: 600;
}

/* ========== 医生卡片特有样式 ========== */
.doctor-card .card-image {
    height: 200px;
}

.doctor-card .card-image img {
    object-fit: contain;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.doctor-card .doctor-title {
    display: inline-block;
    background: #4CAF50;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.doctor-card .card-hospital {
    font-size: 14px;
    color: #666;
    margin: 5px 0 10px 0;
}

.doctor-card .doctor-expertise {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

.doctor-card .doctor-expertise strong {
    color: #333;
}

.doctor-card .doctor-experience,
.doctor-card .doctor-patients {
    font-size: 12px;
    color: #666;
}

/* ========== 卡片操作按钮 ========== */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.card-actions button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: #fff;
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

.btn-outline:hover {
    background: #4CAF50;
    color: #fff;
}

/* ========== 错误状态 ========== */
.recommendations-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.error-message {
    font-size: 16px;
    color: #666;
    margin: 0 0 25px 0;
}

.btn-retry {
    padding: 12px 30px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* ========== 移动端优化 ========== */
@media (max-width: 768px) {
    .recommendations-section {
        padding: 15px;
        margin-top: 20px;
    }

    .category-title {
        font-size: 18px;
    }

    .card-image {
        height: 160px;
    }

    .card-content {
        padding: 12px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-description {
        font-size: 13px;
    }

    .card-actions {
        flex-direction: column;
    }

    .card-actions button {
        width: 100%;
    }

    .product-card .card-price {
        font-size: 18px;
    }

    .doctor-card .card-image {
        height: 180px;
    }
}

/* ========== 空状态 ========== */
.recommendations-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-message {
    font-size: 16px;
    color: #999;
    margin: 0;
}

/* ========== 骨架屏加载动画 ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 350px;
    border-radius: 10px;
}

/* ========== 过渡动画 ========== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 响应式布局优化 ========== */
@media (min-width: 1025px) {
    .recommendation-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

/* ========== 打印样式 ========== */
@media print {
    .recommendations-section {
        display: none;
    }
}

/* ========== 面诊个性化推荐模块样式 ========== */
.recommendation-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.recommendation-subsection {
    margin-bottom: 20px;
}

.recommendation-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.recommendation-loading .spinner-small {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4b6cb7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.product-grid,
.store-grid,
.doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.product-card,
.store-card,
.doctor-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-card:hover,
.store-card:hover,
.doctor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-image,
.store-image,
.doctor-avatar {
    width: 100%;
    height: 150px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.product-image img,
.store-image img,
.doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info,
.store-info,
.doctor-info {
    padding-top: 10px;
}

.product-name,
.store-name,
.doctor-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.product-description,
.store-address,
.store-phone,
.doctor-title,
.doctor-specialty {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.product-benefit,
.store-services,
.store-hours,
.doctor-experience,
.doctor-description {
    font-size: 13px;
    color: #555;
    margin: 8px 0;
    line-height: 1.5;
}

.product-footer,
.store-footer,
.doctor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b6b;
}

.doctor-rating {
    font-size: 13px;
    color: #f39c12;
}

.doctor-price {
    font-size: 14px;
    color: #666;
}

.product-btn,
.store-btn,
.doctor-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.product-btn:hover,
.store-btn:hover,
.doctor-btn:hover {
    background: linear-gradient(135deg, #182848 0%, #4b6cb7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(75, 108, 183, 0.3);
}

.empty-recommendation {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-recommendation p {
    margin: 0;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .product-grid,
    .store-grid,
    .doctor-grid {
        grid-template-columns: 1fr;
    }

    .recommendation-section {
        padding: 15px;
    }
}
