/* CodeDE Table Viewer – Admin Styles */

.cdtv-wrap h1 { margin-bottom: 1em; }

/* Lite preview notice */
.cdtv-lite-preview-notice {
    background: #f0f6fc;
    border: 1px solid #c2d9f0;
    border-radius: 5px;
    padding: 9px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cdtv-lite-preview-notice .cdtv-notice-icon { font-size: 15px; }
.cdtv-lite-preview-notice a {
    color: #996600;
    font-weight: 600;
    margin-left: 4px;
}

/* Horizontal Scroll option picker */
.cdtv-scroll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 520px;
}
.cdtv-scroll-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
}
.cdtv-scroll-option:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}
.cdtv-scroll-option.active {
    border-color: #2271b1;
    background: #e8f2fb;
}
.cdtv-scroll-option input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
}
.cdtv-scroll-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    margin-top: 1px;
}
.cdtv-scroll-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cdtv-scroll-label strong {
    font-size: 13px;
    color: #1d2327;
}
.cdtv-scroll-label em {
    font-style: normal;
    font-size: 12px;
    color: #777;
}

/* Empty state */
.cdtv-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 20px;
}
.cdtv-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
    margin-bottom: 10px;
}

/* Table list */
.cdtv-table-list code { font-size: 12px; }

/* Upload area */
.cdtv-upload-area {
    border: 2px dashed #c3c4c7;
    border-radius: 6px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s;
    margin: 20px 0;
}
.cdtv-upload-area:hover,
.cdtv-upload-area.drag-over { border-color: #2271b1; background: #f0f6fc; }
.cdtv-upload-area .dashicons { font-size: 40px; width: 40px; height: 40px; color: #2271b1; margin-bottom: 10px; }
.cdtv-upload-area p { margin: 6px 0; color: #666; }
.cdtv-file-types { font-size: 12px; color: #999; }

/* Wizard steps */
.cdtv-wizard-steps {
    display: flex;
    gap: 0;
    margin: 20px 0 30px;
}
.cdtv-step {
    flex: 1;
    padding: 10px 16px;
    background: #f0f0f1;
    border: 1px solid #ddd;
    border-right: none;
    color: #666;
    font-size: 13px;
}
.cdtv-step:last-child { border-right: 1px solid #ddd; }
.cdtv-step.active { background: #2271b1; color: #fff; border-color: #2271b1; }
.cdtv-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid currentColor;
    font-size: 11px;
    font-weight: 700;
    margin-right: 6px;
}

/* Preview area */
.cdtv-preview-area {
    max-height: 400px;
    overflow: auto;
    border: 1px solid #ddd;
    padding: 10px;
    background: #fff;
    margin-bottom: 16px;
}

/* Success box */
.cdtv-success-box {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #00a32a;
    padding: 30px;
    text-align: center;
    margin-top: 20px;
}
.cdtv-success-box .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #00a32a;
    margin-bottom: 10px;
}
.cdtv-shortcode-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px 0;
}
.cdtv-shortcode-result code {
    background: #f0f0f1;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 4px;
}

/* Pro banner */
.cdtv-pro-banner {
    margin-top: 24px;
    padding: 12px 16px;
    background: #fff8e5;
    border: 1px solid #f0c000;
    border-radius: 4px;
    font-size: 13px;
}
.cdtv-pro-banner a { margin-left: 8px; font-weight: 600; }

/* Upgrade page */
.cdtv-upgrade-intro { font-size: 15px; color: #555; margin-bottom: 24px; }
.cdtv-compare-table { max-width: 700px; margin-bottom: 30px; }
.cdtv-yes { color: #00a32a; font-weight: 700; font-size: 16px; }
.cdtv-no  { color: #ccc; }
.cdtv-upgrade-cta { margin-top: 24px; }
.cdtv-upgrade-note { color: #666; font-size: 13px; margin-top: 8px; }
/* Feature comparison: section header rows */
.cdtv-compare-table tr.cdtv-feature-section td {
    background: #f0f6fc;
    color: #2271b1;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 10px 5px;
    border-top: 2px solid #c3d4e6;
}

/* -----------------------------------------------------------------------
 * Edit mode – Info bar (row count, columns, shortcode)
 * -------------------------------------------------------------------- */
.cdtv-info-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: 4px;
    padding: 10px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    flex-wrap: wrap;
}
.cdtv-info-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #2271b1;
}
.cdtv-info-stat .dashicons { font-size: 16px; width: 16px; height: 16px; }
.cdtv-info-stat strong { font-size: 15px; }
.cdtv-info-stat span:last-child { color: #555; }
.cdtv-info-shortcode {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: #555;
}
.cdtv-info-shortcode code {
    background: #fff;
    border: 1px solid #ddd;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

/* Replace file section */
.cdtv-replace-file-wrap { margin-bottom: 18px; }
.cdtv-toggle-replace.active { background: #f0f6fc; border-color: #2271b1; color: #2271b1; }
.cdtv-upload-area--small { padding: 20px; }
.cdtv-upload-area--small .dashicons { font-size: 28px; width: 28px; height: 28px; }

/* Step 2 action buttons */
.cdtv-step2-actions { margin-top: 16px; display: flex; gap: 8px; align-items: center; }

/* Preview note */
.cdtv-preview-note { color: #666; font-style: italic; font-size: 12px; margin-top: 6px; }

/* Loading spinner in preview */
.cdtv-loading-preview { color: #666; display: flex; align-items: center; gap: 8px; padding: 16px 0; }

/* -----------------------------------------------------------------------
 * Border editor
 * -------------------------------------------------------------------- */
.cdtv-border-editor { display: flex; flex-direction: column; gap: 12px; }

.cdtv-border-presets { display: flex; gap: 8px; flex-wrap: wrap; }

.cdtv-border-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: border-color .15s, background .15s;
    min-width: 80px;
}
.cdtv-border-preset:hover { border-color: #2271b1; color: #2271b1; }
.cdtv-border-preset.active { border-color: #2271b1; background: #f0f6fc; color: #2271b1; font-weight: 600; }

/* SVG-style border icons */
.cdtv-border-icon {
    display: block;
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.cdtv-border-icon--none {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect x='2' y='2' width='28' height='28' fill='none' stroke='%23ccc' stroke-width='1' stroke-dasharray='3,2'/%3E%3C/svg%3E");
}
.cdtv-border-icon--outer {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect x='2' y='2' width='28' height='28' fill='none' stroke='%232271b1' stroke-width='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='30' stroke='%23ccc' stroke-width='1' stroke-dasharray='2,2'/%3E%3Cline x1='2' y1='16' x2='30' y2='16' stroke='%23ccc' stroke-width='1' stroke-dasharray='2,2'/%3E%3C/svg%3E");
}
.cdtv-border-icon--all {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect x='2' y='2' width='28' height='28' fill='none' stroke='%232271b1' stroke-width='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='30' stroke='%232271b1' stroke-width='1.5'/%3E%3Cline x1='2' y1='16' x2='30' y2='16' stroke='%232271b1' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* Options row */
.cdtv-border-options {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 14px;
    flex-wrap: wrap;
}
.cdtv-border-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #3c434a;
}
.cdtv-border-options select { min-width: 90px; }
.cdtv-border-options input[type="color"] {
    width: 36px;
    height: 28px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

/* -----------------------------------------------------------------------
 * Design Generator – Pro notice banner
 * -------------------------------------------------------------------- */
.cdtv-pro-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff8e5;
    border: 1px solid #f0c000;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
}
.cdtv-pro-notice-icon { font-size: 20px; flex-shrink: 0; }
.cdtv-pro-notice-text { flex: 1; }
.cdtv-pro-notice-btn { flex-shrink: 0; white-space: nowrap; }

/* -----------------------------------------------------------------------
 * Design Generator – locked wrapper & overlay
 * -------------------------------------------------------------------- */
.cdtv-design-locked-wrap {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

/* Blurred preview behind the overlay */
.cdtv-design-preview-ui {
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
    opacity: 0.6;
}

/* Overlay sitting on top of the blurred UI */
.cdtv-design-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(2px);
    z-index: 10;
    border-radius: 6px;
}
.cdtv-design-overlay-inner {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 40px 48px;
    text-align: center;
    max-width: 480px;
    width: 90%;
}
.cdtv-lock-icon {
    display: block;
    font-size: 40px;
    margin-bottom: 12px;
}
.cdtv-design-overlay-inner h2 {
    font-size: 20px;
    margin: 0 0 10px;
    color: #1d2327;
}
.cdtv-design-overlay-inner p {
    color: #666;
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
}
.cdtv-overlay-link {
    margin-top: 14px !important;
    font-size: 13px !important;
}
.cdtv-overlay-link a { color: #2271b1; text-decoration: none; }
.cdtv-overlay-link a:hover { text-decoration: underline; }

/* -----------------------------------------------------------------------
 * Design Generator – two-column layout
 * -------------------------------------------------------------------- */
.cdtv-design-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 24px;
}
.cdtv-design-controls {
    flex: 0 0 260px;
    min-width: 200px;
}
.cdtv-design-controls h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
    margin: 0 0 10px;
}
.cdtv-design-controls select,
.cdtv-design-controls input[type="number"] {
    width: 100%;
    margin-bottom: 2px;
}
.cdtv-design-controls hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 14px 0;
}
.cdtv-design-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.cdtv-design-row label {
    flex: 1;
    font-size: 13px;
    color: #3c434a;
}
.cdtv-design-row input[type="color"] {
    width: 36px;
    height: 28px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: not-allowed;
}
.cdtv-design-row input[type="number"] {
    width: 70px !important;
    text-align: right;
}
.cdtv-design-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
}
.cdtv-design-row select {
    width: auto !important;
    min-width: 120px;
}
.cdtv-design-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Right column: live preview */
.cdtv-design-preview-col {
    flex: 1;
    min-width: 0;
}
.cdtv-design-preview-col h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
    margin: 0 0 12px;
}

/* Sample preview table inside design generator */
.cdtv-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cdtv-preview-table thead tr {
    background: #2271b1;
    color: #fff;
}
.cdtv-preview-table th,
.cdtv-preview-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}
.cdtv-preview-table tbody tr:nth-child(even) { background: #f7f9fc; }

/* -----------------------------------------------------------------------
   License / Upgrade page
   --------------------------------------------------------------------- */
.cdtv-upgrade-page h1 { margin-bottom: .5em; }
.cdtv-upgrade-intro { color: #555; margin-bottom: 1.5em; }

.cdtv-license-box {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    padding: 24px 28px;
    margin-bottom: 32px;
    max-width: 680px;
}
.cdtv-license-box--active {
    border-color: #00a32a;
    background: #f0fdf4;
}
.cdtv-license-title { margin: 0 0 16px; }

.cdtv-license-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}
.cdtv-license-badge--ok {
    background: #d1fae5;
    color: #065f46;
}
.cdtv-license-badge--none {
    background: #f3f4f6;
    color: #6b7280;
}

.cdtv-license-info { margin: 0 0 10px; color: #444; }
.cdtv-license-info--note { font-size: 12px; color: #888; margin-bottom: 14px; }
.cdtv-license-info a { color: #2271b1; }

.cdtv-license-masked {
    display: inline-block;
    margin-left: 8px;
    font-size: 13px;
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: .06em;
}

.cdtv-license-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 6px 0 14px;
}
.cdtv-license-input {
    max-width: 280px;
    font-family: monospace;
    letter-spacing: .05em;
}

.cdtv-btn-remove { color: #d63638 !important; border-color: #d63638 !important; }
.cdtv-btn-remove:hover { background: #fff0f0 !important; }

.cdtv-license-msg {
    display: inline-block;
    margin-left: 10px;
    font-size: 13px;
    font-weight: 500;
}

/* Compare table */
.cdtv-compare-table { max-width: 680px; margin-bottom: 32px; }
.cdtv-yes { color: #00a32a; font-weight: 600; }
.cdtv-no  { color: #aaa; }

/* CTA */
.cdtv-upgrade-cta { margin-top: 8px; }
.cdtv-upgrade-note {
    margin-top: 10px;
    color: #666;
    font-size: 13px;
}
.cdtv-preview-table tbody tr:hover { background: #eaf3fb; }

/* ── Pro badge + teaser ── */
.cdtv-pro-badge {
    display: inline-block;
    background: #f0b429;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 4px;
}

.cdtv-pro-teaser {
    background: #f0f6fc;
    border: 1px solid #c3d9f0;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
    color: #444;
    margin: 4px 0;
}

/* ── Design Generator Mode Bar ── */
.cdtv-dg-mode-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 10px 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cdtv-dg-mode-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.cdtv-dg-mode-bar select {
    margin-left: 4px;
    min-width: 200px;
}

/* ── Per-table feature toggles ── */
.cdtv-dg-table-options {
    background: #f0f6fc;
    border: 1px solid #c3d9f0;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.cdtv-dg-table-options h3 {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    color: #1d2327;
    letter-spacing: 0.04em;
}

/* ── Column filter picker ── */
.cdtv-filter-col-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.cdtv-filter-col-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.cdtv-filter-col-item:has(input:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #2271b1;
}
