﻿
/* ── Photo Gallery UI ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600&family=DM+Sans:wght@300;400;500&display=swap');

:root {
    --rose: #c2185b;
    --rose-lt: #fce4ec;
    --rose-dk: #880e4f;
    --gold: #f9a825;
    --teal: #00796b;
    --teal-lt: #e0f2f1;
    --ink: #1a1a2e;
    --muted: #6b7280;
    --border: #e5e7eb;
    --surface: #fafafa;
    --white: #ffffff;
}

/* ── Avatar area ─────────────────────────────── */
.pb-avatar-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

    .pb-avatar-wrap img {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--rose-lt);
        box-shadow: 0 2px 12px rgba(194,24,91,0.18);
        display: block;
        transition: opacity .2s;
    }

.pb-avatar-count {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: var(--rose);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 0.68rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    cursor: pointer;
}

.btn-manage-photos {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--rose-lt);
    color: var(--rose-dk);
    border: 1.5px solid rgba(194,24,91,0.25);
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all .18s;
}

    .btn-manage-photos:hover {
        background: var(--rose);
        color: #fff;
        border-color: var(--rose);
        box-shadow: 0 3px 10px rgba(194,24,91,0.28);
    }

/* ── GALLERY MODAL ──────────────────────────── */
.gallery-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10,8,20,0.62);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    .gallery-modal-overlay.open {
        display: flex;
    }

.gallery-modal {
    background: var(--white);
    border-radius: 22px;
    width: 100%;
    max-width: 760px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.22);
    animation: gmSlideUp .28s cubic-bezier(.34,1.3,.64,1);
}

@keyframes gmSlideUp {
    from {
        transform: translateY(36px) scale(0.97);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.gm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 2;
}

    .gm-header h4 {
        font-family: 'Playfair Display', serif;
        font-size: 1.1rem;
        color: var(--ink);
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
    }

        .gm-header h4 i {
            color: var(--rose);
        }

.gm-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--muted);
    transition: all .15s;
}

    .gm-close:hover {
        background: var(--rose-lt);
        color: var(--rose);
        border-color: var(--rose);
    }

.gm-body {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── Tab switcher ─────────────────────────── */
.gm-tabs {
    display: flex;
    gap: 6px;
    background: var(--surface);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.gm-tab {
    flex: 1;
    text-align: center;
    padding: 7px 0;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    color: var(--muted);
    transition: all .18s;
    border: none;
    background: transparent;
}

    .gm-tab.active {
        background: var(--white);
        color: var(--rose);
        box-shadow: 0 1px 6px rgba(0,0,0,0.09);
    }

/* ── Photo grid ─────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.photo-tile {
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--surface);
    position: relative;
    aspect-ratio: 1 / 1;
    transition: all .2s;
}

    .photo-tile:hover {
        border-color: var(--rose);
        box-shadow: 0 4px 18px rgba(194,24,91,0.14);
    }

    .photo-tile.primary-tile {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px rgba(249,168,37,0.2);
    }

    .photo-tile img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .3s;
    }

    .photo-tile:hover img {
        transform: scale(1.05);
    }

.photo-tile-badges {
    position: absolute;
    top: 7px;
    left: 7px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge-primary {
    background: var(--gold);
    color: #222;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.photo-tile-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.72));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 8px 9px;
    opacity: 0;
    transition: opacity .2s;
}

.photo-tile:hover .photo-tile-actions {
    opacity: 1;
}

.tile-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all .15s;
}

.tile-btn-star {
    background: rgba(249,168,37,0.92);
    color: #222;
}

    .tile-btn-star:hover {
        background: var(--gold);
        transform: scale(1.1);
    }

.tile-btn-del {
    background: rgba(220,38,38,0.88);
    color: #fff;
}

    .tile-btn-del:hover {
        background: #dc2626;
        transform: scale(1.1);
    }

/* ── Upload zone ─────────────────────────── */
.upload-zone {
    border: 2.5px dashed var(--border);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--surface);
    position: relative;
}

    .upload-zone:hover, .upload-zone.drag-over {
        border-color: var(--rose);
        background: var(--rose-lt);
    }

    .upload-zone input[type=file] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

.upload-zone-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--rose-lt);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--rose);
}

.upload-zone h5 {
    font-size: 0.9rem;
    color: var(--ink);
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-zone p {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0;
}

.upload-zone .up-limit {
    display: inline-block;
    margin-top: 8px;
    background: var(--teal-lt);
    color: var(--teal);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.72rem;
    font-weight: 500;
}

/* ── Preview strip ───────────────────────── */
.preview-strip {
    display: none;
    margin-top: 16px;
}

    .preview-strip.visible {
        display: block;
    }

.preview-strip-title {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.preview-item {
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid var(--border);
    position: relative;
    aspect-ratio: 1/1;
    background: var(--surface);
}

    .preview-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.preview-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.6rem;
    padding: 3px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(220,38,38,0.85);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

    .preview-remove:hover {
        background: #dc2626;
        transform: scale(1.1);
    }

/* ── Upload progress ─────────────────────── */
.upload-progress-wrap {
    margin-top: 14px;
    display: none;
}

    .upload-progress-wrap.visible {
        display: block;
    }

.up-progress-bar-track {
    background: var(--border);
    border-radius: 30px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.up-progress-bar-fill {
    background: linear-gradient(90deg, var(--rose), var(--rose-dk));
    height: 100%;
    border-radius: 30px;
    transition: width .3s ease;
    width: 0%;
}

.up-progress-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

/* ── Empty state ─────────────────────────── */
.gm-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

    .gm-empty i {
        font-size: 2.8rem;
        color: var(--border);
        display: block;
        margin-bottom: 12px;
    }

    .gm-empty p {
        font-size: 0.85rem;
    }

/* ── Loader ──────────────────────────────── */
.gm-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    gap: 12px;
    color: var(--muted);
}

.gm-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--rose-lt);
    border-top-color: var(--rose);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Modal footer ───────────────────────── */
.gm-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--white);
    flex-shrink: 0;
}

.gm-footer-info {
    font-size: 0.78rem;
    color: var(--muted);
}

    .gm-footer-info b {
        color: var(--ink);
    }

.btn-upload-go {
    display: none;
    background: var(--rose);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 9px 24px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    align-items: center;
    gap: 6px;
    transition: all .18s;
}

    .btn-upload-go.visible {
        display: inline-flex;
    }

    .btn-upload-go:hover {
        background: var(--rose-dk);
        box-shadow: 0 3px 12px rgba(194,24,91,0.3);
    }

    .btn-upload-go:disabled {
        background: #ccc;
        cursor: not-allowed;
        box-shadow: none;
    }

/* ── Delete confirm mini-modal ───────────── */
.del-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10099;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    .del-confirm-overlay.open {
        display: flex;
    }

.del-confirm-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 28px 22px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    animation: gmSlideUp .2s ease;
}

.del-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff1f1;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #dc2626;
}

.del-confirm-box h5 {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 6px;
}

.del-confirm-box p {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 20px;
}

.del-confirm-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-del-cancel {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 30px;
    padding: 8px 22px;
    font-size: 0.84rem;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    color: var(--muted);
    transition: all .15s;
}

    .btn-del-cancel:hover {
        border-color: var(--rose);
        color: var(--rose);
    }

.btn-del-yes {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 8px 22px;
    font-size: 0.84rem;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all .15s;
}

    .btn-del-yes:hover {
        background: #b91c1c;
        box-shadow: 0 3px 10px rgba(220,38,38,0.3);
    }

/* ── Toast ──────────────────────────────── */
.pb-toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.pb-toast {
    background: var(--ink);
    color: #fff;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.2);
    animation: toastIn .25s ease;
    pointer-events: auto;
    min-width: 220px;
}

    .pb-toast.success {
        background: #166534;
    }

    .pb-toast.error {
        background: #991b1b;
    }

    .pb-toast.info {
        background: var(--rose-dk);
    }

@keyframes toastIn {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateX(30px);
    }
}


