/**
 * JSON Popup - Clean Modern Design
 * Matching reference with proper spacing and layout
 */

.acf-json-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cnc-acf-overlay-bg);
    z-index: var(--cnc-acf-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--cnc-acf-font-family);
    backdrop-filter: blur(4px);
    padding: var(--cnc-acf-spacing-md);
}

.acf-json-popup {
    background: var(--cnc-acf-white);
    border-radius: 16px;
    box-shadow: var(--cnc-acf-shadow-2xl);
    width: var(--cnc-acf-popup-max-width);
    max-width: 90%;
    max-height: var(--cnc-acf-popup-max-height);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.acf-json-popup-header {
    padding: 28px var(--cnc-acf-spacing-xl);
    background: var(--cnc-acf-white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.acf-json-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: var(--cnc-acf-font-weight-bold);
    font-family: var(--cnc-acf-font-family);
    color: var(--cnc-acf-text-black);
    text-align: center;
}

.acf-json-popup-close {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    color: rgba(0, 0, 0, 0.6);
    line-height: 1;
}

.acf-json-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--cnc-acf-text-black);
}

.acf-json-popup-body {
    padding: 32px;
    padding-top: 24px;
    padding-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(180deg, rgba(174, 207, 255, 0.08) 0%, rgba(153, 102, 255, 0.08) 100%);
}

.acf-json-textarea {
    width: 100%;
    min-height: 120px !important;
    font-family: var(--cnc-acf-code-font);
    font-size: 13px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.6);
    color: var(--cnc-acf-text-black);
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.acf-json-textarea:focus {
    border-color: var(--cnc-acf-primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(97, 103, 248, 0.15);
    background: var(--cnc-acf-white);
}

.acf-json-copy-btn,
.acf-json-paste-btn {
    background: var(--cnc-acf-primary-color);
    color: var(--cnc-acf-text-white);
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--cnc-acf-font-family);
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(97, 103, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

/* .acf-json-copy-btn::before {
    content: "📋";
    font-size: 18px;
}

.acf-json-paste-btn::before {
    content: "📋";
    font-size: 18px;
} */

.acf-json-copy-btn:hover,
.acf-json-paste-btn:hover {
    background: var(--cnc-acf-primary-accent);
    box-shadow: 0 6px 16px rgba(97, 103, 248, 0.4);
    transform: translateY(-2px);
}

.acf-json-copy-btn:active,
.acf-json-paste-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(97, 103, 248, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
    .acf-json-popup {
        margin: 16px;
        border-radius: 12px;
    }

    .acf-json-popup-header {
        padding: 20px 24px;
    }

    .acf-json-popup-header h3 {
        font-size: 18px;
    }

    .acf-json-popup-body {
        padding: 24px;
    }

    .acf-json-textarea {
        min-height: 180px;
        font-size: 12px;
    }

    .acf-json-copy-btn,
    .acf-json-paste-btn {
        padding: 12px 24px;
    }
}