/* ============================================================
   PhotoEZ Gallery Demo — Frontend Styles
============================================================ */

/* ── Nav Bar ── */
.pgd-nav-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #0b2559;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    padding: 0;
    margin-bottom: 0;
}
.pgd-nav-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.pgd-nav-label {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    font-family: Arial, sans-serif;
}
.pgd-nav-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pgd-nav-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    font-size: 13px;
    font-family: Arial, sans-serif;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.pgd-nav-step:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.pgd-nav-step.active {
    background: #46c12f;
    border-color: #46c12f;
    color: #fff;
}
.pgd-step-num {
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.pgd-nav-step.active .pgd-step-num { background: rgba(255,255,255,0.3); }
.pgd-step-name { font-weight: 600; }
.pgd-nav-divider { color: rgba(255,255,255,0.3); font-size: 16px; }

/* ── Screens ── */
.pgd-screen { display: none; }
.pgd-screen.active { display: block; }

/* ── Gallery Header ── */
.pgd-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 16px;
    flex-wrap: wrap;
    gap: 16px;
}
.pgd-gallery-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
    color: #0b2559;
    font-family: Georgia, serif;
}
.pgd-gallery-client { margin: 0; color: #555; font-size: 15px; font-family: Arial, sans-serif; }

/* Selection Counter Ring */
.pgd-selection-counter { text-align: center; }
.pgd-counter-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #0b2559;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    margin: 0 auto 4px;
    font-family: Arial, sans-serif;
    transition: background 0.3s ease;
}
.pgd-counter-ring.full { background: #46c12f; }
.pgd-counter-ring.over { background: #e53e3e; }
.pgd-counter-divider { font-size: 16px; font-weight: 400; margin: 0 2px; opacity: 0.6; }
.pgd-counter-total { font-size: 16px; opacity: 0.75; }
.pgd-counter-label { font-size: 12px; color: #888; font-family: Arial, sans-serif; }

/* Info Bar */
.pgd-info-bar {
    background: #f0f6ff;
    border: 1px solid #c2d9ef;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    color: #1a3a6e;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.pgd-addon-hint { color: #6366f1; font-weight: 600; }

/* ── Photo Grid ── */
.pgd-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.pgd-photo-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.pgd-photo-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
}
.pgd-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.pgd-photo-item:hover .pgd-photo-wrap img { transform: scale(1.05); }
.pgd-photo-item.selected .pgd-photo-wrap img { transform: scale(1.02); }

/* Watermark */
.pgd-watermark {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%) rotate(-30deg);
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    font-family: Arial, sans-serif;
    z-index: 2;
}

/* Select Overlay */
.pgd-select-overlay {
    position: absolute;
    inset: 0;
    background: rgba(70, 193, 47, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 3;
}
.pgd-select-check {
    width: 36px;
    height: 36px;
    background: #46c12f;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    font-weight: 700;
}
.pgd-photo-item.selected .pgd-select-overlay { background: rgba(70, 193, 47, 0.2); }
.pgd-photo-item.selected .pgd-select-check { opacity: 1; transform: scale(1); }

/* Photo Number */
.pgd-photo-num {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-family: Arial, sans-serif;
    z-index: 4;
}

/* Zoom Button */
.pgd-zoom-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}
.pgd-photo-item:hover .pgd-zoom-btn { opacity: 1; }

/* ── Add-on Section ── */
.pgd-addon-section { margin-bottom: 20px; }
.pgd-addon-card {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: #fff;
}
.pgd-addon-icon { font-size: 36px; }
.pgd-addon-info { flex: 1; }
.pgd-addon-info h3 { margin: 0 0 4px; font-size: 16px; font-family: Arial, sans-serif; }
.pgd-addon-info p { margin: 0; font-size: 13px; opacity: 0.85; font-family: Arial, sans-serif; }
.pgd-addon-controls { display: flex; align-items: center; gap: 16px; }
.pgd-addon-qty { display: flex; align-items: center; gap: 12px; }
.pgd-qty-btn {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.25);
    border: none; border-radius: 50%;
    color: #fff; font-size: 20px;
    cursor: pointer; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.pgd-qty-btn:hover { background: rgba(255,255,255,0.4); }
#pgd-addon-qty { font-size: 24px; font-weight: 800; min-width: 24px; text-align: center; font-family: Arial, sans-serif; }
.pgd-addon-price { text-align: center; }
#pgd-addon-total { font-size: 22px; font-weight: 800; display: block; font-family: Arial, sans-serif; }
.pgd-addon-price small { opacity: 0.75; font-size: 12px; font-family: Arial, sans-serif; }

/* ── Submit Bar ── */
.pgd-submit-bar {
    position: sticky;
    bottom: 60px;
    background: #fff;
    border: 2px solid #0b2559;
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.pgd-submit-summary { font-size: 15px; color: #333; font-family: Arial, sans-serif; }

/* ── Buttons ── */
.pgd-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: Arial, sans-serif;
    transition: all 0.18s ease;
    text-decoration: none;
}
.pgd-btn-submit {
    background: #46c12f;
    color: #fff;
}
.pgd-btn-submit:hover:not(:disabled) { background: #3aa827; }
.pgd-btn-submit:disabled { background: #ccc; cursor: not-allowed; }
.pgd-btn-download {
    background: #0b2559;
    color: #fff;
}
.pgd-btn-download:hover { background: #0d3070; }
.pgd-btn-secondary {
    background: #f1f5f9;
    color: #0b2559;
    border: 2px solid #0b2559;
}
.pgd-btn-secondary:hover { background: #e2e8f0; }

/* ── Status Screens ── */
.pgd-status-screen {
    max-width: 680px;
    margin: 40px auto;
    text-align: center;
    font-family: Arial, sans-serif;
}
.pgd-status-icon { font-size: 64px; margin-bottom: 16px; }
.pgd-status-screen h2 { font-size: 28px; color: #0b2559; margin-bottom: 8px; font-family: Georgia, serif; }
.pgd-status-screen > p { font-size: 16px; color: #555; margin-bottom: 24px; }

.pgd-status-detail {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}
.pgd-status-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.pgd-status-row:last-child { border-bottom: none; }
.pgd-status-label { color: #64748b; }
.pgd-status-value { font-weight: 600; color: #1a1a2e; }

.pgd-status-badge { padding: 3px 12px; border-radius: 20px; font-size: 12px; }
.pgd-badge-blue   { background: #dbeafe; color: #1e40af; }
.pgd-badge-yellow { background: #fef9c3; color: #92400e; }
.pgd-badge-green  { background: #dcfce7; color: #15803d; }

.pgd-status-note {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 16px;
    padding: 0 20px;
}

/* Submitted thumbnails */
.pgd-submitted-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}
.pgd-submitted-thumbs img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #46c12f;
}

/* Progress Steps */
.pgd-progress-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 32px 0;
    flex-wrap: wrap;
}
.pgd-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.pgd-progress-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
}
.pgd-progress-step.done .pgd-progress-dot { background: #46c12f; color: #fff; }
.pgd-progress-step.active .pgd-progress-dot { background: #0b2559; color: #fff; animation: pgd-pulse 1.5s infinite; }
.pgd-progress-text { font-size: 11px; color: #64748b; white-space: nowrap; }
.pgd-progress-line {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    min-width: 40px;
    margin-bottom: 18px;
    transition: background 0.3s ease;
}
.pgd-progress-line.done { background: #46c12f; }
.pgd-progress-line.active { background: linear-gradient(90deg, #46c12f, #0b2559); }

@keyframes pgd-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(11,37,89,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(11,37,89,0); }
}

/* Delivery Grid */
.pgd-delivery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 24px 0;
    text-align: left;
}
.pgd-delivery-photo {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}
.pgd-delivery-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pgd-delivery-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
}
.pgd-delivery-badge {
    background: #46c12f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: Arial, sans-serif;
}
.pgd-delivery-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* No Photos message */
.pgd-no-photos {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-family: Arial, sans-serif;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

/* ── Lightbox ── */
.pgd-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.pgd-lightbox.open { display: flex; }
.pgd-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    cursor: pointer;
}
.pgd-lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 95vw;
    max-height: 95vh;
}
.pgd-lightbox-img-wrap {
    position: relative;
    max-width: 80vw;
    max-height: 85vh;
}
.pgd-lightbox-img-wrap img {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}
.pgd-lightbox-watermark {
    font-size: 18px;
    color: rgba(255,255,255,0.35);
}
.pgd-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
}
.pgd-lightbox-nav {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 36px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.pgd-lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.pgd-lightbox-footer {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pgd-lightbox-footer span { color: rgba(255,255,255,0.6); font-size: 13px; font-family: Arial, sans-serif; }
.pgd-lightbox-select-btn {
    background: #46c12f;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background 0.15s;
}
.pgd-lightbox-select-btn:hover { background: #3aa827; }
.pgd-lightbox-select-btn.selected-state { background: #e53e3e; }

/* ── Demo Banner ── */
.pgd-demo-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 10px 20px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.pgd-demo-banner strong { color: #46c12f; }
.pgd-banner-dismiss {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
    margin-left: 8px;
}
.pgd-banner-dismiss:hover { color: #fff; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .pgd-nav-steps { gap: 4px; }
    .pgd-step-name { display: none; }
    .pgd-nav-divider { display: none; }
    .pgd-photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
    .pgd-gallery-header { flex-direction: column; align-items: flex-start; }
    .pgd-submit-bar { flex-direction: column; text-align: center; bottom: 48px; }
    .pgd-btn-submit { width: 100%; justify-content: center; }
    .pgd-delivery-grid { grid-template-columns: repeat(2, 1fr); }
    .pgd-lightbox-content { gap: 8px; }
    .pgd-lightbox-img-wrap img { max-width: 88vw; }
}
