#template-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#template-popup-container {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#template-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background-color: #f8f8f8;
}

#template-popup-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#template-popup-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #666;
    padding: 0;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#template-popup-close:hover {
    background-color: #eee;
    color: #000;
}

#template-popup-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

#template-popup-content .loading {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

#template-popup-content .error {
    color: #d63638;
    text-align: center;
    padding: 20px;
}
#template-popup-content img {
    width: 100%;
}
/* Make sure the Gutenberg blocks display properly in the popup */
#template-popup-content .wp-block {
    max-width: 100%;
}