/* public/assets/css/tools/image/gif-maker.css */

.gifm-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.gifm-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

/* 上传拖拽区 */
.gifm-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    background: var(--bg-body);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.gifm-dropzone:hover, .gifm-dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb, 0, 102, 204), 0.05);
}

.gifm-drop-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.8; }
.gifm-drop-text { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.gifm-drop-hint { font-size: 0.9rem; color: var(--text-muted); }

/* 图像缩略图序列网格 */
.gifm-frames-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    max-height: 250px;
    overflow-y: auto;
}

.gifm-frame-card {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.3s ease;
}

.gifm-frame-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gifm-frame-del {
    position: absolute;
    top: 4px; right: 4px;
    width: 20px; height: 20px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; cursor: pointer; border: none;
    opacity: 0; transition: opacity 0.2s;
}

.gifm-frame-card:hover .gifm-frame-del { opacity: 1; }
.gifm-frame-del:hover { background: #b91c1c; }

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 表单与按钮 */
.gifm-config-group {
    background: var(--bg-body);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.gifm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gifm-form-item { display: flex; flex-direction: column; gap: 8px; }
.gifm-form-item label { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.gifm-input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
}
.gifm-input:focus { border-color: var(--primary-color); outline: none; }

.gifm-actions { display: flex; gap: 12px; }

.gifm-btn-primary {
    flex: 1; padding: 14px; background: var(--primary-color); color: #fff;
    border: none; border-radius: 8px; font-size: 1.05rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 0, 102, 204), 0.3);
}
.gifm-btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-2px); }
.gifm-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.gifm-btn-secondary {
    padding: 14px 20px; background: transparent; color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: 8px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.gifm-btn-secondary:hover { background: rgba(0,0,0,0.05); }

/* 右侧预览区 */
.gifm-preview-box {
    flex: 1;
    min-height: 350px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-body);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    padding: 16px;
}

.gifm-empty-state {
    font-size: 4rem; color: var(--text-muted); opacity: 0.2; font-weight: 900;
}

#resultImage {
    max-width: 100%; max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* 进度条 */
.gifm-progress-area { margin-top: 20px; text-align: center; }
.gifm-progress-bar {
    width: 100%; height: 8px; background: var(--border-color);
    border-radius: 10px; overflow: hidden;
}
.gifm-progress-fill {
    height: 100%; width: 0%; background: var(--primary-color);
    transition: width 0.1s linear;
}

.gifm-error-msg {
    margin-bottom: 20px; padding: 12px; background: #fef2f2;
    color: #dc2626; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
}

[data-theme="dark"] .gifm-btn-secondary:hover { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .gifm-error-msg { background: rgba(220,38,38,0.1); }