.quality-bound {
    background-color: #ddd;
    padding:5px;
}
.quality {
    width: 100%;
}
.quality td {
    padding: 5px;
    text-align: center;
    border: 1px solid #fff;
    font-size: 14px;
}

/* Photo Upload Styles */
.photo-upload-container {
    margin-top: 20px;
}

/* Photo Type Boxes */
.photo-types-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.photo-type-box {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1;
}

.photo-type-box:hover {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.photo-type-box.drag-active {
    border-color: #0d6efd;
    background-color: #e7f1ff;
    border-style: solid;
}

.photo-type-box.has-photo {
    border-style: solid;
    border-color: #28a745;
    background-color: #fff;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

.placeholder-text {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #495057;
}

.photo-preview-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.photo-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 15px 10px 10px;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

/* Other Photos Section */
.other-photos-section {
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

.other-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.add-other-photos {
    margin-top: 15px;
}

.photo-drop-zone-other {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 15px;
}

.photo-drop-zone-other:hover {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.photo-drop-zone-other.drag-active {
    border-color: #0d6efd;
    background-color: #e7f1ff;
    border-style: solid;
}

/* Responsive adjustments for photo types */
@media (max-width: 768px) {
    .photo-types-container {
        grid-template-columns: 1fr;
    }
    
    .photo-type-box {
        aspect-ratio: 1.2;
    }
    
    .other-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

.photo-drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.photo-drop-zone:hover {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.photo-drop-zone.drag-active {
    border-color: #0d6efd;
    background-color: #e7f1ff;
    border-style: solid;
}

.drop-zone-content h5 {
    color: #6c757d;
    margin-bottom: 10px;
}

.uploaded-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.photo-item {
    position: relative;
}

.photo-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    background: #fff;
}

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

.photo-overlay {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-preview:hover .photo-overlay {
    opacity: 1;
}

.photo-preview-container:hover .photo-overlay {
    opacity: 1;
}

.photo-remove-btn {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-info {
    padding: 10px;
    text-align: center;
}

.upload-progress {
    margin-top: 5px;
}

.progress {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #0d6efd;
    transition: width 0.3s ease;
}

.upload-status {
    margin-top: 5px;
}

/* Photo Gallery - View Mode Styles */
.photo-gallery {
    margin-top: 10px;
}

.photo-type-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.photo-type-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.photo-section-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.photo-section-title::before {
    content: '';
    width: 4px;
    height: 1.2em;
    background-color: #007bff;
    margin-right: 10px;
    border-radius: 2px;
}

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

/* Single photo display for outdoor unit and plant room */
.photo-type-section .photo-thumbnail-item {
    width: 200px;
    max-width: 100%;
    margin: 0;
}

.photo-thumbnail-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.photo-thumbnail-item:hover {
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 1.5rem;
}

.photo-thumbnail-item:hover .thumbnail-overlay {
    opacity: 1;
}

/* Lightbox Styles */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    backdrop-filter: blur(4px);
}

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

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1051;
}

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

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1051;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-image-container {
    position: relative;
    text-align: center;
    transition: transform 0.3s ease-out;
    transform-origin: center center;
    min-width: 100px;
    min-height: 100px;
    overflow: hidden;
    /* No fixed size constraints - let it expand with zoom */
    width: auto;
    height: auto;
}

.lightbox-image-container.zoomed {
    overflow: visible;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: grab;
    width: auto;
    height: auto;
}

.lightbox-image:active {
    cursor: grabbing;
}

.lightbox-caption {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    min-width: 200px;
    max-width: 400px;
    z-index: 1051;
}

.caption-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.caption-info {
    font-size: 0.8rem;
    opacity: 0.9;
}

.photo-type-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: normal;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Mobile touch support and overlay transitions */
.lightbox-close,
.lightbox-nav,
.lightbox-caption {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.overlay-hidden {
    opacity: 0;
    pointer-events: none;
}

.lightbox-content {
    touch-action: manipulation;
    overflow: hidden;
}

/* Removed duplicate .lightbox-image-container selector - consolidated above */

/* Prevent text selection during touch interactions */
.lightbox-content * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Responsive adjustments for lightbox */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .lightbox-caption {
        bottom: 10px;
        padding: 8px 16px;
        max-width: calc(100vw - 40px);
        font-size: 0.8rem;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .caption-main {
        gap: 6px;
    }
    
    .photo-type-badge {
        font-size: 0.7rem;
        padding: 1px 6px;
    }
    
    .lightbox-image {
        max-height: 70vh;
        max-width: 95vw;
    }
    
    /* Improve touch target sizes on mobile */
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    .lightbox-close {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }
    
    .photo-thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}
