/* Container styling */
#template-site-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 1500px !important;
    margin: auto;
}

/* Style for category */
.category-list {
    background: linear-gradient(135deg, #f9f9f9, #ececec);
}

.template-grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px auto;
}

.category-list ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
}

.category-list li {
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}


.category-list label {
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-list label:hover {
    background: #e0f7fa;
    color: #00796b;
    transform: scale(1.05);
}


.filter-checkbox { 
    /* appearance: none; */
    width: 20px;
    height: 20px;
    border: 2px solid #5CD85C;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    background-color: white;
    transition: all 0.3s ease;
}

.filter-checkbox:hover {
    background-color: #e8f5e9;
    border-color: #388E3C;
}

.filter-checkbox:checked {
    background: #4CAF50;
    border-color: #4CAF50;
}

/* Khi checkbox được chọn */
.filter-checkbox:checked::before {
    content: '✔';
    font-size: 14px;
    color: white;
    font-weight: bold;
    text-align: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #5CD85C;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Khi chọn, thay đổi màu nền của hàng */
.category-list label.active {
    background: #e8f5e9;
    font-weight: bold;
    border-radius: 20px;
    padding: 5px 10px;
}


.filter-checkbox-wrapper label {
    display: flex;
    align-items: center;
    justify-content: center; /* Canh giữa nội dung */
    gap: 8px;
}
/* Style for template */
.template-grid {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.template-item {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex !important;
    transition: all 0.3s ease-in-out;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.template-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.template-image img {
    width: 100%;
    height: auto;
}

.template-image {
    position: relative;
    overflow: hidden;
}

.template-image::after {
    content: 'Click để xem';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.template-image:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.template-content {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    flex-wrap: wrap;
}

.template-title {
    font-size: 20px !important;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    flex-grow: 1;
    transition: all 0.3s ease;
}

#template-site-container .template-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}


.template-button-show {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
}

.template-button-show:hover {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    transform: scale(1.1);
}

.template-button-register {
    background: linear-gradient(135deg, #FF5733, #D32F2F);
}

.template-button-register:hover {
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
    transform: scale(1.1);
}
.template-button-signup {
    background: linear-gradient(135deg, #FF5733, #D32F2F);
}
.template-button-signup:hover {
    background-color: rgb(217, 16, 9);  /* Màu nền khi hover */
    transform: scale(1.05);
}
/* Style for load more */
#load-more-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 40px;
}

#load-more {
    width: 140px;
    text-align: center;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    padding: 12px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: white;
    transition: all 0.3s ease;
    border: none;
}

#load-more:hover {
    background: linear-gradient(135deg, #388E3C, #1B5E20);
    transform: scale(1.1);
}

.loader, .search-loader {
    border: 5px solid #f3f3f3; /* Màu nền */
    border-top: 5px solid #5CD85C; /* Màu viền trên */
    border-radius: 50%;
    width: 40px; /* Đường kính của loader */
    height: 40px; /* Đường kính của loader */
    animation: spin 1s linear infinite; /* Hiệu ứng quay */
    margin-bottom: 10px;
    justify-items: center;
}

/* Style for spin */
@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #4CAF50;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#template-site-container .template-button-show,
#template-site-container .template-button-register {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 12px;
    transition: background-color 0.3s ease, color 0.3s ease;
    width: auto;
    min-width: 100px;
    font-weight: bold;
}
#template-site-container .template-button-signup {
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 12px;
    transition: background-color 0.3s ease, color 0.3s ease;
    width: auto;
    min-width: 100px;
    font-weight: bold;
}
/* Nút Xem Demo */
#template-site-container .template-button-show {
    background-color: #2ECC71;
}

/* Nút Đăng ký ngay */
#template-site-container .template-button-register {
    background-color: #FF5733;

}

#template-site-container .template-button-register:hover {
    background-color: rgb(217, 16, 9);

}
#template-site-container .template-button-signup {
    background-color: #FF5733;

}

#template-site-container .template-button-signup:hover {
    background-color: rgb(217, 16, 9);

}

.search-template form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
    justify-items: center;
}

#search-input {
    flex: 1;
    padding: 8px;
    font-size: 16px;
    border: 2px solid #ddf8dc;
    border-radius: 5px;
    outline: none;
}

#search-button {
    padding: 10px 18px;
    font-size: 16px;
    border: none;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
    white-space: nowrap;
    transition: all 0.3s ease;
}

#search-button:hover {
    background: linear-gradient(135deg, #388E3C, #1B5E20);
    transform: scale(1.1);
}
#search-results {
    margin-bottom: 20px;
}

#load-more-search-wrapper {
    text-align: center;
    margin-top: 20px;
}

#load-more-search {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#load-more-search:hover {
    background-color: #0056b3;
}

#load-more-search-wrapper .loader {
    margin: 10px auto;
}

.page-content a {
    text-decoration: none !important;
}