/* Gallery Review Form Styles */
.gallery-review-form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.gallery-review-form-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group .required {
    color: #d63638;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.form-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.btn-submit {
    background: #2271b1;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.btn-submit:hover {
    background: #135e96;
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Image Preview */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.image-preview-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

/* Gallery Display Styles - CSS Grid Layout */
.gallery-display-wrapper {
    margin: 30px 0;
    width: 100%;
}

.gallery-display-container {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Grid Layout - Responsive CSS Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 0;
    padding: 0;
}

/* Column variations based on shortcode attribute */
.gallery-display-wrapper[data-columns="1"] .gallery-grid {
    grid-template-columns: repeat(1, 1fr);
}

.gallery-display-wrapper[data-columns="2"] .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-display-wrapper[data-columns="3"] .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-display-wrapper[data-columns="4"] .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-display-wrapper[data-columns="5"] .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #2271b1;
}

.gallery-image-link {
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #f5f5f5;
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.08);
}

.gallery-item-name {
    padding: 12px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.7));
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    z-index: 2;
}

.gallery-no-items {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Pagination Styles */
.gallery-pagination {
    margin-top: 30px;
    text-align: center;
}

.gallery-pagination .page-numbers {
    display: inline-block;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gallery-pagination .page-numbers li {
    display: inline-block;
    margin: 0 5px;
}

.gallery-pagination .page-numbers a,
.gallery-pagination .page-numbers span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #2271b1;
    transition: all 0.3s ease;
}

.gallery-pagination .page-numbers a:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.gallery-pagination .page-numbers .current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    cursor: default;
}

.gallery-pagination .page-numbers .dots {
    border: none;
    cursor: default;
}

/* WordPress Style Lightbox Overrides - SimpleLightbox */
.sl-overlay {
    background: rgba(0, 0, 0, 0.9) !important;
    z-index: 999998 !important;
}

.sl-wrapper {
    z-index: 999999 !important;
}

.sl-wrapper .sl-close,
.sl-wrapper .sl-navigation button {
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    line-height: 50px !important;
    opacity: 0.9 !important;
    transition: all 0.3s ease !important;
    color: #333 !important;
    font-size: 24px !important;
}

.sl-wrapper .sl-close:hover,
.sl-wrapper .sl-navigation button:hover {
    background: rgba(255, 255, 255, 1) !important;
    opacity: 1 !important;
    transform: scale(1.1);
}

.sl-wrapper .sl-counter {
    color: #fff !important;
    font-size: 14px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    padding: 8px 15px !important;
    border-radius: 20px !important;
}

.sl-wrapper .sl-caption {
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    padding: 12px 20px !important;
    text-align: center !important;
}

/* Responsive Grid Layout */
@media (max-width: 900px) {
    .gallery-display-wrapper[data-columns="4"] .gallery-grid,
    .gallery-display-wrapper[data-columns="5"] .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .gallery-display-wrapper[data-columns="3"] .gallery-grid,
    .gallery-display-wrapper[data-columns="4"] .gallery-grid,
    .gallery-display-wrapper[data-columns="5"] .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .gallery-review-form-container {
        padding: 15px;
    }
    
    .sl-wrapper .sl-close,
    .sl-wrapper .sl-navigation button {
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 20px !important;
    }
}

