/* ===================================================================
   PPG REFINISH CRM v2.0 - TRAINING PHOTOS STYLES
   Photo upload, preview grid, and lightbox for training sessions
   =================================================================== */

/* Photo Preview Grid (Upload Form) */
.photo-preview-grid {
    margin-top: 12px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.photo-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #E0E0E0;
    background: #FFFFFF;
    transition: all 0.3s ease;
}

.photo-preview-item:hover {
    border-color: #0066CC;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
    transform: translateY(-2px);
}

.photo-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-info {
    padding: 8px;
    background: #F8F9FA;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.photo-name {
    font-size: 12px;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-size {
    font-size: 11px;
    color: #6C757D;
}

.photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.95);
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.photo-preview-item:hover .photo-remove {
    opacity: 1;
}

.photo-remove:hover {
    background: #DC3545;
    transform: scale(1.1);
}

/* Session Photo Gallery (Detail View) */
.session-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.gallery-photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #F8F9FA;
    border: 2px solid #E0E0E0;
    transition: all 0.3s ease;
}

.gallery-photo-item:hover {
    border-color: #0066CC;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.3);
}

.gallery-photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #FFFFFF;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-photo-item:hover .photo-overlay {
    transform: translateY(0);
}

.photo-overlay i {
    font-size: 20px;
}

.photo-overlay span {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Photo Lightbox */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeIn 0.2s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #FFFFFF;
    border: none;
    color: #212529;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
    background: #DC3545;
    color: #FFFFFF;
    transform: rotate(90deg);
}

/* Session Detail Sections */
.session-detail-header {
    margin-bottom: 24px;
    text-align: center;
}

.badge-large {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
}

.session-detail-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E0E0E0;
}

.session-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.session-detail-section h4 {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-detail-section h4 i {
    color: #0066CC;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item label {
    font-size: 12px;
    font-weight: 600;
    color: #6C757D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 15px;
    font-weight: 500;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-item span i {
    color: #0066CC;
    font-size: 14px;
}

.detail-notes {
    background: #F8F9FA;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #0066CC;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin: 0;
}

/* Form Text Helper */
.form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6C757D;
}

.text-muted {
    color: #6C757D;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .photo-preview-item img {
        height: 120px;
    }
    
    .session-photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .gallery-photo-item img {
        height: 150px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .session-photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
