/* ---------- ROOT COLORS ---------- */
:root {
    --amfa-primary: #6366f1;
    --amfa-accent: #06b6d4;
    --amfa-bg: #f8fafc;
    --amfa-text: #111827;
    --amfa-muted: #6b7280;
}

#amfa-notices-anchor {
    display: none;
    height: 1px;
    clear: both;
    overflow: hidden;
}

.toplevel_page_amfa-auditor .notice,
.toplevel_page_amfa-auditor .updated,
.toplevel_page_amfa-auditor .error {
    margin: 20px 20px 0 0 !important;
}

/* ---------- PAGE ---------- */
.amfa-wrapper {
    position: relative;
    padding-top: 10px;
    max-width: 1400px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--amfa-text);
    overflow: hidden;
    display: block;
    clear: both;
}

/* ---------- TITLE ---------- */
.amfa-wrapper h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(90deg, var(--amfa-primary), var(--amfa-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- SUBTITLE ---------- */
.amfa-subtitle {
    color: var(--amfa-muted);
    font-size: 14px;
    margin-top: 6px;
}

/* ---------- CARD ---------- */
.amfa-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 35px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.05),
        0 5px 10px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    transition: all .25s ease;
    animation: amfaFade .35s ease;
}

.amfa-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.07),
        0 10px 20px rgba(0, 0, 0, 0.05);
}

.amfa-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* ---------- TABLE ---------- */
.amfa-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.amfa-table thead {
    background: linear-gradient(90deg, #f1f5f9, #f8fafc);
    border-bottom: 1px solid #e5e7eb;
}

.amfa-table th {
    padding: 14px 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 600;
}

.amfa-table td {
    padding: 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: top;
    line-height: 1.6;
}

.amfa-table tbody tr {
    transition: all .18s ease;
}

.amfa-table tbody tr:hover {
    background: #f9fafb;
    transform: scale(1.003);
}

.amfa-table tbody tr:nth-child(even) {
    background: #fcfcfd;
}

.amfa-table code {
    background: #f1f5f9;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #334155;
}

.amfa-table strong {
    background: linear-gradient(90deg, #eef2ff, #e0f2fe);
    color: #3730a3;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* ---------- LOCATION ---------- */
.amfa-location-row {
    line-height: 1.6;
    margin-bottom: 4px;
}

.amfa-arrow {
    color: #bbb;
    font-weight: bold;
    margin-right: 5px;
    font-family: monospace;
}

.amfa-usage-text {
    color: #666;
    font-size: 13px;
}

.amfa-location-row a {
    color: #666;
}

.amfa-location-row.amfa-usage {
    color: #999;
    padding-left: 20px;
}

.amfa-location-row.amfa-source small,
.amfa-location-row.no-type {
    color: #777;
}

/* ---------- UNUSED ---------- */
.amfa-card.unused {
    margin-top: 40px;
}

.no-form {
    text-align: center;
    padding: 20px !important;
    font-weight: bold;
    color: #2ecc71 !important;
}

/* ---------- SUPPORTED ---------- */
.amfa-card.support {
    margin-top: 30px;
    margin-right: 15px;
}

.amfa-supported {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.amfa-supported li {
    list-style: none;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-weight: 500;
    transition: all .2s ease;
}

.amfa-supported li:hover {
    background: #eef2ff;
    border-color: #6366f1;
}

/* ---------- HEADER ---------- */
.amfa-header-wrap {
    position: relative;
    margin-bottom: 60px;
    z-index: 99;
}

.amfa-header {
    background: linear-gradient(135deg, #ffffff, #f4f8ff);
    padding: 26px 30px 0;
    border-radius: 16px;
    margin: 20px 0px 60px 0;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    overflow: visible;
}

/* Layout */
.amfa-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 30px;
}

/* ---------- BUTTON ---------- */
.amfa-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2271b1, #4dabf7);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.amfa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(34, 113, 177, 0.35);
}

.amfa-btn:active {
    transform: scale(0.96);
}

.amfa-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: rgba(255, 255, 255, 0.35);
    transform: skewX(-20deg);
}

.amfa-btn:hover::after {
    left: 120%;
    transition: 0.7s;
}

.amfa-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.amfa-btn.loading .amfa-btn-icon {
    animation: spin 1s linear infinite;
}

/* ---------- PROGRESS ---------- */

.amfa-progress-wrap {
    position: relative;
    width: 100%;
}

/* LINE */
.amfa-progress-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 10px;
}

/* FILL */
.amfa-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2271b1, #4dabf7);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* PIN */
.amfa-progress-pin {
    position: absolute;
    bottom: -34px;
    left: 0;
    transform: translateX(-50%);
    transition: left 0.4s ease;
    text-align: center;
    z-index: 4;
}

/* PIN UI */
.amfa-pin-icon {
    display: block;
    font-size: 14px;
}

.amfa-pin-text {
    margin-top: -11px;
    font-size: 11px;
    background: linear-gradient(135deg, #2271b1, #4dabf7);
    color: #fff;
    padding: 3px 7px;
    border-radius: 6px;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(34, 113, 177, 0.3);
}

.hidden-location {
    margin-left: 20px;
    opacity: 0.8;
}

.amfa-hidden-source {
    display: none !important;
}

.amfa-more-toggle {
    cursor: pointer;
    color: #0073aa;
    margin-top: 6px;
}


/* Card */
.amfa-location-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    margin-bottom: 12px;
    transition: 0.2s ease;
}

.amfa-location-card:hover {
    background: #eef4ff;
    transform: translateY(-2px);
}

/* Icon */
.amfa-location-icon {
    font-size: 18px;
}

/* Right */
.amfa-location-right a {
    display: block;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
    margin: 4px 0;
}

.amfa-location-right a:hover {
    text-decoration: underline;
}

/* Badge */
.amfa-badge {
    font-size: 11px;
    background: #e0e7ff;
    color: #3730a3;
    padding: 3px 8px;
    border-radius: 20px;
}

/* Type label */
.amfa-type {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 4px;
}

.amfa-type.source {
    color: #7c3aed;
}

.amfa-type.usage {
    color: #059669;
}

/* ---------- POPUP ---------- */
.amfa-popup {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.amfa-popup.active {
    display: block;
}

.amfa-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

/* Popup Box */
.amfa-popup-box {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 640px;
    max-width: 90%;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: amfaFadeIn 0.25s ease;
}

/* Header */
.amfa-popup-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.amfa-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Close Button */
.amfa-popup-close {
    cursor: pointer;
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: 0.2s;
}

.amfa-popup-close:hover {
    background: #eee;
}

/* Toolbar / Search */
.amfa-popup-toolbar {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
}

#amfa-search {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    outline: none;
    transition: 0.2s;
}

#amfa-search:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Content */
.amfa-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
    max-height: 500px;
    width: 95%;
    margin: 0 auto;
}

/* Scrollbar */
.amfa-popup-content::-webkit-scrollbar {
    width: 8px;
}

.amfa-popup-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.amfa-popup-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Rows */
.amfa-row {
    padding: 10px 20px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.amfa-row:hover {
    background: #f8f9fb;
}

.amfa-row.source {
    border-left: 3px solid #2271b1;
    padding-left: 10px;
    background: #e6f4ff;
    font-weight: 600;
}

.amfa-row.usage {
    border-left: 3px solid #edb900;
    padding-left: 22px;
}

.amfa-row a {
    text-decoration: none;
    color: #2271b1;
    font-weight: 500;
}

.amfa-row a:hover {
    text-decoration: underline;
}

.amfa-row small {
    opacity: 0.6;
    margin-left: 8px;
}

/* Load More */
.amfa-load-more {
    width: 100%;
    padding: 12px;
    border: none;
    background: #2271b1;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
    display: none;
}

.amfa-load-more:hover {
    background: #135e96;
}

/* Loading */
.amfa-loading {
    text-align: center;
    padding: 20px;
}

/* Filters */
.amfa-filters button {
    margin-right: 5px;
}

.amfa-table td,
.amfa-card.unused table td {
    color: #666;
}

.amfa-clear {
    clear: both;
}



@keyframes amfaFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ---------- ANIMATION ---------- */
@keyframes amfaFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes amfapopFade {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ---------- MOBILE ---------- */
@media (max-width:900px) {
    .amfa-card {
        padding: 20px;
    }

    .amfa-table th,
    .amfa-table td {
        padding: 10px;
        font-size: 13px;
    }
}