/**
 * UUID Generator Block — block-only styles.
 *
 * Layout, spacing, grid, card, primary buttons and form structure rely on the
 * theme's bundled Bootstrap 4 classes (see view.php). This file only covers the
 * tool-specific visuals Bootstrap can't express, all scoped under
 * `.uuid-generator-block` so nothing leaks into the rest of the site.
 *
 * Brand palette: green #028d40 (primary), violet #605cb8 (hover), per design tokens.
 */

.uuid-generator-block {
    /* Design-system --font-mono token (the theme itself doesn't define one). */
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.uuid-generator-block .ugb-wrap {
    max-width: 820px;
    margin: 0 auto;
}

.uuid-generator-block .ugb-card {
    border: 1px solid #e6e6e6;
    border-radius: .25rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, .1);
    overflow: hidden;
}

.uuid-generator-block .ugb-card .card-body {
    padding: 28px 34px 32px;
}

/* ---- header ---- */
.uuid-generator-block .ugb-badge {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #028d40;
    margin-bottom: 10px;
}

.uuid-generator-block .ugb-heading {
    margin: 0 0 22px;
    font-size: 26px;
    font-weight: 500;
    color: #343a40;
    line-height: 1.2;
}

/* ---- generic labels / hints ---- */
.uuid-generator-block .ugb-label {
    font-size: 14px;
    font-weight: 500;
    color: #343a40;
    margin: 0 0 10px;
}

/* Section labels (Result, Count) — more space above, tighter to their control. */
.uuid-generator-block .ugb-label-sec {
    margin-top: 26px;
    margin-bottom: 8px;
}

/* Format label — larger gap down to the tiles. */
.uuid-generator-block .ugb-label-fmt {
    margin: 28px 0 14px;
}

/* In-namebox labels sit tighter to their fields. */
.uuid-generator-block .ugb-namebox .ugb-label {
    margin-bottom: 8px;
}

.uuid-generator-block .ugb-hint {
    font-size: 12px;
    color: #777;
    margin-top: 10px;
}

.uuid-generator-block .ugb-hint i {
    margin-right: 6px;
    color: #028d40;
}

/* ---- inputs / selects (sized to match the design) ---- */
.uuid-generator-block .ugb-control {
    height: 48px;
    padding: 0 14px;
    font-size: 15px;
    color: #343a40;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: .25rem;
    outline: none;
    box-sizing: border-box;
    width: 100%;
}

.uuid-generator-block select.ugb-control {
    cursor: pointer;
    padding: 0 12px;
}

.uuid-generator-block .ugb-control:focus {
    border-color: #028d40;
    box-shadow: 0 0 0 .2rem rgba(2, 141, 64, .15);
}

/* ---- name-based fields (v3 / v5) ---- */
.uuid-generator-block .ugb-namebox {
    margin-top: 20px;
}

.uuid-generator-block .ugb-name-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.uuid-generator-block .ugb-customns {
    margin-top: 14px;
}

.uuid-generator-block .ugb-customns-input {
    font-family: var(--font-mono);
}

/* ---- toggle buttons (version tabs + count presets) ---- */
.uuid-generator-block .ugb-versions {
    gap: 8px;
}

.uuid-generator-block .ugb-presets {
    gap: 6px;
}

.uuid-generator-block .ugb-ver-btn,
.uuid-generator-block .ugb-preset {
    height: 40px;
    min-width: 52px;
    padding: 0 16px;
    border: 1px solid #e6e6e6;
    border-radius: .25rem;
    background: #fff;
    color: #343a40;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s ease-out, border-color .2s ease-out, color .2s ease-out;
}

.uuid-generator-block .ugb-preset {
    height: 36px;
    min-width: 40px;
    padding: 0 10px;
}

.uuid-generator-block .ugb-ver-btn.is-active,
.uuid-generator-block .ugb-preset.is-active {
    background: #028d40;
    border-color: #028d40;
    color: #fff;
}

/* ---- result ---- */
.uuid-generator-block .ugb-result-row {
    gap: 12px;
}

.uuid-generator-block .ugb-result-box {
    flex: 1 1 340px;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 54px;
    padding: 0 18px;
    border: 1px solid #e6e6e6;
    border-radius: .25rem;
    background: #f8f9fa;
    overflow: hidden;
}

.uuid-generator-block .ugb-primary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    font-size: 19px;
    letter-spacing: .02em;
    color: #212529;
}

.uuid-generator-block .ugb-primary.is-error,
.uuid-generator-block .ugb-row-val.is-error {
    color: #dc3545;
}

.uuid-generator-block .ugb-result-actions {
    gap: 10px;
}

.uuid-generator-block .ugb-regen {
    width: 54px;
    height: 54px;
    flex: none;
    padding: 0;
    border: 1px solid #028d40;
    border-radius: .25rem;
    background: #fff;
    color: #028d40;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease-out, color .2s ease-out;
}

.uuid-generator-block .ugb-regen:hover {
    background: #028d40;
    color: #fff;
}

.uuid-generator-block .ugb-copy {
    height: 54px;
    padding: 0 28px;
    flex: none;
    border: 0;
    border-radius: .25rem;
    background: #028d40;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s ease-out;
}

.uuid-generator-block .ugb-copy:hover {
    background: #605cb8;
    color: #fff;
}

/* ---- count ---- */
.uuid-generator-block .ugb-count-row {
    gap: 10px;
}

.uuid-generator-block .ugb-count {
    width: 74px;
    height: 48px;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    padding: 0;
}

/* ---- list ---- */
.uuid-generator-block .ugb-listwrap {
    margin-top: 20px;
    border: 1px solid #e6e6e6;
    border-radius: .25rem;
    overflow: hidden;
}

.uuid-generator-block .ugb-list-head {
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e6e6e6;
}

.uuid-generator-block .ugb-list-count {
    font-size: 13px;
    font-weight: 500;
    color: #343a40;
}

.uuid-generator-block .ugb-copyall {
    border: 1px solid #028d40;
    border-radius: .25rem;
    background: #fff;
    color: #028d40;
    font-size: 13px;
    padding: 6px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .2s ease-out, color .2s ease-out;
}

.uuid-generator-block .ugb-copyall:hover {
    background: #028d40;
    color: #fff;
}

.uuid-generator-block .ugb-list {
    max-height: 260px;
    overflow-y: auto;
}

.uuid-generator-block .ugb-list::-webkit-scrollbar {
    width: 8px;
}

.uuid-generator-block .ugb-list::-webkit-scrollbar-thumb {
    background: #d7d7d7;
    border-radius: 4px;
}

.uuid-generator-block .ugb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.uuid-generator-block .ugb-row:last-child {
    border-bottom: none;
}

.uuid-generator-block .ugb-row:nth-child(even) {
    background: #fcfcfc;
}

.uuid-generator-block .ugb-row-num {
    flex: none;
    width: 24px;
    text-align: right;
    font-size: 12px;
    color: #adb5bd;
}

.uuid-generator-block .ugb-row-val {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    font-size: 15px;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uuid-generator-block .ugb-row-copy {
    flex: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #e6e6e6;
    border-radius: .25rem;
    background: #fff;
    color: #777;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uuid-generator-block .ugb-row-copy.is-copied {
    color: #028d40;
    border-color: #028d40;
}

/* ---- format tiles ---- */
.uuid-generator-block .ugb-formats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
    gap: 12px;
}

.uuid-generator-block .ugb-fmt {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding: 13px 15px;
    border: 1px solid #e6e6e6;
    border-radius: .25rem;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color .2s ease-out;
}

.uuid-generator-block .ugb-fmt-box {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 4px;
    border: 1px solid #c4c4c4;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    transition: background .2s ease-out, border-color .2s ease-out;
}

.uuid-generator-block .ugb-fmt-box i {
    opacity: 0;
}

.uuid-generator-block .ugb-fmt.is-active .ugb-fmt-box {
    background: #028d40;
    border-color: #028d40;
}

.uuid-generator-block .ugb-fmt.is-active .ugb-fmt-box i {
    opacity: 1;
}

.uuid-generator-block .ugb-fmt-label {
    font-size: 14px;
    font-weight: 500;
    color: #343a40;
    line-height: 1.2;
}

.uuid-generator-block .ugb-fmt-sub {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
}

/* ---- footer note ---- */
.uuid-generator-block .ugb-foot {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #f2f2f2;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #777;
}

.uuid-generator-block .ugb-foot i {
    color: #028d40;
}

/* ---- responsive ---- */
@media (max-width: 575.98px) {
    .uuid-generator-block .ugb-card .card-body {
        padding: 22px 18px 24px;
    }

    .uuid-generator-block .ugb-name-grid {
        grid-template-columns: 1fr;
    }

    .uuid-generator-block .ugb-result-actions {
        width: 100%;
    }

    .uuid-generator-block .ugb-copy {
        flex: 1;
    }
}
