/* wp-content/plugins/llm-english-explainer/assets/css/frontend.css */

/* 简码容器整体样式 */
.lee-shortcode-wrap {
    margin: 2em auto; /* 上下边距，左右自动居中 (如果父容器允许) */
    padding: 25px 30px; /* 增加内边距 */
    border: 1px solid #e0e0e0;
    border-radius: 5px; /* 稍圆润的边角 */
    background-color: #ffffff; /* 白色背景 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* 更柔和的阴影 */
    max-width: 900px; /* 限制最大宽度 */
}

.lee-shortcode-wrap h2 {
    margin-top: 0;
    margin-bottom: 15px; /* 增加标题下方间距 */
    font-size: 1.6em; /* 稍大一点的标题 */
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    color: #2c3e50; /* 深蓝灰色 */
}

.lee-shortcode-wrap p {
    margin-bottom: 25px; /* 增加段落下方间距 */
    color: #555;
    font-size: 1em;
    line-height: 1.6;
}

/* 参数区域样式 */
.lee-frontend-parameters {
    display: grid; /* 使用 Grid 布局 */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 响应式列 */
    gap: 20px; /* 网格间距 */
    margin-bottom: 30px; /* 增加下方间距 */
    padding: 20px;
    background-color: #f8f9fa; /* 浅灰色背景 */
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.lee-param-group {
    display: flex;
    flex-direction: column; /* 标签和输入框垂直排列 */
    gap: 6px; /* 标签和输入框间距 */
}

.lee-param-group label {
    font-weight: 600;
    font-size: 14px;
    color: #495057; /* 调整颜色 */
}

.lee-param-group input[type="text"] {
    padding: 8px 12px; /* 增加内边距 */
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    width: 100%; /* 宽度占满网格单元 */
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lee-param-group input[type="text"]:focus {
    border-color: #80bdff; /* 淡蓝色聚焦边框 */
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* 聚焦辉光效果 */
    outline: none;
}

/* 左右布局容器 */
.lee-frontend-container {
    display: flex;
    gap: 30px; /* 增加左右间距 */
    margin-top: 20px;
}

.lee-frontend-left,
.lee-frontend-right {
    flex: 1;
    min-width: 0; 
}

.lee-frontend-left h3,
.lee-frontend-right h3 {
    margin-top: 0;
    margin-bottom: 15px; /* 增加下方间距 */
    font-size: 1.2em;
    color: #343a40; /* 深灰色 */
}

/* 输入框 */
#lee-frontend-input {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 15px; /* 稍大字体 */
    line-height: 1.7;
    min-height: 250px; /* 增加最小高度 */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#lee-frontend-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* 按钮容器 */
.lee-buttons-container {
    margin-bottom: 20px; /* 增加下方间距 */
    display: flex;
    gap: 12px;
    flex-wrap: wrap; 
}

/* 通用按钮样式 */
.lee-button {
    display: inline-flex; 
    align-items: center;
    gap: 6px; /* 图标和文字间距 */
    padding: 10px 18px; /* 调整按钮大小 */
    font-size: 15px;
    font-weight: 500; /* 稍粗字体 */
    line-height: 1.5;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease-in-out; /* 平滑过渡 */
}

.lee-button .dashicons {
    font-size: 18px;
    line-height: 1;
    height: auto;
    width: auto;
    vertical-align: middle;
    margin-top: -1px; /* 微调图标垂直对齐 */
}

/* 主按钮样式 */
.lee-button.primary {
    background-color: #007bff; /* Bootstrap 主题蓝 */
    border-color: #007bff;
    color: #fff;
}
.lee-button.primary:hover,
.lee-button.primary:focus {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5); /* 聚焦辉光 */
    outline: none;
}
.lee-button.primary:disabled,
.lee-button.primary.lee-button-loading { /* 添加加载中状态 */
    background-color: #6c757d; /* 灰色 */
    border-color: #6c757d;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.65;
}

/* 次要按钮样式 (复制按钮) */
.lee-button.secondary {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #495057;
}
.lee-button.secondary:hover,
.lee-button.secondary:focus {
    background-color: #e2e6ea;
    border-color: #dae0e5;
    color: #343a40;
    box-shadow: 0 0 0 0.2rem rgba(211, 212, 213, 0.5); /* 灰色辉光 */
    outline: none;
}

/* 加载中状态 */
.lee-button-loading .dashicons.spin {
    animation: spin 1s infinite linear;
}

/* 状态消息 */
.lee-status-message {
    padding: 12px 18px; /* 增加内边距 */
    margin-bottom: 20px; /* 增加下方间距 */
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid;
    display: flex; /* 使用 flex 对齐图标和文本 (如果未来加图标) */
    align-items: center;
    gap: 10px;
}

.lee-status-info {
    background-color: #e7f3fe;
    border-color: #80bdff;
    color: #004085;
}

.lee-status-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.lee-status-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.lee-status-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* 输出区域 */
.lee-output-wrapper {
    margin-top: 0; 
    border: 1px solid #e9ecef;
    background-color: #f8f9fa; /* 浅灰背景，与参数区区分 */
    padding: 25px 30px; /* 增加内边距 */
    border-radius: 4px;
    min-height: 250px; 
    box-shadow: none; /* 移除内阴影 */
}

.lee-output-content {
    font-size: 15px; 
    line-height: 1.75; /* 增加行高 */
    color: #343a40; /* 深灰色 */
    overflow-wrap: break-word;
}

/* Markdown 输出样式 */
.lee-output-content h2, 
.lee-output-content h3,
.lee-output-content h4 {
    margin-top: 1.8em; /* 增加标题上方间距 */
    margin-bottom: 1em;
    line-height: 1.4;
    font-weight: 600;
    color: #2c3e50; /* 深蓝灰色 */
}
.lee-output-content h2 {
    font-size: 1.4em;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5em;
}
.lee-output-content h3 {
    font-size: 1.2em;
    color: #495057;
}
.lee-output-content h4 {
    font-size: 1em;
    font-weight: 600; /* 保持加粗 */
    font-style: normal; 
    color: #6c757d; /* 中灰色 */
}
.lee-output-content p {
    margin-bottom: 1.2em;
}
.lee-output-content ul {
    list-style: disc;
    margin-left: 25px;
    margin-bottom: 1.2em;
    padding-left: 0; /* 移除默认内边距 */
}
.lee-output-content li {
    margin-bottom: 0.6em;
}
.lee-output-content strong {
    font-weight: 600;
    color: #0056b3; /* 蓝色加粗 */
}
.lee-output-content em {
    font-style: italic;
}

/* 响应式布局 */
@media screen and (max-width: 768px) { 
    .lee-shortcode-wrap {
        padding: 20px;
    }
    .lee-frontend-container {
        flex-direction: column;
        gap: 25px;
    }
    .lee-frontend-left,
    .lee-frontend-right {
        min-width: 100%;
    }
    .lee-buttons-container {
        justify-content: flex-start;
    }
    .lee-frontend-parameters {
        grid-template-columns: 1fr; /* 小屏幕单列 */
    }
}

/* 确保 dashicons 在前端可用 (如果主题没有加载) */
.lee-shortcode-wrap .dashicons {
    display: inline-block;
    width: 20px;
    height: 20px;
    font-family: dashicons;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    vertical-align: middle; /* 调整对齐 */
}

.lee-param-group label {
    font-weight: 600;
    font-size: 14px;
    color: #444;
    flex-shrink: 0; /* 防止标签被压缩 */
}

.lee-param-group input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    flex-grow: 1; /* 输入框填充剩余空间 */
    min-width: 150px; /* 最小宽度 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lee-param-group input[type="text"]:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

/* 移除之前为 select 设计的样式 (如果不再需要) */
/* 
.lee-param-group select {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    min-width: 120px; 
}
*/ 

/* 新增：区域分割线 */
.lee-section-divider {
    border: 0;
    border-top: 1px solid #e0e0e0;
    margin: 40px 0;
}

/* 新增：区域标题 */
.lee-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #343a40;
}

/* 新增：批量导入控件区域 */
.lee-batch-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

/* 新增：文件选择按钮包裹 */
.lee-file-input-wrapper {
    display: inline-flex;
    align-items: center;
}

.lee-file-input-wrapper label.button {
    margin-bottom: 0; /* 移除按钮的默认下边距 */
}

/* 新增：文件结构说明区域 */
.lee-file-structure-info {
    margin-top: 30px;
    padding: 15px;
    background-color: #f1f3f5; /* 更浅的灰色 */
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.lee-file-structure-info h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #495057;
}

.lee-file-structure-info pre {
    background-color: #fff;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
    color: #212529;
    margin-bottom: 10px;
}

.lee-file-structure-info p {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 0;
}

/* 新增：下载链接样式 */
#lee-download-area a {
    display: inline-block;
    padding: 10px 18px;
    background-color: #28a745; /* 绿色 */
    color: white;
    border: 1px solid #28a745;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}
#lee-download-area a:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: white;
} 