/* =========================================================
   Templates page – refreshed UI (matches new admin dashboard)
   File: public/css/templates.css
   (also contains the styles that used to be inline in the blade)
   ========================================================= */
main[pageid="templates"]{
    --tp-primary: #4f46e5;
    --tp-primary-dark: #4338ca;
    --tp-soft: #eef0ff;
    --tp-text: #111827;
    --tp-muted: #6b7280;
    --tp-border: #eceef5;

    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #f6f7fb;
    color: var(--tp-text);
    padding-bottom: 70px;
}

/* ---------- Hero ---------- */
.template_1{
    padding-top: 75px;
}
.template_1 .hero_card{
    position: relative;
    overflow: hidden;
    padding: 44px 52px;
    background: linear-gradient(135deg, #eef0ff 0%, #ffffff 60%);
    border: 1px solid var(--tp-border);
    border-radius: 24px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 28px rgba(16,24,40,.05);
}
.template_1 .hero_card::before{
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(99,102,241,.22), transparent 70%);
    pointer-events: none;
}
.template_1 .hero_card > .row{
    position: relative;
    z-index: 1;
}
.template_1 .hero_badge{
    display: inline-block;
    margin-bottom: 16px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #d9dcfa;
    border-radius: 999px;
    color: var(--tp-primary);
    font-size: 13px;
    font-weight: 600;
}
.template_1 h2{
    font-size: 2.1rem;
    line-height: 1.25;
    letter-spacing: -.02em;
    color: var(--tp-text);
}
.template_1 p{
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
    color: var(--tp-muted);
}
.template_1 img{
    width: 360px;
    max-width: 100%;
    filter: drop-shadow(0 16px 28px rgba(79,70,229,.18));
}

/* ---------- Template cards ---------- */
.template_2 .col-md-2{
    width: 20%;
}
.template_2 article.space_t{
    margin-top: 24px;
    padding: 26px 26px 20px;
    background: #fff;
    border: 1px solid var(--tp-border);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.04);
    transition: box-shadow .2s, border-color .2s;
}
.template_2 article.space_t:hover{
    border-color: #c7caf7;
    box-shadow: 0 10px 30px rgba(79,70,229,.12);
}
.template_2 article.space_t > .row:first-child{
    align-items: center;
}
.template_2 h4{
    margin-bottom: 18px !important;
    font-size: 20px;
    letter-spacing: -.01em;
    color: var(--tp-text);
}

/* "Use Templates" pill button */
.template_2 a.cursor-pointer{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 9px 20px;
    background: var(--tp-soft);
    border-radius: 999px;
    color: var(--tp-primary) !important;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s, color .15s, box-shadow .15s;
}
.template_2 a.cursor-pointer:hover{
    background: var(--tp-primary);
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(79,70,229,.28);
}
.template_2 a.cursor-pointer .fa{
    transition: transform .15s;
}
.template_2 a.cursor-pointer:hover .fa{
    transform: translateX(3px);
}

/* ---------- Screenshot thumbnails ---------- */
.template_gfhj .position-relative{
    overflow: hidden;
}
/* sweep overlay while image loads */
.template_gfhj .position-relative::before{
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--bs-gutter-x, 1.5rem) * .5);
    right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    z-index: 1;
    display: block;
    background: #e5e7f5;
    border-radius: 14px;
    transform-origin: 100% 50%;
    transform: scaleX(0) translateX(0);
    animation: 1s overlay ease-in-out forwards;
}
.template_2 img{
    border: none;
}
.img-thumbnail{
    display: block;
    width: 100%;
    background: #f1f2f8;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    transform: scale(0.8);
    opacity: 0;
    animation: 1s .5s loaded cubic-bezier(.49,0,.5,1) forwards;
}
@keyframes loaded{
    from{ transform: scale(0.8); opacity: 0; }
    to{ transform: scale(1); opacity: 1; }
}
@keyframes overlay{
    0%{ transform: scaleX(0); }
    55%{ transform: scaleX(1); }
    100%{ transform: translateX(-106%); }
}

/* ---------- Load more / spinner / empty ---------- */
button.load_template{
    padding: 0.6rem 40px;
    background: var(--tp-primary);
    border: 1px solid var(--tp-primary);
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(79,70,229,.28);
    transition: background .15s;
}
button.load_template:hover{
    background: var(--tp-primary-dark);
}
#spinner{
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(164,162,162,.3);
    border-radius: 50%;
    border-top-color: var(--tp-primary);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin{
    to{ transform: rotate(360deg); }
}
.template_2 .remove_h{
    padding: 50px 20px;
    background: #fff;
    border: 1.5px dashed #d9dcfa;
    border-radius: 20px;
    color: var(--tp-muted);
}
.template_2 .remove_h img{
    max-width: 220px;
    margin-bottom: 14px;
}

/* ---------- Mobile "Use Templates" row (hidden on desktop) ---------- */
.template_2 .mbldiv{
    display: none;
}

/**mediaQuery**/
@media(max-width: 575px){
    .template_1 img{
        display: none;
    }
    .template_1 .hero_card{
        padding: 28px 22px;
    }
}

@media(max-width: 768px){
    .template_1{
        padding-top: 60px;
    }
    .template_2 article.space_t{
        padding: 20px 18px 16px;
        margin-top: 18px;
    }
    .template_2 .deskdiv{
        display: none;
    }
    .template_2 .mbldiv{
        display: block;
        text-align: end;
        margin-top: 5px;
    }
    .template_2 .mbldiv a.cursor-pointer{
        margin: 8px 0 0;
    }
    .template_2 .template_gfhj{
        flex-wrap: nowrap;
        display: flex;
        overflow-x: auto;
        padding-bottom: 10px;
    }
}
@media(max-width: 992px){
    .template_1 h2 br{
        display: none;
    }
    .template_1 h2{
        font-size: 1.4rem;
    }
    .template_1 p{
        font-size: 16px;
    }
    .template_2 h4{
        font-size: 18px;
    }
    .template_1 img{
        width: 100%;
    }
    .template_1 .hero_card{
        padding: 32px 28px;
    }
}