/**
 * Photocall Sessions Lightbox Styles
 * Shared lightbox component for photocall and proofing galleries
 */

/* Lightbox overlay and container */
.photocall-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.photocall-lightbox.active {
    display: flex;
}

.photocall-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.photocall-lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Lightbox content - 90% image / 10% controls split */
.photocall-lightbox-content {
    position: relative;
    width: 100%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.photocall-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Lightbox info - bottom 10% */
.photocall-lightbox-info {
    position: relative;
    width: 100%;
    height: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
    box-sizing: border-box;
    color: white;
    z-index: 10001;
}

.photocall-lightbox-counter {
    font-size: 16px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

.photocall-lightbox-filename {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Navigation buttons */
.photocall-lightbox-close,
.photocall-lightbox-prev,
.photocall-lightbox-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10002;
}

.photocall-lightbox-close:hover,
.photocall-lightbox-prev:hover,
.photocall-lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.photocall-lightbox-close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
}

.photocall-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
}

.photocall-lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.photocall-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
}

.photocall-lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Selection button */
.photocall-lightbox-select-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.photocall-lightbox-select-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.photocall-lightbox-select-btn:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

.photocall-lightbox-select-btn .deselect-text {
    display: none;
}

.photocall-lightbox-select-btn[data-selected="true"] {
    background: #10b981;
}

.photocall-lightbox-select-btn[data-selected="true"] .select-text {
    display: none;
}

.photocall-lightbox-select-btn[data-selected="true"] .deselect-text {
    display: inline;
}

.photocall-lightbox-select-btn[data-selected="true"]:hover {
    background: #059669;
}

/* Lightbox actions container */
.photocall-lightbox-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Download button */
.photocall-lightbox-download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photocall-lightbox-download-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.photocall-lightbox-download-btn svg {
    flex-shrink: 0;
}

/* Grid mode styling */
[data-photocall-lightbox] {
    position: relative;
}

[data-photocall-lightbox] [data-photo-url] {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-photocall-lightbox] [data-photo-url]:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

[data-photocall-lightbox] [data-photo-url] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Selection indicator */
[data-photocall-lightbox] [data-photo-url].selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-photocall-lightbox] [data-photo-url].selected {
    border: 3px solid #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .photocall-lightbox-content {
        padding: 10px;
        height: 85%;
    }

    .photocall-lightbox-info {
        height: 15%;
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .photocall-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .photocall-lightbox-prev,
    .photocall-lightbox-next {
        width: 48px;
        height: 48px;
    }

    .photocall-lightbox-prev {
        left: 10px;
    }

    .photocall-lightbox-next {
        right: 10px;
    }

    .photocall-lightbox-filename {
        max-width: 100%;
        font-size: 12px;
    }

    .photocall-lightbox-counter {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Loading state */
.photocall-lightbox-image {
    background: rgba(255, 255, 255, 0.1);
}

/* Animation */
.photocall-lightbox.active .photocall-lightbox-container {
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Print styles */
@media print {
    .photocall-lightbox {
        display: none !important;
    }
}
