.template-colors {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    box-sizing: border-box;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-field label {
    font-weight: 500;
}

.color-field input[type="color"] {
    padding: 1px;
    width: 50px;
    height: 30px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.template-item {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    text-align: center;
}

.template-item:hover {
    border-color: #2271b1;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.template-item.thp-tab-active {
    border-color: #2271b1;
    background: #f0f7ff;
}

.template-item input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.color-field input[type="range"] {
    width: 100px;
    vertical-align: middle;
}

.scale-value {
    min-width: 30px;
    display: inline-block;
    text-align: center;
    margin-left: 5px;
}

.template-preview {
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
    transition: all ease 0.3s;
}

.template-preview.image-tp-template{
    background:#f8f9fa !important;
    font-size: 13px;
}

.template-preview > div {
    transition: scale ease 0.3s;
}

.template-preview.image-tp-template > div{
    transform: scale(1.0) !important;
    color: #555 !important;
    padding: 10px;
    box-sizing: border-box;
}

.template-name {
    display: block;
    margin-top: 10px;
    font-weight: 500;
    color: #1d2327;
    font-size: 13px;
}

#typing-effect-text-field {
    width: 100%;
    margin-top: 5px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 13px;
}

.template-preview #typing-effect-text-field {
    background: rgba(255, 255, 255, 0.9);
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .template-colors {
        flex-wrap: wrap;
    }
    
    .color-field {
        min-width: 150px;
    }
    
    .button-primary {
        margin-left: 0 !important;
        width: 100%;
        margin-top: 10px;
    }
}

/* Animation for selection */
.template-item input[type="radio"]:checked + .template-preview {
    animation: select-pulse 0.3s ease-out;
}

@keyframes select-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}