/**
 * TamRank Admin Global Styles
 * Imports design tokens and defines base components.
 */

/* The common/ files that used to be @import-ed here are enqueued as versioned
   handles instead (TamRank::register_common_styles). An @import URL inherits no
   ?ver= from its parent, so a plugin update left the browser serving cached
   sub-CSS next to fresh PHP. The enqueue chain keeps the exact same load order:
   variables → buttons → tabs → notifications → redirect-prompt → tooltip →
   motion → this file. */

/* ========================================
   BASE
   ======================================== */

.toplevel_page_tam-rank-dashboard #wpcontent,
[class*="tam-rank_page_"] #wpcontent {
    background: var(--tr-color-base);
}

.toplevel_page_tam-rank-dashboard,
[class*="tam-rank_page_"] {
    font-family: var(--tr-font-family);
    color: var(--tr-color-slate-800);
}

/* ========================================
   PAGE WRAPPER
   Standaard layout: max-width 1400px, gecentreerd.
   Modifier --narrow: 1100px voor eenvoudigere pagina's.
   ======================================== */

.tr-page-wrap {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: var(--tr-space-8) var(--tr-space-6);
    box-sizing: border-box;
    font-family: var(--tr-font-family);
    color: var(--tr-color-slate-800);
}

.tr-page-wrap--narrow {
    max-width: 1100px;
}

/* Override WordPress .wrap h1 (load-styles.php: font-weight 400, font-size 23px) */
.wrap h1[class*="page-title"],
.wrap h1[class*="audit-title"],
.wrap h1[class*="schema-title"],
.tr-page-wrap h1 {
    font-size: var(--tr-text-xl);
    font-weight: var(--tr-font-bold);
    color: var(--tr-color-slate-900);
    letter-spacing: -0.02em;
    padding: 0;
    line-height: 1.3;
}

/* Cards */
.tr-card {
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-lg);
    padding: 0;
    box-shadow: var(--tr-shadow-sm);
    transition: box-shadow var(--tr-transition-base);
    box-sizing: border-box;
}

.tr-card:hover {
    box-shadow: var(--tr-shadow-md);
}

.tr-card-elevated {
    box-shadow: var(--tr-shadow-md);
}

/* Inputs */
.tr-input {
    font-family: var(--tr-font-family);
    font-size: var(--tr-text-sm);
    padding: var(--tr-space-3) var(--tr-space-4);
    border: 2px solid var(--tr-color-surface);
    border-radius: var(--tr-radius-md);
    background: var(--tr-color-white);
    color: var(--tr-color-slate-800);
    transition: all var(--tr-transition-base);
    width: 100%;
    box-sizing: border-box;
}

.tr-input:focus {
    outline: none;
    border-color: var(--tr-color-primary);
    box-shadow: 0 0 0 3px var(--tr-color-primary-light);
}

/* Tags */
.tr-tag {
    display: inline-flex;
    align-items: center;
    padding: var(--tr-space-1) var(--tr-space-3);
    font-size: var(--tr-text-xs);
    font-weight: var(--tr-font-medium);
    border-radius: var(--tr-radius-md);
    background: var(--tr-color-surface);
    color: var(--tr-color-slate-700);
}

.tr-tag-primary {
    background: var(--tr-color-primary-light);
    color: var(--tr-color-primary-hover);
}

.tr-tag-success {
    background: var(--tr-color-success-bg);
    color: #047857;
}

.tr-tag-warning {
    background: var(--tr-color-warning-bg);
    color: #b45309;
}

.tr-tag-error {
    background: var(--tr-color-error-bg);
    color: #be123c;
}

/* ========================================
   CHECKBOX — branded skin
   Stond sinds 1.3.7 als .tr-robots__check in
   tamrank-meta-boxes.css; die is niet geladen
   op de plugin-pagina's, en dit bestand wel op
   allebei. Eén component, twee gebruikers:
   .tr-check is de naam voor nieuw werk,
   .tr-robots__check blijft als alias staan
   omdat die markup uitgebracht is.

   WP-admin zet zelf `appearance: none` op
   admin-checkboxes, waardoor `accent-color`
   niets doet — het vakje wordt hier dus
   getekend in plaats van gekleurd.
   ======================================== */

.tr-check[type="checkbox"],
.tr-robots__check[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    position: relative;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    padding: 0;
    border: 1.5px solid var(--tr-color-slate-300, #cbd5e1);
    border-radius: 5px;
    background: var(--tr-color-white, #fff);
    box-shadow: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

/* Kill WP-admin's own blue checkmark glyph. */
.tr-check[type="checkbox"]::before,
.tr-robots__check[type="checkbox"]::before {
    content: none;
}

.tr-check[type="checkbox"]::after,
.tr-robots__check[type="checkbox"]::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid var(--tr-color-white, #fff);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 0.15s ease-out;
}

.tr-check[type="checkbox"]:hover,
.tr-robots__check[type="checkbox"]:hover {
    border-color: var(--tr-color-slate-400, #94a3b8);
}

.tr-check[type="checkbox"]:checked,
.tr-robots__check[type="checkbox"]:checked {
    background: var(--tr-color-primary, #10b981);
    border-color: var(--tr-color-primary, #10b981);
}

.tr-check[type="checkbox"]:checked::after,
.tr-robots__check[type="checkbox"]:checked::after {
    transform: rotate(45deg) scale(1);
}

/* Derde staat: een "alles selecteren" met een deel-selectie. Core tekent hier
   een blauw dashicon; dit hergebruikt ::before (hierboven leeggezet) voor het
   streepje, zodat het vinkje in ::after ongemoeid blijft. */
.tr-check[type="checkbox"]:indeterminate,
.tr-robots__check[type="checkbox"]:indeterminate {
    background: var(--tr-color-primary, #10b981);
    border-color: var(--tr-color-primary, #10b981);
}

.tr-check[type="checkbox"]:indeterminate::before,
.tr-robots__check[type="checkbox"]:indeterminate::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 9px;
    height: 2px;
    border-radius: 1px;
    background: var(--tr-color-white, #fff);
}

.tr-check[type="checkbox"]:focus-visible,
.tr-robots__check[type="checkbox"]:focus-visible {
    outline: 2px solid var(--tr-color-primary, #10b981);
    outline-offset: 2px;
}

/* ========================================
   PRO LOCKED PAGE
   Centered card shown when a PRO feature
   is accessed by a free user.
   ======================================== */

.tr-pro-locked {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: var(--tr-space-8);
}

.tr-pro-locked__card {
    text-align: center;
    max-width: 440px;
    width: 100%;
}

.tr-pro-locked__icon {
    width: 48px;
    height: 48px;
    background: var(--tr-color-primary);
    border-radius: var(--tr-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tr-color-white);
    margin: 0 auto var(--tr-space-6);
}

.tr-pro-locked__title {
    font-size: var(--tr-text-xl);
    font-weight: var(--tr-font-bold);
    color: var(--tr-color-slate-900);
    margin: 0 0 var(--tr-space-2) 0;
    letter-spacing: -0.02em;
}

.tr-pro-locked__badge {
    display: inline-block;
    font-size: 10px;
    font-weight: var(--tr-font-bold);
    color: var(--tr-color-primary);
    background: var(--tr-color-primary-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 3px 8px;
    border-radius: var(--tr-radius-sm);
    vertical-align: middle;
    margin-left: var(--tr-space-2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tr-pro-locked__desc {
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-500);
    line-height: var(--tr-leading-relaxed);
    margin: 0 0 var(--tr-space-8) 0;
}

.tr-pro-locked__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tr-space-3);
}

.tr-pro-locked__license {
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-400);
    text-decoration: none;
    transition: color var(--tr-transition-fast);
}

.tr-pro-locked__license:hover {
    color: var(--tr-color-slate-600);
    text-decoration: underline;
}

/* ========================================
   PRO BADGE — Admin Menu
   ======================================== */

.tamrank-menu-pro-badge {
    display: inline-block;
    background: var(--tr-color-primary);
    color: var(--tr-color-white);
    font-size: 9px;
    font-weight: var(--tr-font-bold);
    padding: 2px 5px;
    border-radius: var(--tr-radius-sm);
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    line-height: 1;
}

#adminmenu .wp-submenu .tamrank-menu-pro-badge {
    font-size: 8px;
    padding: 1px 4px;
}

/* Utilities */
.tr-space-y-4>*+* {
    margin-top: var(--tr-space-4);
}

.tr-space-x-4>*+* {
    margin-left: var(--tr-space-4);
}

.tr-text-slate-500 {
    color: var(--tr-color-slate-500);
}

.tr-text-slate-600 {
    color: var(--tr-color-slate-600);
}

/* ---------------------------------------------------------------------
 * Auto-redirect on delete — branded notice
 * Rules moved to common/redirect-prompt.css (imported at the top of this
 * file) so the same styles can be enqueued standalone on core admin screens
 * (Dashboard, Posts list) where this notice renders but the global stylesheet
 * is not loaded. Single source of truth: common/redirect-prompt.css.
 * --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
 * Posts-list "Links" column (internal link counter, F14)
 * A fixed narrow width keeps the header on one line and stops the column
 * from eating the Title column on list tables that already carry several
 * extra columns. Same approach as the PRO index-status column.
 * --------------------------------------------------------------------- */

.column-tam_rank_links {
    width: 90px;
}

.tr-link-counter {
    white-space: nowrap;
}
