/* WP Entity Link Generator - Admin Styles */

.wpelg-wrap {
    max-width: 1200px;
}

.wpelg-wrap h1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpelg-wrap h1 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.wpelg-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.wpelg-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.wpelg-field {
    flex: 1;
    min-width: 200px;
}

.wpelg-field.wpelg-full {
    flex: 1 1 100%;
}

.wpelg-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1d2327;
}

.wpelg-field input[type="text"],
.wpelg-field input[type="url"],
.wpelg-field select,
.wpelg-field textarea {
    width: 100%;
    max-width: 100%;
}

.wpelg-field input[readonly] {
    background: #f0f0f1;
    color: #50575e;
}

.wpelg-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.wpelg-actions .button-hero {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: auto;
    padding: 8px 24px;
    font-size: 15px;
}

.wpelg-actions .button-hero .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Results */
.wpelg-results {
    margin-top: 24px;
}

.wpelg-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.wpelg-result-item {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 12px 16px;
}

.wpelg-result-item.wpelg-full-width {
    grid-column: 1 / -1;
}

.wpelg-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wpelg-result-header strong {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #2271b1;
}

.wpelg-output {
    width: 100%;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 8px 10px;
    resize: vertical;
    min-height: 48px;
}

.wpelg-copy-btn {
    min-width: 60px;
}

.wpelg-copy-btn.copied {
    background: #00a32a !important;
    border-color: #00a32a !important;
    color: #fff !important;
}

/* Notice */
.wpelg-notice {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 4px 4px 0;
}

.wpelg-notice.warning {
    background: #fcf9e8;
    border-left-color: #dba617;
}

.wpelg-notice.error {
    background: #fcf0f1;
    border-left-color: #d63638;
}

.wpelg-notice.success {
    background: #edfaef;
    border-left-color: #00a32a;
}

/* Table */
.wpelg-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.wpelg-table-wrap table {
    min-width: 900px;
}

.wpelg-table-wrap td {
    vertical-align: top;
    font-size: 13px;
}

.wpelg-table-wrap .wpelg-mini-code {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    background: #f6f7f7;
    padding: 4px 6px;
    border-radius: 3px;
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.wpelg-table-wrap .wpelg-mini-code:hover {
    background: #e8f0fe;
}

.wpelg-status-ok {
    color: #00a32a;
    font-weight: 600;
}

.wpelg-status-error {
    color: #d63638;
    font-weight: 600;
}

/* Frontend shortcode */
.wpelg-frontend {
    max-width: 900px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wpelg-frontend .wpelg-shortcode-title {
    margin-bottom: 8px;
    font-size: 1.4em;
}

.wpelg-frontend .wpelg-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wpelg-frontend input[type="text"],
.wpelg-frontend input[type="url"],
.wpelg-frontend select,
.wpelg-frontend textarea {
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.wpelg-frontend .button {
    cursor: pointer;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #2271b1;
    background: #2271b1;
    color: #fff;
}

.wpelg-frontend .button:hover {
    background: #135e96;
    border-color: #135e96;
}

.wpelg-frontend .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.wpelg-frontend .button-small {
    padding: 4px 10px;
    font-size: 12px;
}

.wpelg-frontend .button:not(.button-primary) {
    background: #f6f7f7;
    border-color: #c3c4c7;
    color: #2c3338;
}

/* Responsive */
@media (max-width: 782px) {
    .wpelg-form-row {
        flex-direction: column;
    }
    .wpelg-field {
        min-width: 100%;
    }
}

/* Result header bar */
.wpelg-result-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

#wpelg_link_list {
    width: 100%;
    min-height: 200px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 12px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    box-sizing: border-box;
}

.wpelg-frontend #wpelg_link_list {
    background: #fff;
}

/* ========== Tạo Anchor ========== */
.wpelg-anc-block {
    margin-bottom: 18px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.wpelg-anc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f0f0f1;
    border-bottom: 1px solid #dcdcde;
}

.wpelg-anc-head strong {
    font-size: 14px;
}

.wpelg-anc-block textarea {
    width: 100%;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 12px 14px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #fff;
    box-sizing: border-box;
    resize: vertical;
}

.wpelg-anc-copy.copied {
    background: #00a32a !important;
    color: #fff !important;
    border-color: #00a32a !important;
}

/* Kết quả Tạo Anchor: 2 khu (có dấu trên, không dấu dưới) */
.wpelg-anc-zone {
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 12px 16px 4px;
    margin-bottom: 20px;
    background: #fafafa;
}
.wpelg-anc-zone-dau { border-left: 4px solid #2271b1; }
.wpelg-anc-zone-kd  { border-left: 4px solid #996800; }
.wpelg-anc-zone-title {
    margin: 0 0 12px;
    font-size: 15px;
}
