/* WordPress Auto Insert Icons - 前端样式 */

/* 主容器 - 居中显示 */
.wp-auto-insert-container {
    text-align: center;
    margin: 30px auto;
    padding: 25px 20px;
    clear: both;
    max-width: 100%;
    box-sizing: border-box;
}

/* 内容区域 - 垂直布局 */
.wp-auto-insert-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    gap: 15px;
}

/* 图标样式 - 在按钮上方 */
.wp-auto-insert-icon {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    order: 1; /* 图标在上方 */
}

.wp-auto-insert-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 按钮样式 - 在图标下方 */
.wp-auto-insert-button {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 120px;
    order: 2; /* 按钮在下方 */
}

/* 按钮悬停效果 */
.wp-auto-insert-button:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 按钮激活效果 */
.wp-auto-insert-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* 按钮焦点效果 */
.wp-auto-insert-button:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3), 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* 按钮波纹效果 */
.wp-auto-insert-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wp-auto-insert-button:active::before {
    width: 300px;
    height: 300px;
}

/* 主题兼容性 */

/* Twenty Twenty-One 主题兼容 */
.wp-block-post-content .wp-auto-insert-container,
.entry-content .wp-auto-insert-container {
    margin: 2em auto;
}

/* Twenty Twenty 主题兼容 */
.post-inner .wp-auto-insert-container {
    margin: 2rem auto;
}

/* Astra 主题兼容 */
.ast-article-post .wp-auto-insert-container {
    margin: 2em auto;
}

/* GeneratePress 主题兼容 */
.inside-article .wp-auto-insert-container {
    margin: 2em auto;
}

/* OceanWP 主题兼容 */
.entry-content .wp-auto-insert-container {
    margin: 2em auto;
}

/* Neve 主题兼容 */
.nv-content-wrap .wp-auto-insert-container {
    margin: 2em auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wp-auto-insert-container {
        margin: 20px auto;
        padding: 20px 15px;
    }

    .wp-auto-insert-content {
        gap: 12px; /* 减少间距 */
    }

    .wp-auto-insert-icon {
        max-width: 60px;
        max-height: 60px;
    }

    .wp-auto-insert-button {
        padding: 12px 24px;
        font-size: 15px;
        min-width: auto;
        width: auto;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .wp-auto-insert-container {
        margin: 15px auto;
        padding: 15px 10px;
    }

    .wp-auto-insert-content {
        gap: 10px; /* 进一步减少间距 */
    }

    .wp-auto-insert-icon {
        max-width: 50px;
        max-height: 50px;
    }

    .wp-auto-insert-button {
        padding: 10px 20px;
        font-size: 14px;
        max-width: 240px;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .wp-auto-insert-container {
        color: #e0e0e0;
    }
    
    .wp-auto-insert-icon {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    }
    
    .wp-auto-insert-icon:hover {
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .wp-auto-insert-button {
        background: #000000;
        color: #ffffff !important;
        border: 2px solid #ffffff;
    }
    
    .wp-auto-insert-button:hover {
        background: #ffffff;
        color: #000000 !important;
        border: 2px solid #000000;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .wp-auto-insert-icon,
    .wp-auto-insert-button,
    .wp-auto-insert-button::before {
        transition: none;
    }
    
    .wp-auto-insert-icon:hover {
        transform: none;
    }
    
    .wp-auto-insert-button:hover {
        transform: none;
    }
    
    .wp-auto-insert-button:active {
        transform: none;
    }
}

/* 打印样式 */
@media print {
    .wp-auto-insert-container {
        margin: 1em auto;
        padding: 1em;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .wp-auto-insert-button {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #000000;
        box-shadow: none;
    }
    
    .wp-auto-insert-button::before {
        display: none;
    }
    
    .wp-auto-insert-button:after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: #666;
    }
}

/* RTL 语言支持 */
.rtl .wp-auto-insert-icon {
    margin-right: 0;
    margin-left: 15px;
}

.rtl .wp-auto-insert-content {
    direction: rtl;
}

/* 辅助功能增强 */
.wp-auto-insert-button:focus-visible {
    outline: 3px solid #005cee;
    outline-offset: 2px;
}

/* 确保在各种容器中都能正确显示 */
.wp-auto-insert-container * {
    box-sizing: border-box;
}

/* 防止与其他插件样式冲突 */
.wp-auto-insert-container {
    font-family: inherit;
    line-height: inherit;
}

.wp-auto-insert-button {
    font-family: inherit;
}
