/**
 * Photo Gallery Pro - Frontend Styles
 */

/* Variables */
:root {
    --pgp-primary: #25d366;
    --pgp-primary-dark: #128c7e;
    --pgp-dark: #1d2327;
    --pgp-gray: #646970;
    --pgp-light: #f6f7f7;
    --pgp-border: #c3c4c7;
    --pgp-radius: 12px;
    --pgp-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Gallery Container */
.pgp-gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Gallery Header */
.pgp-gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.pgp-gallery-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--pgp-dark);
}

.pgp-gallery-header .pgp-event-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--pgp-light);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--pgp-gray);
}

.pgp-gallery-description {
    max-width: 600px;
    margin: 20px auto 0;
    color: var(--pgp-gray);
    line-height: 1.6;
}

/* Face Search Section */
.pgp-face-search {
    background: linear-gradient(135deg, var(--pgp-primary), var(--pgp-primary-dark));
    border-radius: var(--pgp-radius);
    padding: 40px;
    margin-bottom: 40px;
    text-align: center;
    color: #fff;
}

.pgp-face-search h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pgp-face-search p {
    opacity: 0.9;
    margin-bottom: 25px;
}

.pgp-selfie-area {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: var(--pgp-radius);
    padding: 40px;
    cursor: pointer;
    transition: all 0.3s;
    max-width: 400px;
    margin: 0 auto;
}

.pgp-selfie-area:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.pgp-selfie-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.pgp-selfie-area input[type="file"] {
    display: none;
}

.pgp-camera-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--pgp-primary-dark);
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.2s;
}

.pgp-camera-btn:hover {
    transform: scale(1.05);
}

/* Search Results */
.pgp-search-results {
    background: #fff;
    border-radius: var(--pgp-radius);
    padding: 30px;
    margin-top: 20px;
    text-align: left;
}

.pgp-search-results h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Photos Grid */
.pgp-photos-container {
    margin-bottom: 40px;
}

.pgp-photos-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.pgp-photos-count {
    font-size: 14px;
    color: var(--pgp-gray);
}

.pgp-select-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--pgp-light);
    border: 1px solid var(--pgp-border);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pgp-select-all-btn:hover {
    background: #fff;
    border-color: var(--pgp-primary);
}

.pgp-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

/* Photo Card */
.pgp-photo-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--pgp-radius);
    overflow: hidden;
    background: var(--pgp-light);
    cursor: pointer;
    box-shadow: var(--pgp-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.pgp-photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.pgp-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.pgp-photo-card:hover img {
    transform: scale(1.05);
}

/* Watermark Overlay */
.pgp-watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.pgp-watermark-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    transform: rotate(-30deg);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* Photo Selection */
.pgp-photo-select {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgp-photo-card:hover .pgp-photo-select {
    opacity: 1;
}

.pgp-photo-card.selected .pgp-photo-select {
    opacity: 1;
    background: var(--pgp-primary);
    border-color: var(--pgp-primary);
    color: #fff;
}

.pgp-photo-select::after {
    content: '✓';
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
}

.pgp-photo-card.selected .pgp-photo-select::after {
    opacity: 1;
}

/* Photo Price Badge */
.pgp-photo-price {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Cart Sidebar */
.pgp-cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    bottom: 0;
    width: 400px;
    background: #fff;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.pgp-cart-sidebar.open {
    right: 0;
}

.pgp-cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--pgp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pgp-cart-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pgp-cart-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--pgp-gray);
}

.pgp-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.pgp-cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--pgp-light);
}

.pgp-cart-item-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.pgp-cart-item-info {
    flex: 1;
}

.pgp-cart-item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.pgp-cart-item-price {
    color: var(--pgp-primary-dark);
    font-weight: 600;
}

.pgp-cart-item-remove {
    background: none;
    border: none;
    color: #dc3232;
    cursor: pointer;
    font-size: 18px;
}

.pgp-cart-footer {
    padding: 20px;
    border-top: 1px solid var(--pgp-border);
    background: var(--pgp-light);
}

.pgp-cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 18px;
}

.pgp-cart-total-value {
    font-weight: 700;
    color: var(--pgp-primary-dark);
}

.pgp-checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--pgp-primary), var(--pgp-primary-dark));
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.pgp-checkout-btn:hover {
    transform: scale(1.02);
}

/* Floating Cart Button */
.pgp-cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--pgp-primary), var(--pgp-primary-dark));
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgp-cart-fab:hover {
    transform: scale(1.1);
}

.pgp-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3232;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox */
.pgp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.pgp-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.pgp-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.pgp-lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--pgp-radius);
}

.pgp-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
}

.pgp-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.pgp-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pgp-lightbox-prev {
    left: -70px;
}

.pgp-lightbox-next {
    right: -70px;
}

.pgp-lightbox-actions {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.pgp-lightbox-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--pgp-primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Password Protected */
.pgp-password-form {
    max-width: 400px;
    margin: 100px auto;
    background: #fff;
    padding: 40px;
    border-radius: var(--pgp-radius);
    box-shadow: var(--pgp-shadow);
    text-align: center;
}

.pgp-password-form h2 {
    margin-bottom: 10px;
}

.pgp-password-form p {
    color: var(--pgp-gray);
    margin-bottom: 25px;
}

.pgp-password-input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--pgp-border);
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    margin-bottom: 15px;
}

.pgp-password-input:focus {
    outline: none;
    border-color: var(--pgp-primary);
}

.pgp-password-submit {
    width: 100%;
    background: var(--pgp-primary);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Full Gallery Offer */
.pgp-full-gallery-offer {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: var(--pgp-radius);
    padding: 30px;
    margin-bottom: 30px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.pgp-offer-text h3 {
    margin: 0 0 5px;
    font-size: 1.3rem;
}

.pgp-offer-text p {
    margin: 0;
    opacity: 0.9;
}

.pgp-offer-price {
    text-align: right;
}

.pgp-offer-original {
    text-decoration: line-through;
    opacity: 0.7;
    font-size: 14px;
}

.pgp-offer-value {
    font-size: 2rem;
    font-weight: 700;
}

.pgp-offer-btn {
    background: #fff;
    color: #764ba2;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .pgp-gallery-header h1 {
        font-size: 1.8rem;
    }
    
    .pgp-photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .pgp-face-search {
        padding: 25px;
    }
    
    .pgp-cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .pgp-lightbox-nav {
        display: none;
    }
    
    .pgp-full-gallery-offer {
        flex-direction: column;
        text-align: center;
    }
    
    .pgp-offer-price {
        text-align: center;
    }
}

/* Loading State */
.pgp-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}

.pgp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--pgp-light);
    border-top-color: var(--pgp-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pgp-loading-text {
    margin-top: 20px;
    color: var(--pgp-gray);
    font-size: 16px;
}

/* Animation */
.pgp-fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
