* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.design-template-container {
    display: flex;
    gap: 20px;
}

.template-sidebar {
    width: 310px;
    background-color: #fff;
    padding: 32px 0;
    z-index: 99;
}

.template-sidebar h3 {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Poppins';
    padding: 8px;
}

.template-sidebar ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.template-sidebar > ul > li {
    margin: 15px 0;
}

.template-sidebar li a {
    padding: 8px 8px 8px 12px;
    color: #2E2E2E;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.template-sidebar > ul > li > ul > li {
    padding: 8px 8px 8px 12px;
}

.template-sidebar .children {
    display: block; /* Default: show all */
}

.template-sidebar .children.collapsed {
    display: none; /* When user collapses */
}

.template-sidebar .parent-toggle {
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-top: 1px solid #DEDEDE;
}

.dropdown-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown-icon.rotated {
    transform: rotate(180deg);
}

.templates-container{
    width: 950px;
}

.template-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 7px;
    padding: 32px;
}

.template-card {
    padding: 10px;
    text-align: center;
    transition: box-shadow 0.3s;
    width: 290px;
    border-radius: 8px;
    position: relative;
}

.template-card:hover{
    background-color: #fff;
    box-shadow: 1px 1px 1px 1px #0C0C0D26;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.template-card img {
    width: 278px;
    height: 281px;
    object-fit: cover;
    border-radius: 4px;
}

.template-card-title {
    margin-top: 10px;
    font-size: 16px;
    color: #0D0D0D;
    font-weight: 600;
}

/* Skeleton styles */
.skeleton-card {
    width: 290px;
    background-color: #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    animation: pulse 1.2s infinite ease-in-out;
}

.skeleton-img {
    width: 100%;
    height: 281px;
    background: #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-title {
    height: 16px;
    width: 80%;
    background: #ccc;
    border-radius: 4px;
    margin: 0 auto;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.template-card,
.skeleton-card {
    transition: all 0.3s ease;
}


.template-sidebar .children li.active {
    background-color: #F3EEFE;
    border-radius: 5px;
    border-left: 4px solid #8855F3;
}

.template-card .template-card-overlay{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: #3b3b3b49;
    display: none;
    border-radius: 8px;
}

.template-card .select-template-btn{
    background-color: #8855F3;
    color: #fff;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 14px;
    position: absolute;
    top: 43%;
    left: 27%;
}

.template-card:hover .template-card-overlay{
    display: block;
    cursor: pointer;
}

@media screen and (max-width: 479px){
    .design-template-container {
        flex-direction: column;
    }

    .template-grid{
        flex-direction: column;
    }

    .templates-container{
        width: 100%;
    }

    .template-card{
        width: 100%;
    }

    .template-sidebar {
        width: 100%;
        padding: 32px 15px;
    }

    .template-card img {
        width: 100%;
        height: 310px;
    }

    .template-grid {
        padding: 34px 13px;
    }

    .templates-container > p {
        padding: 30px 25px 0 25px !important;
    }


}