/* public/assets/css/pdf/pdf-organizer.css */

.pdf-org-wrapper { padding: 32px 16px; position: relative; }
.pdf-org-header { text-align: center; margin-bottom: 32px; }
.pdf-org-title { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
.pdf-org-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; line-height: 1.6; }

.pdf-org-workspace { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 360px 1fr; gap: 32px; align-items: start; }

/* 左侧控制区 */
.pdf-org-controls { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: flex; flex-direction: column; gap: 24px; position: sticky; top: 20px; }
.control-section h4 { margin: 0 0 16px 0; font-size: 1rem; color: var(--text-main); border-bottom: 2px solid rgba(6, 182, 212, 0.2); padding-bottom: 8px; display: inline-block; }

.file-drop-area { border: 2px dashed #06b6d4; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: 0.3s; background: rgba(6, 182, 212, 0.03); position: relative; overflow: hidden; }
.file-drop-area:hover, .file-drop-area.drag-over { background: rgba(6, 182, 212, 0.08); border-color: #0891b2; }
.drop-text { margin-top: 12px; font-weight: 600; color: var(--text-main); font-size: 0.95rem; word-break: break-all; }
.file-input-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.tips-box { background: rgba(6, 182, 212, 0.05); border: 1px solid rgba(6, 182, 212, 0.15); border-radius: 8px; padding: 12px; font-size: 0.85rem; color: #0e7490; line-height: 1.5; }
[data-theme="dark"] .tips-box { color: #22d3ee; background: rgba(34, 211, 238, 0.05); }

.pdf-org-btn-primary { background: #06b6d4; color: #fff; border: none; padding: 14px 20px; font-size: 1.05rem; font-weight: 800; border-radius: 12px; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3); width: 100%; }
.pdf-org-btn-primary:hover:not(:disabled) { background: #0891b2; transform: translateY(-2px); }
.pdf-org-btn-primary:disabled { background: #94a3b8; cursor: not-allowed; box-shadow: none; opacity: 0.7; }

/* 右侧工作台区 */
.pdf-org-preview { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.status-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.status-text { font-size: 1.05rem; font-weight: 600; color: var(--text-main); margin-top: 12px; }
.loader-spinner { width: 32px; height: 32px; border: 4px solid var(--border-color); border-top-color: #06b6d4; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-icon { font-size: 2.5rem; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.progress-bar-wrap { width: 100%; max-width: 300px; height: 8px; background: var(--bg-body); border-radius: 4px; overflow: hidden; border: 1px solid var(--border-color); box-sizing: border-box; }
.progress-bar-fill { width: 0%; height: 100%; background: #06b6d4; transition: width 0.2s linear; }

/* 🌟 卡片网格布局 */
.sortable-container { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); min-height: 400px; }
.page-sortable-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px; }

/* 每一个页面卡片 */
.page-card { position: relative; width: 100%; padding-bottom: 141.4%; background: var(--bg-body); border-radius: 8px; border: 1px solid var(--border-color); overflow: hidden; cursor: grab; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; }
.page-card:hover { transform: translateY(-4px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); border-color: #06b6d4; }
.page-card:active { cursor: grabbing; }

/* Ghost class for Sortable */
.sortable-ghost { opacity: 0.4; border: 2px dashed #06b6d4; background: rgba(6, 182, 212, 0.1); transform: none !important; }

/* 内部画布容器，处理 CSS 旋转动画 */
.thumb-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; background: #fff; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.thumb-container canvas { max-width: 100%; max-height: 100%; display: block; box-shadow: 0 0 5px rgba(0,0,0,0.1); }

/* 原本页码标签 */
.orig-badge { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.7); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 12px; z-index: 10; backdrop-filter: blur(4px); }

/* 悬浮操作菜单 */
.card-actions { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; opacity: 0; transition: 0.2s; z-index: 20; backdrop-filter: blur(2px); }
.page-card:hover .card-actions { opacity: 1; }

.btn-action { background: #fff; color: #000; border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.1rem; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.btn-rotate:hover { background: #06b6d4; color: #fff; transform: scale(1.1); }
.btn-delete:hover { background: #ef4444; color: #fff; transform: scale(1.1); }

/* SEO */
.tool-seo-article { width: 100%; }
.pdf-info-card { background: var(--bg-surface); padding: 24px 32px; border-radius: 16px; border: 1px solid var(--border-color); box-sizing: border-box; max-width: 1200px; margin: 0 auto; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.pdf-info-card h3 { margin: 0 0 12px 0; color: var(--text-main); font-size: 1.25rem; }
.pdf-desc-text { color: var(--text-muted); font-size: 0.95rem; }

@media (max-width: 900px) {
    .pdf-org-workspace { grid-template-columns: 1fr; }
}