/* General styling for the Duda site creator gallery */
#template-gallery {
    display: grid;
    grid-gap: 10px; /* Spacing between items */
    padding: 0;
    justify-content: center;
}

/* Define grid layout for different screen sizes */
@media (min-width: 1200px) {
    #template-gallery {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on wide screens */
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    #template-gallery {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on laptop screens */
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    #template-gallery {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet screens */
    }
}

@media (max-width: 767.98px) {
    #template-gallery {
        grid-template-columns: 1fr; /* 1 column on mobile screens */
    }
}

/* Style for making the item full width */
#template-gallery.single-item .template-item.full-width {
    width: 100% !important; /* Force full width */
    max-width: 100% !important;
}


/* Define variable heights for a masonry effect */
.template-item {
    position: relative;
    transition: transform 0.3s ease;
    width: 100%; /* Ensures items fill the grid cell */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.template-item .card {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    height: 630px;
}

/* .template-item:nth-child(3n) .card {
    height: 500px; 
}

.template-item:nth-child(3n+1) .card {
    height: 550px;
}

.template-item:nth-child(3n+2) .card {
    height: 600px; 
} */

/* Image styling */
.template-item .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* Template name styling */
.card-title {
    text-align: center;
    text-transform: capitalize;
    padding: 10px 20px;
    font-size: 14px;
    display: block;
    position: absolute;
    bottom: -12px;
    width: 100%;
    background-color: #fff;
    color: #666;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card .item-actions {
    /* position: absolute;
    top: 10px;
    right: 20px; */
    margin-top: 10px;
}

.card .item-actions span {
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.3;
    font-weight: 400;
}

/* Button overlay - hidden by default */
.template-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-direction: column;
    gap: 10px;
}

.template-item:hover .overlay {
    opacity: 1;
}

/* Button styling inside overlay */
.template-item .overlay .btn {
    min-width: 180px;
    min-height: 50px;
    background-color: #fff;
    color: #FC6B3F;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background-color 0.2s, transform 0.2s;
}

.template-item .overlay .btn .fas {
    margin-right: 7px;
}

.template-item .overlay .btn:hover {
    background-color: #FC6B3F;
    color: #fff;
    transform: scale(1.1);
}

/* Popup overlay styling - Fullscreen centered overlay, hidden by default */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    max-width: 100% !important;
}

/* Popup content box - centered and responsive */
#data-collection-popup .popup-content {
    max-width: 700px;
}

.popup-content {
    background: #fff;
    padding: 20px;
    width: 90%;
    max-width: 1140px;
    max-height: 90vh;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border-radius: 8px;
    margin: auto;
}

/* Data collection form styling */
#duda-data-collection-form {
    width: 100%;
}

#duda-data-collection-form label {
    display: block;
    font-weight: bold;
    margin-top: 10px;
    color: #666;
}

#duda-data-collection-form input,
#duda-data-collection-form textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#duda-data-collection-form button[type="submit"] {
    background-color: #FC6B3F;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
    transition: background-color 0.3s;
}

#duda-data-collection-form button[type="submit"]:hover {
    background-color: #e05a30;
}

/* Close button styling */
.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
}

input.select2-search__field {
    display: none;
}

.select2-selection--multiple {
    border: 1px solid #ddd !important;
    min-height: 38px !important;
}