﻿/* =========================================================
   ProjectExtScan (site-aligned styling)
   Matches projectstyle.css visual language
   ========================================================= */

.ext-scans {
    padding: 16px;
}

/* Header */
.ext-scans__hdr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.ext-scans__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    color: #111827;
}

.ext-scans__sub {
    color: #6b7280;
    font-size: 14px;
    margin-top: 4px;
}

/* Layout grid */
.ext-scans__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Two-column desktop layout */
@media (min-width: 992px) {
    .ext-scans__grid {
        grid-template-columns: 1.2fr .8fr;
        align-items: start;
    }
}

/* Card top row (title + badge/actions) */
.ext-scans__card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.ext-scans__card-title {
    font-weight: 700;
    color: #111827;
    font-size: 15px;
}

/* Empty states */
.ext-scans__empty-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0;
    color: #111827;
}

.ext-scans__empty-sub {
    color: #6b7280;
    margin-top: 4px;
    font-size: 12px;
}

/* CTAs + action rows */
.ext-scans__cta,
.ext-scans__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Step content */
.ext-scans__step-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0;
    color: #111827;
}

.ext-scans__step-sub {
    color: #6b7280;
    margin-top: 4px;
    font-size: 12px;
}

/* Meta list */
.ext-scans__meta {
    margin-top: 8px;
    display: grid;
    gap: 4px;
    color: #6b7280;
    font-size: 13px;
}

/* Summary tiles */
.ext-scans__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

@media (max-width: 420px) {
    .ext-scans__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ext-scans__summary-item {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: box-shadow .12s ease, border-color .12s ease, transform .08s ease;
}

    .ext-scans__summary-item:hover {
        box-shadow: 0 6px 18px rgba(0,0,0,.08);
        border-color: rgba(0,0,0,.12);
        transform: translateY(-1px);
    }

    .ext-scans__summary-item .k {
        color: #6b7280;
        font-size: 11px;
        letter-spacing: 0.02em;
        font-weight: 700;
        text-transform: uppercase;
        opacity: .75;
    }

    .ext-scans__summary-item .v {
        font-weight: 900;
        font-size: 16px;
        color: #111827;
        line-height: 1.1;
        margin-top: 2px;
        font-variant-numeric: tabular-nums;
    }

    .ext-scans__summary-item .u {
        font-weight: 600;
        font-size: 13px;
        color: #6b7280;
        margin-left: 2px;
    }

/* History list */
.ext-scans__history {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.ext-scans__history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid rgba(0,0,0,.08);
    padding-top: 8px;
    transition: opacity .12s ease;
}

    .ext-scans__history-row:hover {
        opacity: .85;
    }

.ext-scans__history-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Skeleton */
.ext-scans__skeleton .skeleton {
    height: 180px;
    background: rgba(0,0,0,.02);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

/* Button styling to match site */
.ext-scans button,
.ext-scans .btn {
    appearance: none;
    border: 1px solid rgba(0,0,0,.15);
    background: #ffffff;
    color: #111827;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease, transform .08s ease;
}

    .ext-scans button:hover,
    .ext-scans .btn:hover {
        background: #f8fafc;
        border-color: rgba(0,0,0,.20);
        box-shadow: 0 2px 10px rgba(0,0,0,.08);
    }

    .ext-scans button:active,
    .ext-scans .btn:active {
        transform: translateY(1px);
    }

    .ext-scans button:focus,
    .ext-scans .btn:focus {
        outline: none;
    }

    .ext-scans button:focus-visible,
    .ext-scans .btn:focus-visible {
        box-shadow: 0 0 0 3px rgba(13,110,253,.20);
        border-color: rgba(13,110,253,.35);
    }

    /* Primary button variant */
    .ext-scans button.primary,
    .ext-scans .btn.primary {
        background: #0d6efd;
        border-color: #0d6efd;
        color: #ffffff;
    }

        .ext-scans button.primary:hover,
        .ext-scans .btn.primary:hover {
            background: #0b5ed7;
            border-color: #0b5ed7;
        }

    /* Danger/delete button variant */
    .ext-scans button.danger,
    .ext-scans .btn.danger {
        color: #dc2626;
        border-color: rgba(220, 38, 38, 0.35);
        background: transparent;
    }

        .ext-scans button.danger:hover,
        .ext-scans .btn.danger:hover {
            background: rgba(220, 38, 38, 0.08);
            border-color: rgba(220, 38, 38, 0.55);
        }

/* Card wrapper (matches project-card style) */
.ext-scans__card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: background-color .12s ease, transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}

    .ext-scans__card:hover {
        background: #f8fafc;
        border-color: rgba(0,0,0,.12);
        box-shadow: 0 6px 18px rgba(0,0,0,.08);
    }

/* Badge styling */
.ext-scans__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

    .ext-scans__badge.working {
        background: #f6f7ff;
        border-color: #d6dbff;
        color: #243b80;
    }

    .ext-scans__badge.done {
        background: #f2fbf5;
        border-color: #ccefd9;
        color: #0f5132;
    }

    .ext-scans__badge.pending {
        background: #fff7ed;
        border-color: #fed7aa;
        color: #9a3412;
    }

/* Optional: reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .ext-scans *,
    .ext-scans *::before,
    .ext-scans *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .ext-scans {
        padding: 12px;
    }

    .ext-scans__hdr {
        flex-direction: column;
        gap: 12px;
    }

    .ext-scans__title {
        font-size: 15px;
    }

    .ext-scans__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
