/**
 * TamRank Content Tab Styles
 */
/* variables.css komt binnen via de tamrank-variables dependency (zie register_common_styles). */

/* ==========================================================================
   Content Tab Container
   ========================================================================== */

.tam-content-tab {
    padding: 20px;
    position: relative;
}

/* ==========================================================================
   Loading Indicator
   ========================================================================== */

.tam-content-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 100;
    border-radius: var(--tr-radius-md);
}

.tam-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tr-color-slate-200);
    border-top-color: var(--tr-color-info);
    border-radius: 50%;
    animation: tam-spin 0.8s linear infinite;
}

@keyframes tam-spin {
    to {
        transform: rotate(360deg);
    }
}

.tam-content-loading span {
    font-size: 13px;
    color: var(--tr-color-slate-600);
}

/* ==========================================================================
   Score Section
   ========================================================================== */

.tam-content-score-section {
    margin-bottom: 24px;
}

.tam-content-score-card {
    flex: 1;
    background: linear-gradient(135deg, var(--tr-color-base) 0%, var(--tr-color-white) 100%);
    border: 1px solid var(--tr-color-slate-200);
    border-radius: var(--tr-radius-lg);
    padding: 20px;
}

.tam-content-score-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tam-content-score-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--tr-color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--tr-color-slate-200);
    transition: border-color var(--tr-transition-base);
}

/* SVG Circle Score */
.tam-score-circle-container {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.tam-score-circle-svg {
    transform: rotate(-90deg);
    width: 100px;
    height: 100px;
}

.tam-score-circle-bg {
    fill: none;
    stroke: var(--tr-color-slate-200);
    stroke-width: 8;
}

.tam-score-circle-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.tam-score-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.tam-score-circle-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--tr-color-slate-800);
    display: block;
}

.tam-score-circle-max {
    font-size: 11px;
    color: var(--tr-color-slate-400);
    display: block;
    margin-top: 2px;
}

.tam-content-score-info {
    flex: 1;
}

.tam-content-score-label {
    font-size: 20px;
    font-weight: 600;
    color: var(--tr-color-slate-800);
    margin-bottom: 8px;
}

/* Legacy score badge styles (kept for backwards compatibility) */
.tam-content-score-badge {
    display: none;
}

.tam-content-score-badge.score-excellent {
    border-color: var(--tr-color-primary);
}

.tam-content-score-badge.score-good {
    border-color: var(--tr-color-info);
}

.tam-content-score-badge.score-needs-work {
    border-color: var(--tr-color-warning);
}

.tam-content-score-badge.score-poor {
    border-color: var(--tr-color-error);
}

.tam-content-score-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--tr-color-slate-800);
}

.tam-content-score-max {
    font-size: 12px;
    color: var(--tr-color-slate-400);
    margin-top: 2px;
}

/* Legacy Score Bar styles (no longer used) */
.tam-content-score-bar-wrapper {
    display: none;
}

.tam-content-score-bar {
    height: 8px;
    background: var(--tr-color-slate-200);
    border-radius: var(--tr-radius-sm);
    overflow: hidden;
}

.tam-content-score-bar-fill {
    height: 100%;
    border-radius: var(--tr-radius-sm);
    transition: width 0.5s ease, background-color 0.3s ease;
}

.tam-content-score-bar-fill.score-excellent {
    background: var(--tr-color-primary);
}

.tam-content-score-bar-fill.score-good {
    background: var(--tr-color-info);
}

.tam-content-score-bar-fill.score-needs-work {
    background: var(--tr-color-warning);
}

.tam-content-score-bar-fill.score-poor {
    background: var(--tr-color-error);
}

/* Score Summary */
.tam-content-score-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--tr-text-sm);
}

#content-status-issues {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tam-content-criticals,
.tam-content-improvements {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-medium);
    line-height: 1;
}

.tam-content-criticals {
    background: var(--tr-color-error-light);
    color: var(--tr-color-error);
}

.tam-content-criticals svg {
    color: var(--tr-color-error);
}

.tam-content-improvements {
    background: var(--tr-color-warning-light);
    color: var(--tr-color-warning-hover);
}

.tam-content-improvements svg {
    color: var(--tr-color-warning);
}

.tam-content-all-good {
    color: var(--tr-color-success);
    font-weight: var(--tr-font-medium);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tam-content-all-good svg {
    color: var(--tr-color-success);
}

/* Reanalyze Wrapper */
.tam-content-reanalyze-wrapper {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#content-reanalyze-btn svg {
    transition: transform var(--tr-transition-slow);
}

#content-reanalyze-btn:hover svg {
    transform: rotate(180deg);
}

.tam-content-reanalyze-hint {
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-400);
    white-space: nowrap;
}

/* ==========================================================================
   Top Issues Section
   ========================================================================== */

.tam-content-top-issues {
    margin-bottom: 24px;
}

.tam-content-issues-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tam-content-issues-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tam-content-issues-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tam-content-issues-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tam-content-issues-group-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.tam-content-issues-group-line {
    flex: 1;
    height: 1px;
    background: var(--tr-color-slate-200);
}

.tam-content-issues-group-header--critical .tam-content-issues-group-dot {
    background: var(--tr-color-status-improve);
}

.tam-content-issues-group-header--critical .tam-content-issues-group-label {
    color: var(--tr-color-status-improve);
}

.tam-content-issues-group-header--warning .tam-content-issues-group-dot {
    background: var(--tr-color-status-attention);
}

.tam-content-issues-group-header--warning .tam-content-issues-group-label {
    color: var(--tr-color-status-attention);
}

.tam-content-issue {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-md);
}

.tam-content-issue.tam-issue-critical {
    background: var(--tr-color-error-light);
}

.tam-content-issue.tam-issue-warning {
    background: var(--tr-color-warning-light);
}

.tam-content-issue-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.tam-content-issue-content {
    flex: 1;
}

.tam-content-issue-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tr-color-slate-700);
    margin-bottom: 4px;
}

.tam-content-issue-description {
    font-size: 12px;
    color: var(--tr-color-slate-500);
    line-height: 1.4;
}

.tam-content-no-issues {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--tr-color-success-light);
    border-radius: var(--tr-radius-md);
    color: var(--tr-color-primary);
    font-size: 13px;
}

.tam-content-no-issues svg {
    color: var(--tr-color-primary);
}

/* ==========================================================================
   Expandable Recommendation Items
   ========================================================================== */

.tam-content-recommendation {
    background: var(--tr-color-white);
    border: 1px solid var(--tr-color-slate-200);
    border-radius: var(--tr-radius-md);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.tam-content-recommendation:hover {
    border-color: var(--tr-color-slate-300);
}

.tam-content-recommendation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color var(--tr-transition-base);
}

.tam-content-recommendation-icon {
    flex-shrink: 0;
}

.tam-content-recommendation-content {
    flex: 1;
    min-width: 0;
}

.tam-content-recommendation-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tr-color-slate-700);
    margin-bottom: 2px;
}

.tam-content-recommendation-description {
    font-size: 12px;
    color: var(--tr-color-slate-500);
    line-height: 1.4;
}

.tam-content-recommendation-points {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--tr-color-success-light);
    color: var(--tr-color-primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--tr-radius-lg);
    white-space: nowrap;
}

.tam-content-recommendation-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--tr-color-slate-400);
}

.tam-content-recommendation.is-open .tam-content-recommendation-chevron {
    transform: rotate(90deg);
}

/* Expanded Tip Section */
.tam-content-recommendation-tip {
    display: none;
    padding: 0 16px 16px 16px;
}

.tam-content-recommendation.is-open .tam-content-recommendation-tip {
    display: block;
}

.tam-content-tip-box {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--tr-color-success-light) 0%, var(--tr-color-success-light) 100%);
    border-radius: var(--tr-radius-md);
    border: 1px solid var(--tr-color-success-light);
}

.tam-content-tip-icon {
    flex-shrink: 0;
    color: var(--tr-color-primary);
    margin-top: 2px;
}

.tam-content-tip-content {
    flex: 1;
}

.tam-content-tip-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tr-color-primary);
    margin-bottom: 6px;
}

.tam-content-tip-text {
    font-size: 13px;
    color: var(--tr-color-primary-hover);
    line-height: 1.6;
}

/* ==========================================================================
   Accordion Styles
   ========================================================================== */

.tam-content-accordion {
    background: var(--tr-color-white);
    border: 1px solid var(--tr-color-slate-200);
    border-radius: var(--tr-radius-md);
    margin-bottom: 12px;
    overflow: hidden;
}

.tam-content-accordion:last-child {
    margin-bottom: 0;
}

.tam-content-accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: var(--tr-color-white);
    border: none;
    cursor: pointer;
    transition: background-color var(--tr-transition-base);
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--tr-color-slate-800);
}

.tam-content-accordion-header:hover {
    background: var(--tr-color-base);
}

.tam-content-accordion-header > svg:first-child {
    flex-shrink: 0;
    color: var(--tr-color-slate-400);
}

.tam-content-accordion-header > span:first-of-type {
    flex: 1;
}

.tam-content-accordion-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--tr-color-slate-400);
    background: var(--tr-color-slate-200);
    padding: 3px 8px;
    border-radius: var(--tr-radius-md);
}

.tam-content-accordion-header > svg:last-child {
    flex-shrink: 0;
    color: var(--tr-color-slate-400);
    transition: transform 0.2s ease;
}

.tam-content-accordion.is-open .tam-content-accordion-header > svg:last-child {
    transform: rotate(180deg);
}

.tam-content-accordion-content {
    display: none;
    padding: 16px;
    border-top: 1px solid var(--tr-color-slate-200);
}

.tam-content-accordion.is-open .tam-content-accordion-content {
    display: block;
}

/* ==========================================================================
   Categories Section
   ========================================================================== */

.tam-content-category {
    margin-bottom: 16px;
    border: 1px solid var(--tr-color-slate-200);
    border-radius: var(--tr-radius-sm);
    overflow: hidden;
}

.tam-content-category:last-child {
    margin-bottom: 0;
}

.tam-content-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--tr-color-base);
    font-size: 13px;
    font-weight: 600;
    color: var(--tr-color-slate-700);
}

.tam-content-category-header svg {
    color: var(--tr-color-slate-400);
}

.tam-content-category-title {
    flex: 1;
}

.tam-content-category-score {
    font-size: 12px;
    font-weight: 500;
    color: var(--tr-color-slate-500);
    background: var(--tr-color-slate-200);
    padding: 2px 8px;
    border-radius: var(--tr-radius-md);
}

.tam-content-category-checks {
    padding: 8px;
}

/* ==========================================================================
   Check Items
   ========================================================================== */

.tam-content-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-sm);
    margin-bottom: 4px;
}

.tam-content-check:last-child {
    margin-bottom: 0;
}

.tam-content-check:hover {
    background: var(--tr-color-surface);
}

.tam-content-check-icon {
    flex-shrink: 0;
}

.tam-content-check.tam-check-success .tam-content-check-icon svg {
    color: var(--tr-color-status-excellent);
}

.tam-content-check.tam-check-warning .tam-content-check-icon svg {
    color: var(--tr-color-status-attention);
}

.tam-content-check.tam-check-error .tam-content-check-icon svg {
    color: var(--tr-color-status-improve);
}

.tam-content-check-text {
    flex: 1;
    font-size: 13px;
    color: var(--tr-color-slate-600);
}

.tam-content-check-status {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    border-radius: var(--tr-radius-sm);
}

.tam-content-check.tam-check-success .tam-content-check-status {
    color: var(--tr-color-status-excellent);
    background: var(--tr-color-success-bg);
}

.tam-content-check.tam-check-warning .tam-content-check-status {
    color: var(--tr-color-status-attention);
    background: var(--tr-color-warning-bg);
}

.tam-content-check.tam-check-error .tam-content-check-status {
    color: var(--tr-color-status-improve);
    background: var(--tr-color-error-bg);
}

/* ==========================================================================
   Detail Sections
   ========================================================================== */

.tam-content-detail-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tr-color-slate-200);
}

.tam-content-detail-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tam-content-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tr-color-slate-700);
    margin: 0 0 12px 0;
}

.tam-content-detail-title svg {
    color: var(--tr-color-slate-400);
}

/* Heading Tree */
.tam-content-heading-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tam-content-heading-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    font-size: 13px;
}

.tam-content-heading-item.has-issue {
    background: var(--tr-color-warning-light);
}

.tam-content-heading-tag {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--tr-color-slate-500);
    background: var(--tr-color-slate-100);
    padding: 2px 6px;
    border-radius: var(--tr-radius-sm);
    font-family: monospace;
}

.tam-content-heading-text {
    flex: 1;
    color: var(--tr-color-slate-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tam-content-heading-issue {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--tr-color-warning);
    font-style: italic;
}

.tam-content-no-headings {
    padding: 12px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    color: var(--tr-color-slate-400);
    font-size: 13px;
    text-align: center;
}

/* Intro Snippet */
.tam-content-intro-snippet {
    padding: 12px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    font-size: 13px;
    color: var(--tr-color-slate-600);
    line-height: 1.6;
}

/* Image List */
.tam-content-images-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tam-content-image-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    font-size: 12px;
}

.tam-content-image-item.has-alt {
    background: var(--tr-color-success-light);
}

.tam-content-image-item.no-alt {
    background: var(--tr-color-error-light);
}

.tam-content-image-icon {
    flex-shrink: 0;
}

.tam-content-image-src {
    flex: 1;
    color: var(--tr-color-slate-500);
    font-family: monospace;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tam-content-image-alt {
    flex-shrink: 0;
    max-width: 200px;
    color: var(--tr-color-slate-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tam-content-no-images {
    padding: 12px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    color: var(--tr-color-slate-400);
    font-size: 13px;
    text-align: center;
}

/* Links Section */
.tam-content-links-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tam-content-links-group h6 {
    font-size: 12px;
    font-weight: 600;
    color: var(--tr-color-slate-600);
    margin: 0 0 8px 0;
}

.tam-content-links-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tam-content-link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    font-size: 12px;
}

.tam-content-link-icon {
    flex-shrink: 0;
    color: var(--tr-color-slate-400);
}

.tam-content-link-url {
    color: var(--tr-color-slate-600);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tam-content-link-url:hover {
    color: var(--tr-color-primary);
    text-decoration: underline;
}

.tam-content-no-links {
    padding: 10px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    color: var(--tr-color-slate-400);
    font-size: 12px;
    text-align: center;
}

/* ==========================================================================
   Images List (JavaScript generated)
   ========================================================================== */

.tam-images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.tam-image-item {
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-md);
    border: 1px solid var(--tr-color-slate-200);
}

.tam-image-item.tam-image-no-alt {
    border-color: var(--tr-color-status-improve);
}

.tam-image-item.tam-image-filename-alt {
    border-color: var(--tr-color-status-attention);
}

.tam-image-preview {
    width: 100%;
    height: 80px;
    border-radius: var(--tr-radius-sm);
    overflow: hidden;
    background: var(--tr-color-slate-200);
    margin-bottom: 8px;
    position: relative;
}

.tam-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--tr-color-white);
}

.tam-image-format-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: var(--tr-radius-sm);
    text-transform: uppercase;
}

.tam-image-info {
    width: 100%;
}

.tam-image-alt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: var(--tr-color-slate-600);
    text-align: center;
}

.tam-image-alt svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    min-width: 14px;
}

.tam-image-alt span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Image extra info onder alt */
.tam-image-extra-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 10px;
    color: var(--tr-color-slate-500);
    text-align: center;
}

.tam-image-extra-info .tam-image-size {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 11px;
}

.tam-image-extra-info .tam-image-size.size-good {
    color: var(--tr-color-status-excellent);
}

.tam-image-extra-info .tam-image-size.size-info {
    color: var(--tr-color-slate-500);
}

.tam-image-extra-info .tam-image-size.size-warning {
    color: var(--tr-color-status-attention);
}

.tam-image-extra-info .tam-image-size.size-error {
    color: var(--tr-color-status-improve);
}

.tam-image-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

.tam-image-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    border-radius: var(--tr-radius-md);
    font-size: 9px;
    font-weight: 500;
    white-space: nowrap;
}

.tam-image-badge svg {
    width: 10px;
    height: 10px;
    min-width: 10px;
}

.tam-badge-success {
    background: var(--tr-color-success-bg);
    color: var(--tr-color-status-excellent);
}

.tam-badge-info {
    background: var(--tr-color-slate-100);
    color: var(--tr-color-slate-500);
}

.tam-badge-warning {
    background: var(--tr-color-warning-bg);
    color: var(--tr-color-status-attention);
}

.tam-badge-error {
    background: var(--tr-color-error-bg);
    color: var(--tr-color-status-improve);
}

.tam-content-empty {
    padding: 12px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    color: var(--tr-color-slate-400);
    font-size: 13px;
    text-align: center;
}

/* ==========================================================================
   Links List (JavaScript generated)
   ========================================================================== */

.tam-links-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tam-link-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-sm);
    font-size: 12px;
}

.tam-link-item svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    min-width: 14px;
}

.tam-link-item.tam-link-broken {
    background: var(--tr-color-white);
}

.tam-link-item.tam-link-spam {
    background: var(--tr-color-white);
}

.tam-link-anchor {
    flex-shrink: 0;
    font-weight: 500;
    color: var(--tr-color-slate-700);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 4px;
}

.tam-link-url {
    flex: 1;
    color: var(--tr-color-slate-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    padding-left: 4px;
    border-left: 1px solid var(--tr-color-slate-300);
}

.tam-link-status-badge {
    flex-shrink: 0;
    background: var(--tr-color-error);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--tr-radius-sm);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 782px) {
    .tam-content-score-main {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .tam-content-reanalyze-wrapper {
        margin-left: 0;
        align-items: stretch;
    }

    #content-reanalyze-btn {
        width: 100%;
        justify-content: center;
    }

    .tam-content-reanalyze-hint {
        text-align: center;
    }

    .tam-content-links-section {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .tam-content-reanalyze-wrapper,
    .tam-content-loading {
        display: none !important;
    }

    .tam-content-accordion-content {
        display: block !important;
    }
}

/* ==========================================================================
   AI Internal Linking Section
   ========================================================================== */

.tam-ai-links-desc {
    margin: 0 0 var(--tr-space-4) 0;
    color: var(--tr-color-slate-500);
    font-size: var(--tr-text-sm);
}

.tam-ai-links-actions {
    display: flex;
    align-items: center;
    gap: var(--tr-space-3);
    margin-bottom: var(--tr-space-4);
}

.tam-ai-links-status {
    color: var(--tr-color-slate-500);
    font-size: var(--tr-text-sm);
}

/* Discrete reanalyze link — shown when previous suggestions exist */
.tam-ai-links-reanalyze-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--tr-space-3);
    margin-bottom: var(--tr-space-3);
}

.tam-ai-links-reanalyze {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    color: var(--tr-color-slate-500);
    font-size: var(--tr-text-xs);
    text-decoration: none;
    border-radius: var(--tr-radius-sm);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.tam-ai-links-reanalyze:hover {
    color: var(--tr-color-slate-700);
    background: var(--tr-color-slate-100);
}

.tam-ai-links-reanalyze svg {
    width: 14px;
    height: 14px;
}

.tam-ai-links-reanalyze.is-disabled {
    pointer-events: none;
    opacity: 0.5;
}

.tam-ai-links-success {
    margin-bottom: var(--tr-space-3);
    padding: var(--tr-space-3);
    background: var(--tr-color-success-bg);
    border-radius: var(--tr-radius-md);
    color: var(--tr-color-primary);
    font-size: var(--tr-text-sm);
}

/* PRO Badge */
.tam-ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--tr-color-primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
    line-height: 1;
}

/* Cluster badges for AI Internal Links */
.tam-cluster-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--tr-radius-sm, 4px);
    line-height: 1.4;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tam-cluster-badge--same {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tr-color-primary);
}

.tam-cluster-badge--related {
    background: rgba(59, 130, 246, 0.1);
    color: var(--tr-color-info, #3b82f6);
}

/* ==========================================================================
   AI Link Suggestions — Graph + Accordion (new design)
   ========================================================================== */

/* --- Graph Area --- */
.tr-links-graph-area {
    position: relative;
    min-height: 280px;
    background: var(--tr-color-base);
    background-image: radial-gradient(circle, var(--tr-color-slate-200) 1px, transparent 1px);
    background-size: 20px 20px;
    overflow: hidden;
}

.tr-links-coverage-pill {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--tr-color-white);
    padding: 8px 14px;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 5;
}

.tr-links-coverage-pill .tr-links-cov-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--tr-color-slate-600);
}

.tr-links-coverage-pill .tr-links-cov-bar {
    width: 64px;
    height: 5px;
    background: var(--tr-color-slate-200);
    border-radius: 3px;
    overflow: hidden;
}

.tr-links-coverage-pill .tr-links-cov-bar-fill {
    height: 100%;
    background: var(--tr-color-primary);
    border-radius: 3px;
}

.tr-links-coverage-pill .tr-links-cov-pct {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--tr-color-primary);
}

.tr-links-legend-pill {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 12px;
    background: var(--tr-color-white);
    padding: 6px 14px;
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    z-index: 5;
}

.tr-links-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--tr-color-slate-600);
}

.tr-links-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tr-links-graph-node {
    cursor: pointer;
    transition: all 200ms ease;
}

.tr-links-graph-node:hover {
    filter: brightness(1.05);
}

/* --- No-TA Header (State B) --- */
.tr-links-no-ta-header {
    padding: 14px 20px;
    background: var(--tr-color-base);
    border-bottom: 1px solid var(--tr-color-slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tr-links-no-ta-summary {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tr-color-slate-700);
}

.tr-links-no-ta-summary strong {
    color: var(--tr-color-slate-900);
    font-weight: 800;
}

.tr-links-no-ta-upsell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    color: var(--tr-color-slate-500);
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
}

.tr-links-no-ta-upsell:hover {
    color: var(--tr-color-primary);
}

.tr-links-no-ta-upsell .tr-links-upsell-icon {
    color: var(--tr-color-primary);
    font-size: 0.75rem;
}

/* --- Accordion --- */
.tr-links-acc-list { }

.tr-links-acc-item {
    border-bottom: 1px solid var(--tr-color-slate-200);
}

.tr-links-acc-item:last-child {
    border-bottom: none;
}

.tr-links-acc-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 150ms ease;
}

.tr-links-acc-row:hover {
    background: rgba(16,185,129,0.02);
}

.tr-links-acc-row .tr-links-acc-number {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--tr-color-slate-300);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.tr-links-acc-row .tr-links-acc-content {
    flex: 1;
    min-width: 0;
}

.tr-links-acc-row .tr-links-acc-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--tr-color-slate-900);
    line-height: 1.3;
}

.tr-links-acc-row .tr-links-acc-reason {
    font-size: 0.6875rem;
    color: var(--tr-color-slate-600);
    margin-top: 2px;
    line-height: 1.4;
}

.tr-links-acc-row .tr-links-acc-chevron {
    width: 16px;
    height: 16px;
    color: var(--tr-color-slate-300);
    transition: all 200ms ease;
    flex-shrink: 0;
}

.tr-links-acc-row:hover .tr-links-acc-chevron {
    color: var(--tr-color-slate-600);
}

/* Active state */
.tr-links-acc-item.active {
    background: rgba(16,185,129,0.02);
}

.tr-links-acc-item.active .tr-links-acc-row {
    padding-bottom: 6px;
}

.tr-links-acc-item.active .tr-links-acc-number {
    color: var(--tr-color-primary);
}

.tr-links-acc-item.active .tr-links-acc-title {
    color: var(--tr-color-primary-hover);
}

.tr-links-acc-item.active .tr-links-acc-chevron {
    transform: rotate(90deg);
    color: var(--tr-color-primary);
}

/* Expanded detail */
.tr-links-acc-detail {
    padding: 0 20px 16px 50px;
    animation: trLinksAccOpen 200ms ease;
}

@keyframes trLinksAccOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.tr-links-acc-url {
    font-size: 0.6875rem;
    color: var(--tr-color-slate-500);
    margin-bottom: 10px;
}

.tr-links-acc-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tr-links-cluster-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.tr-links-cluster-same {
    background: rgba(16,185,129,0.1);
    color: var(--tr-color-primary-hover);
}

.tr-links-cluster-related {
    background: rgba(59,130,246,0.1);
    color: #2563eb;
}

.tr-links-cluster-other {
    background: var(--tr-color-surface);
    color: var(--tr-color-slate-600);
}

/* Type toggle */
.tr-links-type-row {
    display: inline-flex;
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-md);
    padding: 3px;
    gap: 2px;
    margin-bottom: 10px;
}

.tr-links-type-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--tr-color-slate-500);
    cursor: pointer;
    transition: all 200ms ease;
}

.tr-links-type-btn.active {
    background: var(--tr-color-white);
    color: var(--tr-color-slate-900);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Snippet */
.tr-links-snippet {
    background: var(--tr-color-base);
    border-radius: var(--tr-radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 0.8125rem;
    color: var(--tr-color-slate-800);
    line-height: 1.8;
}

.tr-links-snippet .link {
    color: var(--tr-color-primary);
    text-decoration: underline;
    text-decoration-color: rgba(16,185,129,0.4);
    text-underline-offset: 2px;
    font-weight: 600;
}

.tr-links-snippet .new-line {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(16,185,129,0.2);
    color: var(--tr-color-primary-hover);
}

.tr-links-snippet .old-line {
    text-decoration: line-through;
    color: var(--tr-color-slate-500);
    opacity: 0.5;
}

.tr-links-snippet .new-line .link {
    color: var(--tr-color-primary);
}

.tr-links-acc-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tr-links-btn-primary {
    padding: 6px 16px;
    background: var(--tr-color-primary);
    border: none;
    border-radius: var(--tr-radius-md);
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 200ms ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tr-links-btn-primary:hover {
    background: var(--tr-color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

.tr-links-btn-primary svg {
    width: 12px;
    height: 12px;
}

.tr-links-btn-ghost {
    padding: 5px 10px;
    background: transparent;
    border: none;
    border-radius: var(--tr-radius-md);
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--tr-color-slate-500);
    cursor: pointer;
    transition: all 200ms ease;
}

.tr-links-btn-ghost:hover {
    background: var(--tr-color-surface);
    color: var(--tr-color-slate-700);
}

/* Copied state for buttons */
.tr-links-btn-primary.copied,
.tr-links-btn-ghost.copied {
    opacity: 0.7;
    pointer-events: none;
}


/* === Ported from former inline 'critical fallback' (content-tab.php render); dedupe/tokenize post-launch === */
.tam-content-separator {
    color: #cbd5e1;
}

.tam-content-reanalyze-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

.tam-content-reanalyze-btn:hover {
    background: #f1f5f9;
    border-color: var(--tr-color-info);
    color: var(--tr-color-info);
}

.tam-content-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
}

.tam-rec-critical .tam-content-recommendation-points {
    background: #fef2f4;
    color: #f43f5e;
}

.tam-rec-warning .tam-content-recommendation-points {
    background: #fff8eb;
    color: #b8860b;
}

.tam-content-accordion-header>span:first-of-type {
    flex: 1;
}

.tam-accordion-chevron {
    transition: transform 0.2s ease;
}

.tam-content-accordion.is-open .tam-accordion-chevron {
    transform: rotate(180deg);
}

.tam-content-check.tam-check-success {
    background: #f0faf6;
}

.tam-content-check.tam-check-warning {
    background: #fff8eb;
}

.tam-content-check.tam-check-error {
    background: #fef2f4;
}

