/**
 * AI Navigator 动态功能样式
 * 
 * 用于AJAX交互、工具卡片增强等动态功能
 *
 * @package AI_Navigator
 * @since 2.1.0
 */

/* ========================================
   工具卡片增强样式
   ======================================== */

/* 卡片徽章 */
.tool-card {
    position: relative;
}

.tool-card-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.tool-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.4;
}

.tool-badge-featured {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.tool-badge-hot {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.tool-badge-new {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
}

/* 卡片图标图片 */
.tool-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* 卡片元信息 */
.tool-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
}

.tool-pricing {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.tool-pricing-free {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.tool-pricing-freemium {
    background: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

.tool-pricing-paid {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.tool-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #f5a623;
}

.tool-rating svg {
    fill: #f5a623;
}

/* ========================================
   分类计数标签
   ======================================== */

.topbar-link .cat-count {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 11px;
    opacity: 0.7;
}

.topbar-link.active .cat-count {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* ========================================
   搜索框增强
   ======================================== */

.search-box {
    position: relative;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.search-clear:hover {
    opacity: 1;
}

/* 搜索结果信息 */
.search-results-info {
    padding: 10px 15px;
    margin-bottom: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary, #666);
}

/* ========================================
   Section增强
   ======================================== */

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon svg {
    width: 24px;
    height: 24px;
}

.section-count {
    margin-left: auto;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary, #888);
}

/* ========================================
   无工具提示
   ======================================== */

.no-tools-found {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary, #888);
}

.no-tools-found svg {
    margin-bottom: 20px;
    opacity: 0.4;
}

.no-tools-found p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary, #333);
}

.no-tools-found span {
    font-size: 14px;
    opacity: 0.7;
}

.btn-add-tool {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   加载更多
   ======================================== */

.load-more-container {
    display: flex;
    justify-content: center;
    padding: 30px 0;
}

.btn-load-more {
    padding: 12px 40px;
    background: transparent;
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   加载状态
   ======================================== */

.tools-grid.loading {
    position: relative;
    min-height: 200px;
    pointer-events: none;
}

.tools-grid.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    z-index: 100;
}

.tools-grid.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 101;
}

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

/* ========================================
   工具卡片悬停动画增强
   ======================================== */

.tool-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   深色模式适配
   ======================================== */

[data-theme="dark"] .search-results-info {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .no-tools-found p {
    color: #fff;
}

[data-theme="dark"] .section-count {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   浅色模式适配
   ======================================== */

[data-theme="light"] .tool-badge-featured {
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

[data-theme="light"] .tool-badge-hot {
    box-shadow: 0 2px 4px rgba(245, 87, 108, 0.3);
}

[data-theme="light"] .tool-badge-new {
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.3);
}

[data-theme="light"] .tools-grid.loading::after {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .btn-load-more {
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

[data-theme="light"] .btn-load-more:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.25);
}

/* ========================================
   响应式调整
   ======================================== */

@media (max-width: 768px) {
    .section-header {
        flex-wrap: wrap;
    }
    
    .section-count {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        text-align: center;
    }
    
    .tool-card-badges {
        top: 6px;
        right: 6px;
    }
    
    .tool-badge {
        font-size: 9px;
        padding: 2px 5px;
    }
    
    .no-tools-found {
        padding: 40px 15px;
    }
    
    .no-tools-found svg {
        width: 40px;
        height: 40px;
    }
    
    .no-tools-found p {
        font-size: 16px;
    }
}

/* ========================================
   工具详情页样式
   ======================================== */

.tool-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
}

.tool-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.tool-detail-icon {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-detail-icon svg {
    width: 60px;
    height: 60px;
    opacity: 0.5;
}

.tool-detail-info {
    flex: 1;
}

.tool-detail-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tool-detail-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.tool-detail-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tool-views {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary, #888);
    font-size: 14px;
}

.btn-visit-tool {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-visit-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.tool-detail-content {
    margin-bottom: 30px;
}

.tool-excerpt {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary, #666);
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-description {
    font-size: 16px;
    line-height: 1.8;
}

.tool-description h2,
.tool-description h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.tool-description p {
    margin-bottom: 15px;
}

.tool-description ul,
.tool-description ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.tool-description li {
    margin-bottom: 8px;
}

.tool-tags,
.tool-categories {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tags-label,
.categories-label {
    color: var(--text-secondary, #888);
    font-size: 14px;
}

.tool-tag,
.tool-category {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary, #fff);
    text-decoration: none;
    transition: background 0.2s;
}

.tool-tag:hover,
.tool-category:hover {
    background: rgba(255, 255, 255, 0.1);
}

.related-tools {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 工具详情页响应式 */
@media (max-width: 768px) {
    .tool-detail {
        padding: 20px;
    }
    
    .tool-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .tool-detail-icon {
        width: 100px;
        height: 100px;
    }
    
    .tool-detail-badges {
        justify-content: center;
    }
    
    .tool-detail-title {
        font-size: 22px;
    }
    
    .tool-detail-meta {
        justify-content: center;
    }
    
    .btn-visit-tool {
        width: 100%;
        justify-content: center;
    }
}
