/* ================================================================
   NAME STYLE STUDIO — CUSTOM SYMBOL BUILDER
   This file is intentionally separate from frontend.css so the
   builder remains easy to find, maintain and remove independently.
================================================================ */

/* ----------------------------------------------------------------
   01. GENERATOR TABS
---------------------------------------------------------------- */
.nss-generator-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
    padding: 5px;
    border: 1px solid var(--nss-border);
    border-radius: 12px;
    background: #0a1422;
}

.nss-generator-tab {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #aebdd0;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nss-generator-tab:hover {
    color: #ffffff;
    border-color: color-mix(in srgb, var(--nss-primary) 48%, var(--nss-border));
}

.nss-generator-tab.is-active {
    color: #ffffff;
    border-color: color-mix(in srgb, var(--nss-primary) 65%, transparent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--nss-primary) 92%, #ffffff 8%), color-mix(in srgb, var(--nss-primary) 67%, #e329ff));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--nss-primary) 22%, transparent);
}

.nss-generator-tab:active {
    transform: scale(.985);
}

.nss-generator-tab:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.nss-generator-tab .nss-icon {
    width: 18px;
    height: 18px;
}

/* ----------------------------------------------------------------
   02. BUILDER PANEL
---------------------------------------------------------------- */
.nss-symbol-builder[hidden] {
    display: none !important;
}

.nss-layout[data-nss-standard-styles][hidden] {
    display: none !important;
}

.nss-symbol-builder {
    margin-top: 14px;
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--nss-primary) 35%, var(--nss-border));
    border-radius: 14px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--nss-primary) 15%, transparent), transparent 34%),
        linear-gradient(180deg, #0e1a2a, #0a1523);
    animation: nss-symbol-builder-in .24s ease both;
}

@keyframes nss-symbol-builder-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.nss-symbol-builder-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.nss-symbol-builder-heading-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--nss-primary), color-mix(in srgb, var(--nss-primary) 65%, #f12fff));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--nss-primary) 25%, transparent);
}

.nss-symbol-builder-heading-icon .nss-icon {
    width: 22px;
    height: 22px;
}

.nss-symbol-builder-header h2 {
    margin: 0 0 4px;
    color: #ffffff;
    font-size: 19px;
    line-height: 1.3;
}

.nss-symbol-builder-header p {
    margin: 0;
    color: #9fb0c5;
    font-size: 13px;
    line-height: 1.55;
}

/* ----------------------------------------------------------------
   03. FORM CONTROLS
---------------------------------------------------------------- */


.nss-symbol-builder-field,
.nss-symbol-builder fieldset {
    min-width: 0;
}

.nss-symbol-builder-field > label,
.nss-symbol-builder legend {
    display: block;
    margin: 0 0 9px;
    color: #e8eff8;
    font-size: 13px;
    font-weight: 800;
}

.nss-symbol-builder-font-field select {
    width: 100%;
    min-height: 44px;
    padding: 0 40px 0 12px;
    border: 1px solid #34465d;
    border-radius: 9px;
    outline: none;
    background: #0a1422;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
}

.nss-symbol-builder-font-field select:focus {
    border-color: var(--nss-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nss-primary) 20%, transparent);
}

.nss-symbol-builder fieldset {
    margin: 18px 0 0;
    padding: 0;
    border: 0;
}

/* ----------------------------------------------------------------
   04. SYMBOL PRESETS
---------------------------------------------------------------- */
.nss-symbol-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.nss-symbol-preset {
    min-width: 0;
    min-height: 43px;
    padding: 8px 7px;
    overflow: hidden;
    border: 1px solid #34465d;
    border-radius: 9px;
    background: #101e30;
    color: #e8eff8;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.nss-symbol-preset:hover {
    border-color: var(--nss-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

.nss-symbol-preset.is-active {
    border-color: var(--nss-primary);
    color: #ffffff;
    background: color-mix(in srgb, var(--nss-primary) 24%, #101e30);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nss-primary) 35%, transparent);
}

.nss-symbol-preset:focus-visible {
    outline: 2px solid var(--nss-primary);
    outline-offset: 2px;
}

/* ----------------------------------------------------------------
   05. CUSTOM PREFIX / SYMBOL / SUFFIX INPUTS
---------------------------------------------------------------- */
.nss-symbol-custom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.nss-symbol-custom-grid label {
    min-width: 0;
    display: grid;
    gap: 7px;
    margin: 0;
}

.nss-symbol-custom-grid .nss-symbol-custom-name,
.nss-symbol-custom-grid .nss-symbol-custom-name-font {
    grid-column: 1 / -1;
}

.nss-symbol-custom-grid label > span {
    color: #b9c6d6;
    font-size: 12px;
    font-weight: 750;
}

.nss-symbol-custom-grid input,
.nss-symbol-custom-grid select {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 11px;
    border: 1px solid #34465d;
    border-radius: 9px;
    outline: none;
    background: #0a1422;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
}

.nss-symbol-custom-grid input:focus,
.nss-symbol-custom-grid select:focus {
    border-color: var(--nss-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nss-primary) 20%, transparent);
}

.nss-symbol-custom-grid input::placeholder {
    color: #6f8198;
}

.nss-symbol-custom-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 10px 0 0;
    color: #8fa1b7;
    font-size: 12px;
    line-height: 1.5;
}

.nss-symbol-custom-note .nss-icon {
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    color: var(--nss-primary);
}

/* ----------------------------------------------------------------
   06. LIVE PREVIEW
---------------------------------------------------------------- */
.nss-symbol-builder-preview {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--nss-primary) 40%, #34465d);
    border-radius: 11px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--nss-primary) 11%, #ffffff), #ffffff);
    color: #152033;
    text-align: center;
    overflow: hidden;
}

.nss-symbol-builder-preview > span {
    display: block;
    margin-bottom: 8px;
    color: #65758b;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nss-symbol-builder-preview strong {
    display: block;
    min-height: 36px;
    color: #141d2b;
    font-size: clamp(23px, 4vw, 34px);
    line-height: 1.35;
    font-weight: 700;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.nss-symbol-builder-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: #5f7188;
    font-size: 12px;
    font-weight: 700;
}

.nss-symbol-builder-counter b {
    color: #152033;
    font-size: 13px;
}

/* ----------------------------------------------------------------
   07. BUILDER ACTION BUTTONS
---------------------------------------------------------------- */
.nss-symbol-builder-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
    gap: 10px;
    margin-top: 13px;
}

.nss-symbol-builder-actions .nss-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nss-symbol-builder-actions .nss-icon {
    width: 18px;
    height: 18px;
}

.nss-symbol-copy.is-copied {
    background: linear-gradient(90deg, #15803d, #22a657);
    box-shadow: 0 8px 24px rgba(34, 166, 87, .22);
}

/* ----------------------------------------------------------------
   08. TABLET
---------------------------------------------------------------- */
@media (max-width: 900px) {
    .nss-symbol-preset-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ----------------------------------------------------------------
   09. MOBILE
---------------------------------------------------------------- */
@media (max-width: 760px) {
    .nss-generator-tabs {
        margin-top: 14px;
    }

    .nss-generator-tab {
        min-height: 42px;
        padding: 8px;
        font-size: 13px;
    }

    .nss-symbol-builder {
        margin-top: 11px;
        padding: 14px;
        border-radius: 12px;
    }

    .nss-symbol-builder-header {
        gap: 10px;
        margin-bottom: 15px;
    }

    .nss-symbol-builder-heading-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .nss-symbol-builder-header h2 {
        font-size: 17px;
    }

    .nss-symbol-preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .nss-symbol-preset {
        min-height: 42px;
        font-size: 12px;
    }

    .nss-symbol-custom-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .nss-symbol-builder-preview strong {
        font-size: clamp(21px, 7vw, 29px);
    }

    .nss-symbol-builder-actions {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------------------
   10. SMALL MOBILE
---------------------------------------------------------------- */
@media (max-width: 380px) {
    .nss-generator-tab {
        gap: 5px;
        font-size: 12px;
    }

    .nss-generator-tab .nss-icon {
        width: 16px;
        height: 16px;
    }

    .nss-symbol-builder {
        padding: 12px;
    }
}

/* ----------------------------------------------------------------
   11. REDUCED MOTION
---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .nss-symbol-builder,
    .nss-generator-tab,
    .nss-symbol-preset {
        animation: none !important;
        transition: none !important;
    }
}
