/* enjoyGraz Photobox — v1.0.0 */

#egtg-photobox-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
#egtg-photobox-modal.epb-open { display: block; }

/* Backdrop */
.epb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Sheet card */
.epb-sheet {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 22px;
    width: 92vw;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    animation: epb-slide-in 0.22s cubic-bezier(.25,.8,.25,1);
}
@keyframes epb-slide-in {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Header */
.epb-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}
.epb-brand {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #1D9E75;
    margin-bottom: 5px;
}
.epb-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    color: #111;
    margin: 0 0 4px;
    line-height: 1.2;
}
.epb-subtitle {
    font-size: 13px;
    color: #999;
    margin: 0;
    padding-right: 28px;
}
.epb-close {
    position: absolute;
    top: 20px;
    right: 18px;
    background: none;
    border: 1px solid #eee;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
    font-family: inherit;
}
.epb-close:hover { color: #333; background: #f5f5f5; }

/* Panel body */
.epb-body { padding: 20px 24px 26px; }

/* Photo slots */
.epb-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.epb-slot {
    aspect-ratio: 1;
    border: 2px dashed #e0e0e0;
    border-radius: 14px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-color: #fafafa;
    overflow: hidden;
    transition: border-color .15s, transform .15s;
}
.epb-slot:hover { border-color: #1D9E75; transform: scale(1.025); }
.epb-slot--filled { border-style: solid; border-color: #1D9E75; }
.epb-slot-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: opacity .2s;
}
.epb-slot-icon  { font-size: 26px; }
.epb-slot-label { font-size: 10px; font-weight: 700; color: #ccc; text-transform: uppercase; letter-spacing: .06em; }

.epb-hint {
    font-size: 12px;
    color: #bbb;
    text-align: center;
    margin: 0 0 16px;
}

/* Create button */
.epb-create-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #1D9E75;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, transform .1s;
    letter-spacing: .01em;
}
.epb-create-btn:hover:not(:disabled) { background: #0F6E56; transform: translateY(-1px); }
.epb-create-btn:active:not(:disabled) { transform: translateY(0); }
.epb-create-btn:disabled { background: #d4d4d4; color: #a0a0a0; cursor: not-allowed; }

/* ── Preview panel ── */
.epb-preview-panel { padding: 16px 24px 24px; }

.epb-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.epb-preview-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 16px;
    color: #111;
    flex: 1;
}
.epb-back-btn {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 9px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    color: #666;
    white-space: nowrap;
    transition: background .15s;
}
.epb-back-btn:hover { background: #f7f7f7; }

/* Canvas */
.epb-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.11);
}

/* Action row */
.epb-preview-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.epb-btn {
    padding: 13px 18px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: opacity .15s, transform .1s;
}
.epb-btn:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.epb-btn:active { transform: translateY(0); }
.epb-btn:disabled { opacity: .5; cursor: not-allowed; }
.epb-btn-share {
    flex: 1;
    background: #1D9E75;
    color: #fff;
}
.epb-btn-secondary {
    background: #fff;
    color: #444;
    border: 1px solid #ddd !important;
}

/* Share result */
.epb-share-result {
    margin-top: 16px;
    padding: 18px;
    background: #f1faf6;
    border: 1px solid #c0e8d5;
    border-radius: 14px;
}
.epb-result-title {
    font-size: 15px;
    font-weight: 700;
    color: #0F6E56;
    margin: 0 0 14px;
    text-align: center;
}
.epb-share-btn-wa,
.epb-share-btn-fb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 8px;
    font-family: inherit;
    transition: opacity .15s;
    gap: 8px;
}
.epb-share-btn-wa:hover,
.epb-share-btn-fb:hover { opacity: .88; }
.epb-share-btn-wa { background: #25D366; color: #fff; }
.epb-copy-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: #333;
    transition: background .15s;
}
.epb-copy-btn:hover { background: #f7f7f7; }
.epb-share-btn-fb { background: #1877F2; color: #fff; }
.epb-copied-msg {
    font-size: 12px;
    color: #1D9E75;
    font-weight: 600;
    text-align: center;
    margin: 8px 0 0;
}

/* ── Mobile tweaks ── */
@media (max-width: 480px) {
    .epb-sheet     { width: 96vw; border-radius: 18px; }
    .epb-header    { padding: 18px 16px 14px; }
    .epb-body,
    .epb-preview-panel { padding: 16px 16px 20px; }
    .epb-title     { font-size: 19px; }
    .epb-preview-actions { flex-direction: column; }
    .epb-btn-share,
    .epb-btn-secondary { width: 100%; }
}
