/**
 * Tag Display - Admin CSS
 * Modern redesign for WordPress admin panel
 */

/* =============================================
   PAGE WRAPPER
   ============================================= */

.tag-display-settings-page {
    max-width: 1100px;
    margin: 0;
}

.tag-display-settings-page h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 16px;
    padding: 9px 0 4px;
    line-height: 1.3;
    color: #1d2327;
}

/* Intro notice */
.s7n-intro-notice {
    background: #fff;
    border-left: 4px solid #2271b1;
    border-radius: 0 4px 4px 0;
    padding: 10px 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    color: #3c434a;
    font-size: 13px;
}

/* =============================================
   TAB NAVIGATION
   ============================================= */

.tag-display-tabs {
    margin: 0;
    padding: 0;
    border-bottom: 2px solid #dcdcde;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.tag-display-tabs a.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #50575e;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 4px 4px 0 0;
    background: transparent;
    transition: color .15s, border-color .15s, background .15s;
    margin-left: 0;
    margin-right: 0;
}

.tag-display-tabs a.nav-tab:hover {
    color: #2271b1;
    border-bottom-color: #c3c4c7;
    background: #f6f7f7;
}

.tag-display-tabs a.nav-tab-active {
    color: #2271b1 !important;
    background: #fff !important;
    border-color: #dcdcde !important;
    border-bottom-color: #fff !important;
    font-weight: 600;
}

/* =============================================
   UNSAVED CHANGES NOTICE
   ============================================= */

.s7n-unsaved-notice {
    display: none;
    position: sticky;
    top: 32px;
    z-index: 100;
    background: #fff8e5;
    border: 1px solid #f0b849;
    border-left: 4px solid #dba617;
    padding: 10px 16px;
    margin: 12px 0;
    border-radius: 0 4px 4px 0;
    align-items: center;
    gap: 8px;
}

.s7n-unsaved-notice.visible {
    display: flex;
}

.s7n-unsaved-notice p {
    margin: 0;
    font-weight: 600;
    color: #7a5c00;
}

/* =============================================
   TAB PANES
   ============================================= */

.tag-display-tab-content {
    margin-top: 0;
}

.tab-pane {
    display: none;
    padding: 20px 0 0;
}

.tab-pane.active {
    display: block;
}

#click-tracking-stats {
    display: none;
}

#click-tracking-stats.s7n-stats-visible {
    display: block;
}

/* =============================================
   SECTION CARDS
   ============================================= */

.s7n-section {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.s7n-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f1;
}

/* =============================================
   FORM TABLE (Settings API) - Modern override
   ============================================= */

.tag-display-settings-page .form-table {
    margin: 0;
    width: 100%;
}

.tag-display-settings-page .form-table th {
    width: 200px;
    padding: 14px 20px 14px 0;
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
    vertical-align: top;
}

.tag-display-settings-page .form-table td {
    padding: 12px 10px 12px 0;
    vertical-align: top;
}

.tag-display-settings-page .form-table tr {
    border-bottom: 1px solid #f6f7f7;
}

.tag-display-settings-page .form-table tr:last-child {
    border-bottom: none;
}

.tag-display-settings-page .form-table tr:last-child th,
.tag-display-settings-page .form-table tr:last-child td {
    padding-bottom: 0;
}

.tag-display-settings-page .description {
    color: #646970;
    font-style: normal;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.5;
}

.tag-display-settings-page .form-table fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.tag-display-settings-page .form-table fieldset label {
    display: block;
    margin-bottom: 6px;
    cursor: pointer;
    color: #1d2327;
    font-size: 13px;
}

/* Content-type template selects */
.tag-display-template-select {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-display-template-select label {
    display: inline-block;
    width: 200px;
    font-size: 13px;
    color: #1d2327;
    margin: 0;
}

.tag-display-template-select select {
    min-width: 160px;
}

/* =============================================
   SHORTCODE INFO BOX
   ============================================= */

.s7n-shortcode-box {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.s7n-shortcode-box h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.s7n-shortcode-box p {
    margin: 5px 0;
    color: #3c434a;
    font-size: 13px;
}

.s7n-shortcode-box code {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 12px;
    color: #c7254e;
    font-family: 'Courier New', Courier, monospace;
    white-space: nowrap;
}

/* Old shortcode-info class - keep for compatibility */
.shortcode-info {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 16px 20px;
    margin: 20px 0 0;
}

.shortcode-info h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.shortcode-info p { margin: 5px 0; font-size: 13px; color: #3c434a; }

.shortcode-info code {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 12px;
    color: #c7254e;
    font-family: 'Courier New', Courier, monospace;
}

/* =============================================
   COLOR PICKER
   ============================================= */

.tag-display-color-settings {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tag-color-field {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tag-color-field label {
    display: inline-block;
    width: 180px;
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Preview box */
.tag-display-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    padding: 12px 16px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.tag-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: #646970;
    white-space: nowrap;
}

.tag-preview {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    transition: all .2s ease;
    border: 1px solid;
    font-size: 13px;
}

#s7n-reset-colors {
    margin-top: 4px;
    font-size: 12px;
}

/* =============================================
   TEMPLATE PREVIEW CARDS
   ============================================= */

.template-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.template-preview {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    transition: box-shadow .2s, border-color .2s;
    cursor: pointer;
}

.template-preview:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    border-color: #c3c4c7;
}

/* Card header */
.template-preview-header {
    padding: 11px 16px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}

.template-preview-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    padding: 0;
    border: none;
}

.template-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f0f1;
    color: #646970;
    white-space: nowrap;
}

/* Card body */
.template-preview-body {
    padding: 14px 16px 16px;
}

.template-preview-desc {
    font-size: 12px;
    color: #646970;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* Active card */
.template-preview.s7n-active-preview {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,.2);
}

.template-preview.s7n-active-preview .template-preview-header {
    background: #f0f6fc;
    border-bottom-color: #c2d7f0;
}

.template-preview.s7n-active-preview .template-badge {
    background: #2271b1;
    color: #fff;
}

/* Preview container inside card */
.preview-container {
    background: #fff;
    border: 1px solid #f0f0f1;
    border-radius: 4px;
    padding: 10px 12px;
    min-height: 64px;
}

.preview-title {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 8px;
    color: #1d2327;
}

/* ---- Template tag element styles ---- */

.preview-default {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-button {
    display: inline-block;
    padding: 4px 10px;
    background-color: #f1f1f1;
    color: #333333;
    border-radius: 3px;
    text-decoration: none;
    transition: all .2s ease;
    border: 1px solid #e0e0e0;
    font-size: 12px;
    cursor: pointer;
}

.preview-minimal {
    line-height: 1.8;
}

.tag-link {
    text-decoration: none;
    color: #0073aa;
    transition: color .2s ease;
    font-size: 13px;
    cursor: pointer;
}

.tag-link:hover {
    text-decoration: underline;
}

.preview-minimal .tag-separator {
    display: inline-block;
    margin: 0 2px 0 0;
    color: #8c8f94;
}

.preview-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tag-cloud {
    display: inline-block;
    padding: 4px 10px;
    background-color: #f1f1f1;
    color: #333333;
    border-radius: 20px;
    text-decoration: none;
    transition: all .2s ease;
    cursor: pointer;
}

.preview-outlined {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-outlined {
    display: inline-block;
    background-color: transparent;
    color: #0073aa;
    border: 2px solid #0073aa;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
    cursor: pointer;
}

.tag-outlined:hover {
    background-color: #0073aa;
    color: #fff;
}

.preview-hashtag {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.tag-hashtag {
    display: inline-block;
    color: #0073aa;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s ease;
    cursor: pointer;
}

.tag-hashtag:hover {
    text-decoration: underline;
}

.tag-hashtag .tag-hash {
    color: inherit;
    user-select: none;
}

/* =============================================
   HELP TAB
   ============================================= */

.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 820px) {
    .help-grid { grid-template-columns: 1fr; }
}

.help-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.help-card-full {
    grid-column: 1 / -1;
}

.help-card h3 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f1;
}

.help-card h4 {
    margin: 12px 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.help-card p {
    margin: 0 0 8px;
    color: #3c434a;
    font-size: 13px;
    line-height: 1.5;
}

.help-card ul,
.help-card ol {
    margin: 6px 0 10px 16px;
    padding: 0;
}

.help-card li {
    margin-bottom: 5px;
    color: #3c434a;
    font-size: 13px;
    line-height: 1.5;
}

.help-card code {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 12px;
    color: #c7254e;
    font-family: 'Courier New', Courier, monospace;
}

.shortcode-attrs {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 14px;
    margin: 8px 0;
    font-size: 12px;
}

.shortcode-attrs dt {
    font-weight: 600;
    color: #1d2327;
}

.shortcode-attrs dd {
    margin: 0;
    color: #3c434a;
}

/* =============================================
   MISC
   ============================================= */

.tag-display-preview-message {
    margin-top: 15px !important;
}

/* =============================================
   CLICK TRACKING STATISTICS TABLE (T24)
   ============================================= */

.s7n-stats-table {
    margin-top: 8px;
}

.s7n-stats-table .column-rank {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: #787c82;
}

.s7n-stats-table .column-tag {
    width: 50%;
}

.s7n-stats-table .column-clicks {
    position: relative;
}

.s7n-stats-badge {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 10px;
    min-width: 28px;
    text-align: center;
    margin-right: 8px;
    vertical-align: middle;
}

.s7n-stats-bar {
    display: inline-block;
    height: 8px;
    background: #c3d9ef;
    border-radius: 4px;
    vertical-align: middle;
    max-width: 120px;
    transition: width 0.3s ease;
}

@media (max-width: 782px) {
    .s7n-stats-bar {
        display: none;
    }
}

/* =============================================
   SEO AUDIT TABLE (T28)
   ============================================= */

.s7n-audit-summary {
    font-weight: 600;
    margin-bottom: 12px;
}

.s7n-audit-empty {
    color: #46b450;
    font-weight: 600;
}

.s7n-audit-table .column-title    { width: 35%; }
.s7n-audit-table .column-type     { width: 12%; }
.s7n-audit-table .column-tags,
.s7n-audit-table .column-words    { width: 9%; text-align: center; }
.s7n-audit-table .column-density  { width: 12%; text-align: center; }
.s7n-audit-table .column-severity { width: 13%; text-align: center; }

.s7n-audit-table .density-low  { color: #b32d2e; font-weight: 600; }
.s7n-audit-table .density-ok   { color: #46b450; }

.s7n-severity-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.s7n-severity-critical { background: #b32d2e; color: #fff; }
.s7n-severity-warning  { background: #dba617; color: #fff; }
.s7n-severity-low      { background: #f0ad00; color: #fff; }

@media (max-width: 782px) {
    .s7n-audit-table .column-words,
    .s7n-audit-table .column-density,
    .s7n-audit-table .column-type { display: none; }
}
