#photo-upload-dropzone {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    cursor: pointer;
}

#photo-upload-preview img {
    max-width: 100px;
    margin: 10px;
}
#photo-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap:24px;
}

/* Ensure photo containers take full width */
.um-field #photo-upload-container {
    width: 100%;
    max-width: none;
}

#user-photos {
    width: 100%;
    max-width: none;
}

/* photo grid */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    align-items: stretch;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.photo-grid-item {
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
    aspect-ratio: 1 / 1; /* Force square aspect ratio */
    overflow: hidden;
    border-radius: 8px;
}

.photo-grid-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-grid-item:hover img {
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

.delete-photo {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    color: #8b7355;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    border: 2px solid rgba(139, 115, 85, 0.3);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0.7;
    transform: scale(1);
}

.photo-grid-item:hover .delete-photo {
    opacity: 1;
    transform: scale(1.05);
}

.delete-photo:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    color: #d4572a;
    border-color: rgba(212, 87, 42, 0.4);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    max-width: calc(100% - 40px);
    max-height: calc(100% - 80px);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    border-radius: 8px;
}

.close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: #8b7355;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border: 2px solid rgba(139, 115, 85, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.close:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    color: #d4572a;
    border-color: rgba(212, 87, 42, 0.4);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

/* Navigation arrows - Elegant wedding style */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    color: #8b7355;
    border: 2px solid rgba(139, 115, 85, 0.3);
    font-size: 24px;
    cursor: pointer;
    padding: 18px 12px;
    border-radius: 50%;
    z-index: 1001;
    transition: all 0.4s ease;
    user-select: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: serif;
}

.modal-nav:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    color: #5d4e37;
    border-color: rgba(93, 78, 55, 0.5);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.9);
    background: rgba(255, 255, 255, 0.4);
}

.modal-nav:disabled:hover {
    transform: translateY(-50%) scale(0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-nav.prev {
    left: 30px;
}

.modal-nav.next {
    right: 30px;
}

.modal-nav.prev:before {
    content: "‹";
    font-size: 32px;
    line-height: 1;
}

.modal-nav.next:before {
    content: "›";
    font-size: 32px;
    line-height: 1;
}

/* Photo counter - Elegant style */
.photo-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    color: #8b7355;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1001;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
    border: 1px solid rgba(139, 115, 85, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Mobile modal responsiveness */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: calc(100% - 20px);
        max-height: calc(100% - 60px);
    }
    
    .close {
        top: 10px;
        right: 10px;
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
    
    .delete-photo {
        width: 28px;
        height: 28px;
        font-size: 12px;
        padding: 6px;
    }
    
    .modal-nav {
        font-size: 20px;
        padding: 14px 10px;
        width: 50px;
        height: 50px;
    }
    
    .modal-nav.prev {
        left: 15px;
    }
    
    .modal-nav.next {
        right: 15px;
    }
    
    .modal-nav.prev:before,
    .modal-nav.next:before {
        font-size: 26px;
    }
    
    .photo-counter {
        bottom: 15px;
        font-size: 12px;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 5px;
    }
    
    .modal-content {
        max-width: calc(100% - 10px);
        max-height: calc(100% - 50px);
    }
    
    .close {
        top: 5px;
        right: 5px;
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
    
    .delete-photo {
        width: 26px;
        height: 26px;
        font-size: 11px;
        padding: 5px;
        top: 6px;
        right: 6px;
    }
    
    .modal-nav {
        font-size: 18px;
        padding: 12px 8px;
        width: 45px;
        height: 45px;
    }
    
    .modal-nav.prev {
        left: 10px;
    }
    
    .modal-nav.next {
        right: 10px;
    }
    
    .modal-nav.prev:before,
    .modal-nav.next:before {
        font-size: 22px;
    }
    
    .photo-counter {
        bottom: 10px;
        font-size: 11px;
        padding: 8px 16px;
    }
}

/* Enhanced Mobile Modal Styles */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

@media (max-width: 768px) {
    .modal {
        padding: 0;
        overflow: hidden;
    }
    
    .modal-content {
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 80px);
        margin: 10px;
    }
    
    .close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
        z-index: 10001;
    }
    
    .modal-nav {
        width: 45px;
        height: 45px;
        font-size: 20px;
        padding: 12px 8px;
    }
    
    .modal-nav.prev {
        left: 10px;
    }
    
    .modal-nav.next {
        right: 10px;
    }
    
    .modal-nav.prev:before,
    .modal-nav.next:before {
        font-size: 24px;
    }
    
    .photo-counter {
        bottom: 15px;
        font-size: 12px;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.95);
    }
}

@media (max-width: 480px) {
    .modal-content {
        max-width: calc(100vw - 10px);
        max-height: calc(100vh - 60px);
        margin: 5px;
    }
    
    .close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .modal-nav.prev {
        left: 5px;
    }
    
    .modal-nav.next {
        right: 5px;
    }
}

/* Deleted Photos Management */
.flar-deleted-photos-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.05), rgba(139, 115, 85, 0.02));
    border: 2px solid rgba(139, 115, 85, 0.2);
    border-radius: 15px;
    font-family: 'Georgia', serif;
}

.flar-deleted-photos-section h4 {
    color: #8b7355;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.deleted-count-badge {
    background: #d4572a;
    color: white;
    padding: 4px 8px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.flar-deleted-photos-section p {
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

#show-deleted-photos {
    background: linear-gradient(135deg, #8b7355, #6d5a42);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.3);
}

#show-deleted-photos:hover {
    background: linear-gradient(135deg, #6d5a42, #5a4932);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.4);
}

#deleted-photos-container {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

.deleted-photo-item {
    position: relative;
}

.deleted-photo-item img {
    opacity: 0.6;
    filter: grayscale(50%);
}

.restore-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #5cb85c, #449d44);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.restore-photo:hover {
    background: linear-gradient(135deg, #449d44, #357935);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.restore-photo:before {
    content: "↶";
    font-weight: bold;
}