/* IntentiveSEO Internal Link Finder - Tool Styles
   Prefix: .ilf-  (no conflicts with Elementor, Divi, etc.)
   Version: 1.0.0 */

/* ── Reset inside container ───────────────────────────────────────────── */
.ilf-container *,
.ilf-container *::before,
.ilf-container *::after {
    box-sizing: border-box;
}
.ilf-container {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.ilf-header {
    margin-bottom: 28px;
}
.ilf-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111;
}
.ilf-subtitle {
    font-size: 14px;
    color: #555;
    margin: 0;
    max-width: none;
}

/* ── Step nav ─────────────────────────────────────────────────────────── */
.ilf-steps-nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 14px 20px;
    background: #f8f8f8;
    border-radius: 10px;
    border: 1px solid #ececec;
}
.ilf-step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity .2s;
}
.ilf-step-item.ilf-step-active { opacity: 1; }
.ilf-step-item.ilf-step-done   { opacity: 0.7; }
.ilf-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.ilf-step-item.ilf-step-active .ilf-step-num { background: #2563eb; }
.ilf-step-item.ilf-step-done   .ilf-step-num { background: #16a34a; }
.ilf-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}
.ilf-step-sep {
    flex: 1;
    height: 1px;
    background: #ddd;
    margin: 0 12px;
    min-width: 16px;
}

/* ── Panels ───────────────────────────────────────────────────────────── */
.ilf-panel {
    width: 100%;
    overflow-x: hidden;
    animation: ilf-fade-in .2s ease;
}
.ilf-hidden { display: none !important; }
@keyframes ilf-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Form elements ────────────────────────────────────────────────────── */
.ilf-form-group {
    margin-bottom: 20px;
}
.ilf-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
}
.ilf-label-hint {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #777;
    margin-top: 1px;
}
.ilf-input,
.ilf-textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #111;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    line-height: 1.5;
}
.ilf-input:focus,
.ilf-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.ilf-input::placeholder,
.ilf-textarea::placeholder { color: #aaa; }
.ilf-textarea { resize: vertical; min-height: 160px; }
.ilf-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.ilf-input-row .ilf-input { flex: 1; }
.ilf-field-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 5px;
    min-height: 16px;
}

/* ── Mode selection cards ─────────────────────────────────────────────── */
.ilf-mode-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 12px;
}
@media (max-width: 540px) {
    .ilf-mode-grid { grid-template-columns: 1fr; }
}
.ilf-mode-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #fff;
    position: relative;
}
.ilf-mode-card:hover { border-color: #93c5fd; background: #f0f7ff; }
.ilf-mode-card.ilf-mode-selected {
    border-color: #2563eb;
    background: #eff6ff;
}
.ilf-mode-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e5e7eb;
    font-size: 14px;
    font-weight: 700;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ilf-mode-selected .ilf-mode-icon { background: #2563eb; color: #fff; }
.ilf-mode-body {
    flex: 1;
}
.ilf-mode-body strong {
    display: block;
    font-size: 14px;
    color: #111;
    margin-bottom: 3px;
}
.ilf-mode-body span {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.ilf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, opacity .15s;
    text-decoration: none;
    white-space: nowrap;
}
.ilf-btn:disabled { opacity: .45; cursor: not-allowed; }
.ilf-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.ilf-btn-primary:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; }
.ilf-btn-ghost {
    background: transparent;
    color: #555;
    border-color: #d1d5db;
}
.ilf-btn-ghost:hover:not(:disabled) { background: #f3f4f6; }
.ilf-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.ilf-btn-block { width: 100%; }
.ilf-mt-sm { margin-top: 10px; }

/* ── Tips ─────────────────────────────────────────────────────────────── */
.ilf-tip {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
    border-left: 4px solid transparent;
}
.ilf-tip strong { display: block; margin-bottom: 3px; }
.ilf-tip-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}
.ilf-tip-info {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1e40af;
}
.ilf-tip-neutral {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* ── URL list ─────────────────────────────────────────────────────────── */
.ilf-url-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.ilf-url-list-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#ilf-url-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
}
.ilf-url-row {
    display: grid;
    grid-template-columns: 20px 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
    cursor: pointer;
}
.ilf-url-row:last-child { border-bottom: none; }
.ilf-url-row:hover { background: #f8fafc; }
.ilf-url-row.ilf-url-selected { background: #eff6ff; }
.ilf-url-check {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}
.ilf-url-info {}
.ilf-url-title {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.ilf-url-slug {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.ilf-url-lastmod { font-size: 11px; color: #aaa; white-space: nowrap; }
.ilf-selection-summary {
    margin: 10px 0;
    font-size: 13px;
    color: #555;
    display: flex;
    gap: 12px;
    align-items: center;
}
.ilf-selection-max { color: #888; }

/* ── Badges ───────────────────────────────────────────────────────────── */
.ilf-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ilf-badge-top      { background: #d1fae5; color: #065f46; }
.ilf-badge-suggested{ background: #dbeafe; color: #1e40af; }
.ilf-badge-low      { background: #f3f4f6; color: #6b7280; }
.ilf-badge-info     { background: #dbeafe; color: #1e40af; }
.ilf-badge-valid    { background: #d1fae5; color: #065f46; }
.ilf-badge-invalid  { background: #fee2e2; color: #991b1b; }
.ilf-badge-self     { background: #fef3c7; color: #92400e; }
.ilf-badge-high     { background: #d1fae5; color: #065f46; }
.ilf-badge-medium   { background: #dbeafe; color: #1e40af; }
.ilf-badge-low      { background: #f3f4f6; color: #6b7280; }
.ilf-badge-already  { background: #fef3c7; color: #92400e; }
.ilf-badge-error    { background: #fee2e2; color: #991b1b; }

/* ── Validated URL list ───────────────────────────────────────────────── */
#ilf-validated-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 14px;
}
.ilf-validated-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.ilf-validated-row:last-child { border-bottom: none; }
.ilf-validated-url {
    font-size: 12px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ilf-validated-row.ilf-row-invalid { opacity: .6; }

/* ── Progress ─────────────────────────────────────────────────────────── */
.ilf-progress-wrap { padding: 20px 0; }
.ilf-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.ilf-progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 4px;
    width: 0%;
    transition: width .4s ease;
}
.ilf-progress-text {
    font-size: 13px;
    color: #555;
    margin: 0;
}

/* ── Results ──────────────────────────────────────────────────────────── */
.ilf-results-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.ilf-results-heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #111;
}
.ilf-results-sub {
    font-size: 13px;
    color: #666;
    margin: 0;
}
.ilf-stats-bar {
    width: 100%;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.ilf-stat {
    background: #f8f8f8;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    text-align: center;
    min-width: 0;
    flex: 1 1 80px;
}
.ilf-stat-num {
    font-size: 22px;
    font-weight: 700;
    display: block;
    line-height: 1;
    margin-bottom: 3px;
}
.ilf-stat-label {
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ilf-result-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    transition: box-shadow .15s;
}
.ilf-result-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.ilf-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
}
.ilf-result-title {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin: 0 0 3px;
}
.ilf-result-url {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    word-break: break-all;
}
.ilf-result-url:hover { text-decoration: underline; }
.ilf-result-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.ilf-result-body { padding: 14px 18px; }
.ilf-result-section { margin-bottom: 14px; }
.ilf-result-section:last-child { margin-bottom: 0; }
.ilf-result-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}
.ilf-sentence {
    background: #f8fafc;
    border-left: 3px solid #2563eb;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.7;
    font-style: italic;
}
mark.ilf-highlight {
    background: #fef9c3;
    color: #713f12;
    border-radius: 2px;
    padding: 0 2px;
    font-style: normal;
}
.ilf-anchors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ilf-anchor-chip {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s;
    user-select: all;
}
.ilf-anchor-chip:hover { background: #dbeafe; }
.ilf-anchor-chip-hint {
    font-size: 11px;
    color: #888;
    align-self: center;
}
.ilf-result-footer {
    padding: 10px 18px;
    background: #fafafa;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.ilf-result-score { font-size: 12px; color: #888; }
.ilf-open-link {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}
.ilf-open-link:hover { text-decoration: underline; }

/* ── Grouped anchor suggestions ───────────────────────────────────────── */
.ilf-anchor-groups      { display:flex; flex-direction:column; gap:14px; }
.ilf-anchor-group       { background:var(--ilf-group-bg,#fafafa); border:1px solid var(--ilf-group-border,#e5e7eb); border-radius:8px; padding:12px 14px; }
.ilf-anchor-group-label { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; margin-bottom:3px; }
.ilf-anchor-group-hint  { font-size:11px; color:#888; margin-bottom:8px; }
.ilf-agl-dot            { display:inline-block; width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.ilf-agl-exact          { color:#065f46; }
.ilf-agl-exact .ilf-agl-dot  { background:#16a34a; }
.ilf-agl-phrase         { color:#1e40af; }
.ilf-agl-phrase .ilf-agl-dot { background:#2563eb; }
.ilf-agl-broad          { color:#854d0e; }
.ilf-agl-broad .ilf-agl-dot  { background:#ca8a04; }
.ilf-chip-exact  { background:#d1fae5; border-color:#6ee7b7; color:#065f46; }
.ilf-chip-exact:hover  { background:#a7f3d0; }
.ilf-chip-phrase { background:#dbeafe; border-color:#93c5fd; color:#1e40af; }
.ilf-chip-phrase:hover { background:#bfdbfe; }
.ilf-chip-broad  { background:#fef9c3; border-color:#fde047; color:#854d0e; }
.ilf-chip-broad:hover  { background:#fef08a; }
.ilf-chip-wc     { font-size:10px; opacity:.55; font-style:normal; margin-left:4px; }

/* ── Section labels ───────────────────────────────────────────────────── */
.ilf-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
    margin: 20px 0 8px;
}

/* ── Already-linked & error items ────────────────────────────────────── */
.ilf-minor-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #555;
    flex-wrap: wrap;
}
.ilf-minor-row a { color: #2563eb; word-break: break-all; }

/* ── No results ───────────────────────────────────────────────────────── */
.ilf-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}
.ilf-no-results h3 { font-size: 16px; color: #333; margin: 0 0 8px; }
.ilf-no-results p  { font-size: 14px; margin: 0; }

/* ── Loading overlay ──────────────────────────────────────────────────── */
.ilf-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.82);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: 12px;
    z-index: 10;
    font-size: 14px;
    color: #555;
}
.ilf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ilf-spin .7s linear infinite;
}
@keyframes ilf-spin { to { transform: rotate(360deg); } }

/* ── Footer ───────────────────────────────────────────────────────────── */
.ilf-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #aaa;
    text-align: right;
}
.ilf-footer a { color: #aaa; text-decoration: none; }
.ilf-footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ilf-input-row   { flex-direction: column; }
    .ilf-url-row     { grid-template-columns: 20px 1fr auto; }
    .ilf-url-lastmod { display: none; }
    .ilf-result-header { flex-direction: column; }
    .ilf-stats-bar   { gap: 6px; }
    .ilf-stat        { min-width: 70px; padding: 8px 10px; }
    .ilf-stat-num    { font-size: 18px; }
}
