/**
 * Metaly for ACF and SCF — Code Scan Field
 *
 * Admin UI styles (WordPress-native look).
 *
 * @since 1.0.0
 */

/* Row layout: input + buttons inline */
.metaly-code-scan__row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Make the input feel like native WP fields */
.metaly-code-scan__input {
    max-width: 360px;
}

/* Slight spacing between field and description (optional) */
.metaly-code-scan .description {
    margin-top: 6px;
}

/* -----------------------------
   Modal (scanner)
-------------------------------- */

.metaly-code-scan__modal[hidden] {
    display: none !important;
}

.metaly-code-scan__modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    /* high enough for WP admin */
}

/* Backdrop */
.metaly-code-scan__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

/* Panel */
.metaly-code-scan__panel {
    position: relative;
    width: min(720px, calc(100% - 40px));
    margin: 8vh auto;
    background: #fff;
    border-radius: 4px;
    /* WP-ish */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #dcdcde;
    overflow: hidden;
}

/* Header */
.metaly-code-scan__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #dcdcde;
    background: #f6f7f7;
    /* subtle WP admin header tone */
}

.metaly-code-scan__header strong {
    font-size: 13px;
    line-height: 1.4;
}

/* Body */
.metaly-code-scan__body {
    padding: 12px;
}

/* Reader container */
.metaly-code-scan__reader {
    min-height: 280px;
}

/* Status text */
.metaly-code-scan__status {
    margin: 10px 0 0;
}

/* Footer (optional; you have Stop button) */
.metaly-code-scan__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #dcdcde;
    background: #f6f7f7;
}

/* Close button (uses .button-link, but ensure spacing) */
.metaly-code-scan__close {
    text-decoration: none;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

/* Responsive tweaks */
@media (max-width: 520px) {
    .metaly-code-scan__row {
        flex-wrap: wrap;
    }

    .metaly-code-scan__input {
        max-width: 100%;
        flex: 1 1 auto;
    }
}