.templates-showcase-container {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
}

.templates-preview {
    flex: 50;
    position: relative;
}

.preview-image-container {
    position: sticky;
    top: 2rem;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.preview-image-container img {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease-out;
}

.preview-image-container.scrollable {
    height: 1040px;
    overflow: hidden;
}

.preview-image-container.scrollable img {
    cursor: pointer;
}

.right-side {
    flex: 40;
    text-align: center;
}

.templates-grid {
    flex: 50;
    display: flex;
    flex-direction: row-reverse;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-height: 950px;
    overflow-y: scroll;
    direction: ltr;
}

.template-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.view-all-button {
    margin-top: 30px;
    text-align: center;
    color: #004680;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
    transition: all .3s cubic-bezier(.25, .8, .25, 1);
    cursor: pointer;
    display: inline-block;
    border-radius: 25px;
    font-size: 22px;
    background-color: #fff;
    font-weight: 700;
    padding: 10px 15px;
}

.template-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-thumbnail {
    position: relative;
    overflow: hidden;
}

.template-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.template-info {
    padding: 1rem;
}

.template-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
}

.template-categories {
    font-size: 0.9rem;
    color: #666;
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media (max-width: 768px) {
    .templates-showcase-container {
        flex-direction: column-reverse;
    }

    .preview-image-container {
        position: relative;
        top: 0;
    }

    .templates-grid {
        flex-wrap: nowrap;
        min-width: max-content;
    }

    .right-side>div {
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .preview-image-container {
        overflow-y: scroll !important;
    }
}

/* Templates Tabs Styles */
.templates-tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.templates-tabs-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab-button {
    border-radius: 25px;
    padding: 6px 24px;
    font-size: 18px;
    color: #777;
    cursor: pointer;
    transition: all 0.3s ease;
    border: unset;
}

.tab-button:hover {
    background: linear-gradient(to right, rgba(1, 71, 127, 0.8), rgba(134, 178, 129, 0.8));
    color: #fff;
}

.tab-button.active {
    background: linear-gradient(to right, rgba(1, 71, 127, 0.8), rgba(134, 178, 129, 0.8));
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 3x3 Grid Layout */
.templates-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 0 auto;
}

.template-grid-item {
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.25);
}

.template-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.template-grid-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.template-grid-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.template-grid-item:hover .template-grid-thumbnail img {
    transform: scale(1.05);
}

.template-hover-buttons {
    position: absolute;
    display: flex;
    gap: 15px;
    opacity: 0;
    transition: all 0.3s ease;
    top: 0;
    bottom: 0;
    width: 100%;
    align-items: center;
    padding: 0 10px;
    background-color: rgba(19, 21, 27, 0.625);
    justify-content: center;
}

.template-grid-item:hover .template-hover-buttons {
    opacity: 1;
    transform: translateY(0);
}

.preview-btn,
.action-btn {
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #33ada9;
    font-weight: 400;
    border-radius: 6px;
    padding: 12px 40px;
}

.preview-btn:hover,
.action-btn:hover {
    background-color: #39c1bc;
}

.action-btn {
    background: unset;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.125);
}

.action-btn:hover {
    background-color: rgba(255, 255, 255, 0.075);
}

.template-grid-info {
    padding: 1rem;
    text-align: center;
}

.templates-tabs-nav-wrapper {
    width: fit-content;
    margin: auto;
    margin-bottom: 95px;
    background-color: #f8f9fa;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
}

.template-grid-info h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

/* Loading States */
.loading-templates {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    padding: 2rem;
}

.loading-spinner::before {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

.no-templates {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 18px;
}

@media (max-width: 1024px) {
    .templates-grid-3x3 {
        grid-template-columns: repeat(2, 1fr);
    }

}

/* Responsive Design */
@media (max-width: 767px) {
    .templates-tabs-nav {
        display: none !important;
    }

    .templates-tabs-select {
        display: block !important;
        width: 100%;
        margin-bottom: 1rem;
        font-size: 18px;
        padding: 8px 12px;
        border-radius: 8px;
        border: 1px solid #ccc;
        background: #f8f9fa;
    }

    .templates-grid-3x3 {
        grid-template-columns: repeat(1, 1fr);
    }

    .templates-tabs-nav-wrapper {
        margin-bottom: 35px;
        width: 100%;
        box-shadow: unset;
        background: #fff;
    }
}

@media (min-width: 768px) {
    .templates-tabs-select {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .templates-grid-3x3 {
        grid-template-columns: 1fr;
    }

    .template-hover-buttons {
        flex-direction: row;
        gap: 0.5rem;
    }

    .preview-btn,
    .action-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 80px;
    }
}