/* --- Plugin Styling using Candidate Theme Colors --- */

:root {
    --cpg-purple: #320098;
    --cpg-pink: #e13479;
    --cpg-red: #ee5b65;
    --cpg-black: #000000;
    --cpg-light-bg: #f5f2f9;
    --cpg-text-dark: #333;
}

.cpg-profile-editor {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: var(--cpg-light-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cpg-profile-editor h2 {
    font-family: 'Montserrat', sans-serif;
    color: var(--cpg-purple);
    border-bottom: 2px solid var(--cpg-pink);
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.cpg-profile-editor h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--cpg-black);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.cpg-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--cpg-light-bg);
    border: 1px solid #ddd;
    border-radius: 8px;
}

.cpg-form-group {
    margin-bottom: 20px;
}

.cpg-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--cpg-text-dark);
}

.cpg-input-text,
.cpg-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cpg-input-text:focus,
.cpg-textarea:focus {
    border-color: var(--cpg-purple);
    box-shadow: 0 0 0 3px rgba(50, 0, 152, 0.2);
    outline: none;
}

.cpg-textarea {
    resize: vertical;
}

.cpg-code-input {
    font-family: monospace;
    background-color: #fcfcfc;
}

.cpg-description-small {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

.cpg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.cpg-button {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.cpg-button-preview {
    background-color: var(--cpg-red);
    color: var(--cpg-light-bg);
}

.cpg-button-preview:hover {
    background-color: #d9505a;
    transform: translateY(-1px);
}

.cpg-button-primary {
    background-color: var(--cpg-purple);
    color: var(--cpg-white);
}

.cpg-button-primary:hover {
    background-color: var(--cpg-pink);
    transform: translateY(-1px);
}

/* JSON Example Styling */
.cpg-code-example {
    background: #fdfdff;
    padding: 15px;
    border: 1px solid var(--cpg-purple);
    border-radius: 4px;
    white-space: pre-wrap;
    font-size: 0.9em;
    color: var(--cpg-text-dark);
    max-height: 200px;
    overflow-y: auto;
}

.cpg-show-example {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.9em;
    color: var(--cpg-purple);
    text-decoration: none;
    font-weight: 600;
}

.cpg-show-example:hover {
    text-decoration: underline;
}

/* Success Notice */
.cpg-notice-success {
    background-color: #e6ffed;
    color: #1f7a33;
    border: 1px solid #7ed98c;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
}

.cpg-error {
    color: var(--cpg-red);
    font-weight: 600;
    padding: 20px;
    border: 1px solid var(--cpg-red);
    background: #ffeeee;
    border-radius: 4px;
}

/* --- Modal Styling --- */
.cpg-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 100000;
    /* High Z-index to ensure it sits above everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    /* Black w/ opacity */
}

.cpg-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    /* 5% from the top and centered */
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    min-height: 550px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.cpg-modal-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.cpg-close-btn {
    color: #aaa;
    float: right;
    font-size: 38px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.cpg-close-btn:hover,
.cpg-close-btn:focus {
    color: var(--cpg-red);
    text-decoration: none;
}

.cpg-preview-body h4 {
    color: var(--cpg-purple);
    font-family: 'Montserrat', sans-serif;
    margin-top: 1.5em;
    font-size: 1.6em;
}

.cpg-preview-issue {
    border-left: 5px solid var(--cpg-pink);
    padding: 10px 15px;
    margin-bottom: 15px;
    background: #fff;
    border-radius: 4px;
}

.cpg-preview-issue h5 {
    font-family: 'Montserrat', sans-serif;
    color: var(--cpg-black);
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.cpg-preview-issue p {
    font-size: 0.95em;
    margin: 0;
}

.cpg-modal-footer {
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.cpg-button-close {
    background-color: #ccc;
    color: var(--cpg-black);
}

.cpg-button-close:hover {
    background-color: #bbb;
}