/* Event Photo Frame Generator — Frontend v1.0.2 */

.epfg-wrap {
    --c-primary: #4f46e5;
    --c-primary-h: #4338ca;
    --c-success: #16a34a;
    --c-success-h: #15803d;
    --c-border: #e5e7eb;
    --c-bg: #f9fafb;
    --c-text: #111827;
    --c-muted: #6b7280;
    --radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    color: var(--c-text);
}

.epfg-instructions {
    margin: 0 0 18px;
    line-height: 1.6;
}

/* ── Frame selector ─────────────────────────────────────────────────── */
.epfg-frame-selector { margin-bottom: 20px; }
.epfg-frame-label    { font-weight: 600; margin: 0 0 10px; display: block; }
.epfg-frame-grid     { display: flex; flex-wrap: wrap; gap: 10px; }
.epfg-frame-opt {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 8px 12px;
    border: 2px solid var(--c-border);
    border-radius: var(--radius);
    cursor: pointer;
    background: #fff;
    transition: border-color .15s;
    min-width: 80px;
    text-align: center;
}
.epfg-frame-opt input[type="radio"] { display: none; }
.epfg-frame-opt img  { width: 64px; height: 64px; object-fit: cover; border-radius: 5px; display: block; }
.epfg-frame-opt span { font-size: .78rem; color: var(--c-muted); }
.epfg-frame-opt:hover, .epfg-frame-opt.is-active {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

/* ── Dropzone ────────────────────────────────────────────────────────── */
.epfg-dropzone {
    display: block;
    border: 2px dashed var(--c-border);
    border-radius: var(--radius);
    background: var(--c-bg);
    text-align: center;
    padding: 40px 20px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.epfg-dropzone:hover,
.epfg-dropzone.is-dragover {
    border-color: var(--c-primary);
    background: rgba(79,70,229,.04);
}
.epfg-dz-body  { pointer-events: none; }
.epfg-dz-title { font-size: 1rem; font-weight: 600; margin: 12px 0 4px; }
.epfg-dz-hint  { font-size: .8rem; color: var(--c-muted); margin: 8px 0 0; }

/* ── Canvas editor ───────────────────────────────────────────────────── */
.epfg-editor-box {
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
}
.epfg-editor-hint {
    background: #eef2ff;
    border-bottom: 1px solid #c7d2fe;
    color: var(--c-primary);
    font-size: .82rem;
    font-weight: 500;
    margin: 0;
    padding: 8px 14px;
    text-align: center;
    user-select: none;
}
.epfg-canvas-wrap {
    width: 100%;
    display: block;
    background: repeating-conic-gradient(#e5e7eb 0% 25%, #f9fafb 0% 50%) 0 0 / 16px 16px;
    line-height: 0;
    overflow: hidden;
}
.epfg-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
.epfg-canvas-wrap canvas:active { cursor: grabbing; }
.epfg-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
}

/* ── Result ──────────────────────────────────────────────────────────── */
.epfg-result-box {
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
}
.epfg-result-img {
    display: block;
    width: 100%;
    max-height: 500px;
    object-fit: contain;
}
.epfg-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
    justify-content: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.epfg-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border-radius: 7px;
    font-size: .88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.epfg-btn:active   { transform: scale(.97); }
.epfg-btn:disabled { opacity: .55; cursor: not-allowed; }

.epfg-btn--primary { background: var(--c-primary); color: #fff; }
.epfg-btn--primary:hover { background: var(--c-primary-h); color: #fff; }

.epfg-btn--success { background: var(--c-success); color: #fff; }
.epfg-btn--success:hover { background: var(--c-success-h); color: #fff; }

.epfg-btn--ghost {
    background: #fff;
    color: var(--c-muted);
    border: 1.5px solid var(--c-border);
}
.epfg-btn--ghost:hover { background: var(--c-bg); color: var(--c-text); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .epfg-dropzone    { padding: 28px 16px; }
    .epfg-editor-actions,
    .epfg-result-actions { flex-direction: column; }
    .epfg-btn         { width: 100%; justify-content: center; }
}
