/* Elementor Template Importer - 前端样式 */

/* 小部件容器 */
.template-importer-widget {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.template-importer-widget:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 小部件内容 */
.template-importer-content {
    max-width: 100%;
}

/* 标题样式 */
.template-importer-title {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

/* 描述样式 */
.template-importer-description {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

/* 按钮样式 */
.template-importer-button {
    background: #007cba;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    min-width: 150px;
}

.template-importer-button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
}

.template-importer-button:active {
    transform: translateY(0);
}

/* 模态框样式 */
.template-importer-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.template-importer-modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模态框头部 */
.template-importer-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.template-importer-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.template-importer-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.template-importer-close:hover {
    color: #333;
}

/* 模态框主体 */
.template-importer-modal-body {
    padding: 30px;
}

/* 模板分类 */
.template-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.category-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.category-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.category-btn.active {
    background: #007cba;
    color: #ffffff;
    border-color: #007cba;
}

/* 模板网格 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.template-item {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.template-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #007cba;
}

.template-item-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.template-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-item-content {
    padding: 20px;
}

.template-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.template-item-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.template-item-actions {
    display: flex;
    gap: 10px;
}

.template-item-btn {
    flex: 1;
    background: #007cba;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.template-item-btn:hover {
    background: #005a87;
}

.template-item-btn.secondary {
    background: #6c757d;
}

.template-item-btn.secondary:hover {
    background: #545b62;
}

/* 加载状态 */
.template-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 模板预览模态框 */
.template-preview-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.template-preview-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
}

.template-preview-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-preview-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.template-preview-close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.template-preview-close:hover {
    color: #333;
}

.template-preview-modal-body {
    padding: 30px;
}

.template-preview-image {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.template-preview-image img {
    width: 100%;
    height: auto;
    display: block;
}

.template-preview-info h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.template-preview-info p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.5;
}

.template-preview-actions {
    display: flex;
    gap: 15px;
}

.import-btn, .preview-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.import-btn {
    background: #007cba;
    color: #ffffff;
}

.import-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.preview-btn {
    background: #6c757d;
    color: #ffffff;
}

.preview-btn:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .template-importer-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .template-importer-modal-header,
    .template-importer-modal-body {
        padding: 20px;
    }
    
    .template-importer-title {
        font-size: 20px;
    }
    
    .template-importer-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .template-categories {
        flex-direction: column;
        align-items: stretch;
    }
    
    .category-btn {
        text-align: center;
    }
    
    .template-preview-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .template-preview-actions {
        flex-direction: column;
    }
    
    .import-btn, .preview-btn {
        margin-bottom: 10px;
    }
}

/* 消息提示 */
.template-importer-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

.template-importer-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.template-importer-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
