.vsg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding-top: 15px;
    padding-bottom: 20px;
}

.vsg-gallery-item {
    overflow: hidden;
    text-align: center;
}

.vsg-gallery-item img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Prevent Elementor lightbox interference */
.vsg-gallery-item a,
.vsg-gallery-item img {
    pointer-events: auto !important;
}

.vsg-gallery-item a[href] {
    cursor: pointer !important;
}

.vsg-gallery-item .elementor-lightbox,
.vsg-gallery-item .elementor-lightbox-item {
    display: none !important;
}

/* Force our cursor style */
.vsg-gallery-item a.vsg-lightbox-link {
    cursor: pointer !important;
    text-decoration: none !important;
}

.vsg-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0px;
    padding:0;
}

.vsg-gallery-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.vsg-loadmore-wrap {
    text-align: center;
}
.vsg-gallery-container .vsg-upload-button {
    padding: 10px 18px;
    border: none;
    background-color: #58ae47;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.25s ease;
}

.vsg-gallery-container .vsg-upload-button:hover {
    background-color: #f59739;
    border: none;
}

.vsg-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.vsg-upload-modal-content {
    width: 100%;
    max-width: 620px;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.vsg-upload-close {
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 2;
    padding: 2px 5px !important;
    border: 0 !important;
    background: transparent;
    font-size: 28px !important;
    line-height: 1 !important;
    color: #ffffff !important;
    cursor: pointer !important;
}

.vsg-upload-close:hover {
    color: #000;
}

.vsg-frontend-upload {
    background-color: transparent;
    border: none;
    padding: 0;
}

.vsg-frontend-upload h3 {
    margin-top: 0;
    color: #333;
    font-size: 22px;
}

.vsg-form-inline .form-table tr {
    display: block;
}

.vsg-filter-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.vsg-filter-btn:hover {
    border-color: #999;
    background-color: #f5f5f5;
}

.vsg-filter-btn.active {
    background-color: #58ae47;
    color: #fff;
    border-color: #58ae47;
}

.vsg-selected-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.vsg-selected-image {
    position: relative;
    width: 110px;
    height: 90px;
    border: 1px solid #c3c4c7;
    background: #fff;
}

.vsg-selected-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vsg-selected-image .button-link-delete {
    position: absolute;
    top: 2px;
    right: 5px;
    color: #b32d2e;
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
}

.vsg-frontend-upload {
    padding: 20px;
}

.vsg-frontend-upload h3 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}

.vsg-frontend-upload .form-table {
    width: 100%;
    margin: 0 0 20px 0;
}

.vsg-frontend-upload .form-table tr {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.vsg-frontend-upload .form-table th {
    flex: 0 0 150px;
    text-align: left;
    font-weight: 600;
    padding: 0;
    background: transparent;
    border: none;
}

.vsg-frontend-upload .form-table td {
    flex: 1;
    min-width: 250px;
    padding: 0;
    border: none;
}

.vsg-frontend-upload select,
.vsg-frontend-upload input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.vsg-frontend-upload .button {
    margin-right: 8px;
    margin-bottom: 10px;
}

.vsg-frontend-upload .description {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.vsg-frontend-upload .submit {
    margin: 20px 0 0 0;
}

.vsg-frontend-upload .button-primary {
    padding: 10px 20px;
    font-size: 14px;
}

/* Lightbox Styles */
.vsg-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
}

.vsg-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
}

.vsg-lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 4px;
}

.vsg-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.vsg-lightbox-close:hover {
    color: #ccc;
}

.vsg-lightbox-prev,
.vsg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s;
    z-index: 10001;
}

.vsg-lightbox-prev:hover,
.vsg-lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.vsg-lightbox-prev {
    left: 20px;
}

.vsg-lightbox-next {
    right: 20px;
}

.vsg-lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
}
