/* =========================================================
   F2 JSON Converter Tools
   Main Frontend Styles
========================================================= */

.f2-json-tool {
    --f2-primary: #2f6fed;
    --f2-primary-dark: #2459c8;
    --f2-border: #dfe3e8;
    --f2-border-dark: #c8ced6;
    --f2-text: #202223;
    --f2-muted: #6d7175;
    --f2-bg: #f6f6f7;
    --f2-card-bg: #ffffff;
    --f2-success: #008060;
    --f2-warning: #b98900;
    --f2-danger: #d72c0d;
    --f2-info-bg: #eef5ff;
    --f2-info-border: #cbdcfb;
    --f2-radius: 12px;
    --f2-radius-small: 8px;
    --f2-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    color: var(--f2-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

.f2-json-tool *,
.f2-json-tool *::before,
.f2-json-tool *::after {
    box-sizing: border-box;
}


/* =========================================================
   Cards
========================================================= */

.f2-json-card {
    background: var(--f2-card-bg);
    border: 1px solid var(--f2-border);
    border-radius: var(--f2-radius);
    padding: 26px;
    margin-bottom: 22px;
    box-shadow: var(--f2-shadow);
}

.f2-json-card:last-child {
    margin-bottom: 0;
}


/* =========================================================
   Hero
========================================================= */

.f2-json-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 30px;
    align-items: center;
    padding: 32px;
}

.f2-json-hero-content {
    min-width: 0;
}

.f2-json-title {
    margin: 12px 0 10px;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--f2-text);
}

.f2-json-description {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--f2-muted);
}

.f2-json-hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.f2-json-conversion-box,
.f2-json-data-example {
    width: 100%;
    min-height: 190px;
    padding: 24px;
    border: 1px solid #cbdcfb;
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            rgba(47, 111, 237, 0.08),
            rgba(255, 255, 255, 0.95)
        );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.f2-json-conversion-box strong {
    font-size: 26px;
    color: var(--f2-primary);
}

.f2-json-arrow {
    font-size: 26px;
    line-height: 1;
    color: var(--f2-muted);
}

.f2-json-data-example code {
    width: 100%;
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--f2-border);
    font-size: 12px;
    color: var(--f2-text);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   Section Headers
========================================================= */

.f2-json-section-header {
    margin-bottom: 20px;
}

.f2-json-section-header h3 {
    margin: 0 0 7px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--f2-text);
}

.f2-json-section-header p {
    margin: 0;
    color: var(--f2-muted);
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   Badges
========================================================= */

.f2-json-feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.f2-json-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    border: 1px solid transparent;
}

.f2-json-badge-blue {
    color: #1f5fc4;
    background: #edf4ff;
    border-color: #cbdcfb;
}

.f2-json-badge-green {
    color: #006e52;
    background: #e8f8f2;
    border-color: #b8e6d5;
}

.f2-json-badge-orange {
    color: #8a6200;
    background: #fff7d6;
    border-color: #eedc94;
}


/* =========================================================
   Labels / Fields
========================================================= */

.f2-json-field-label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--f2-text);
}


/* =========================================================
   Upload Zone
========================================================= */

.f2-json-upload-zone {
    position: relative;
    min-height: 190px;
    border: 2px dashed var(--f2-border-dark);
    border-radius: var(--f2-radius);
    background: #fafafa;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.f2-json-upload-zone:hover {
    border-color: var(--f2-primary);
    background: #f7faff;
}

.f2-json-upload-zone:focus {
    outline: 2px solid rgba(47, 111, 237, 0.25);
    outline-offset: 2px;
}

.f2-json-upload-zone.f2-is-dragover {
    border-color: var(--f2-primary);
    background: #eef5ff;
    transform: translateY(-1px);
}

.f2-json-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.f2-json-upload-note {
    font-size: 13px;
    color: var(--f2-muted);
}


/* =========================================================
   Buttons
========================================================= */

.f2-json-actions,
.f2-json-output-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.f2-json-actions {
    margin-top: 18px;
}

.f2-json-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.f2-json-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.f2-json-btn:focus {
    outline: 2px solid rgba(47, 111, 237, 0.25);
    outline-offset: 2px;
}

.f2-json-btn-primary {
    background: var(--f2-primary);
    border-color: var(--f2-primary);
    color: #ffffff;
}

.f2-json-btn-primary:hover:not(:disabled) {
    background: var(--f2-primary-dark);
    border-color: var(--f2-primary-dark);
}

.f2-json-btn-secondary {
    background: #ffffff;
    border-color: var(--f2-border-dark);
    color: var(--f2-text);
}

.f2-json-btn-secondary:hover:not(:disabled) {
    background: #f7f7f8;
    border-color: #aeb4bb;
}

.f2-json-btn-danger-outline {
    background: #ffffff;
    border-color: #f1b8ad;
    color: var(--f2-danger);
}

.f2-json-btn-danger-outline:hover:not(:disabled) {
    background: #fff4f2;
    border-color: #e38a78;
}

.f2-json-btn-small {
    min-height: 34px;
    padding: 7px 12px;
    background: #ffffff;
    border-color: var(--f2-border-dark);
    color: var(--f2-text);
    font-size: 12px;
}

.f2-json-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
}


/* =========================================================
   Alerts
========================================================= */

.f2-json-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--f2-radius-small);
    border: 1px solid;
}

.f2-json-alert-info {
    background: var(--f2-info-bg);
    border-color: var(--f2-info-border);
    color: #234c83;
}

.f2-json-alert-icon {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1.3;
}

.f2-json-alert strong {
    display: block;
    margin: 0 0 3px;
    font-size: 14px;
}

.f2-json-alert p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   Stats
========================================================= */

.f2-json-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.f2-json-input-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
}

.f2-json-stat-box {
    min-width: 0;
    padding: 14px;
    background: #fafafa;
    border: 1px solid var(--f2-border);
    border-radius: 9px;
}

.f2-json-stat-box span {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--f2-muted);
}

.f2-json-stat-box strong {
    display: block;
    font-size: 14px;
    color: var(--f2-text);
    word-break: break-word;
}


/* =========================================================
   Data Input
========================================================= */

.f2-json-data-input,
.f2-json-output {
    width: 100%;
    border: 1px solid var(--f2-border-dark);
    border-radius: 9px;
    background: #ffffff;
    color: var(--f2-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.65;
    resize: vertical;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.f2-json-data-input {
    min-height: 250px;
    padding: 15px;
}
.f2-json-output {
    width: 100%;
    min-height: 320px;
    padding: 18px;

    border: 0;
    border-top: 1px solid #dfe3e8;
    border-radius: 0 0 9px 9px;

    background: #ffffff;
    color: #202223;

    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;

    font-size: 14px;
    line-height: 1.7;

    resize: vertical;
    outline: none;

    box-shadow: none;
}

.f2-json-data-input:focus {
    border-color: var(--f2-primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}


/* =========================================================
   Input Format Boxes
========================================================= */

.f2-json-format-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.f2-json-format-box {
    padding: 16px;
    border: 1px solid var(--f2-border);
    border-radius: 10px;
    background: #fafafa;
}

.f2-json-format-box h4 {
    margin: 10px 0 8px;
    font-size: 14px;
    color: var(--f2-text);
}

.f2-json-format-box code {
    display: block;
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--f2-border);
    border-radius: 7px;
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
}


/* =========================================================
   Tables
========================================================= */

.f2-json-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--f2-border);
    border-radius: 9px;
    background: #ffffff;
}

.f2-json-preview-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    border-spacing: 0;
}

.f2-json-preview-table th,
.f2-json-preview-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--f2-border);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.5;
}

.f2-json-preview-table th {
    background: #f7f7f8;
    color: var(--f2-text);
    font-weight: 700;
}

.f2-json-preview-table td {
    color: #3f454a;
}

.f2-json-preview-table tbody tr:last-child td {
    border-bottom: 0;
}

.f2-json-preview-table tbody tr:hover {
    background: #fafcff;
}


/* =========================================================
   JSON Output
========================================================= */

.f2-json-output-wrapper {
    margin-top: 18px;

    border: 1px solid #dfe3e8;
    border-radius: 10px;

    overflow: hidden;

    background: #ffffff;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.f2-json-output-toolbar {
    min-height: 56px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 14px;

    padding: 10px 12px 10px 16px;

    background: #ffffff;
    color: #202223;

    border-bottom: 1px solid #dfe3e8;
}

.f2-json-output-toolbar > span {
    font-size: 13px;
    font-weight: 700;
    color: #202223;
}

/* =========================================================
   How To Use
========================================================= */

.f2-json-step-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.f2-json-step {
    padding: 18px;
    border: 1px solid var(--f2-border);
    border-radius: 10px;
    background: #fafafa;
}

.f2-json-step-number {
    width: 34px;
    height: 34px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin-bottom: 12px;
    background: var(--f2-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.f2-json-step-green {
    background: var(--f2-success);
}

.f2-json-step h4 {
    margin: 0 0 7px;
    font-size: 15px;
}

.f2-json-step p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--f2-muted);
}


/* =========================================================
   Privacy
========================================================= */

.f2-json-privacy-card {
    background: #f5fbf8;
    border-color: #c8e8da;
}

.f2-json-privacy-title {
    margin-bottom: 6px;
    color: #006e52;
    font-size: 14px;
    font-weight: 700;
}

.f2-json-privacy-card p {
    margin: 0;
    color: #42665a;
    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   Toast
========================================================= */

.f2-json-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #202223;
    color: #ffffff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    font-size: 13px;
    line-height: 1.45;
}

.f2-json-toast.f2-toast-success {
    background: #006e52;
}

.f2-json-toast.f2-toast-error {
    background: #b42318;
}


/* =========================================================
   Utility
========================================================= */

.f2-json-tool [hidden] {
    display: none !important;
}

.f2-json-file-details {
    margin-top: 0;
}


/* =========================================================
   Elementor / Theme Compatibility
========================================================= */

.elementor-widget-shortcode .f2-json-tool {
    width: 100%;
}

.f2-json-tool button,
.f2-json-tool input,
.f2-json-tool textarea {
    font: inherit;
}

.f2-json-tool button {
    text-transform: none;
    letter-spacing: normal;
}

.f2-json-tool textarea {
    box-shadow: none;
}


/* =========================================================
   Tablet
========================================================= */

@media (max-width: 900px) {

    .f2-json-hero {
        grid-template-columns: 1fr;
    }

    .f2-json-hero-visual {
        justify-content: flex-start;
    }

    .f2-json-conversion-box,
    .f2-json-data-example {
        max-width: 420px;
    }

    .f2-json-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .f2-json-format-grid,
    .f2-json-step-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Mobile
========================================================= */

@media (max-width: 600px) {

    .f2-json-card {
        padding: 18px;
        margin-bottom: 16px;
        border-radius: 10px;
    }

    .f2-json-hero {
        padding: 20px;
        gap: 20px;
    }

    .f2-json-title {
        font-size: 24px;
    }

    .f2-json-description {
        font-size: 14px;
    }

    .f2-json-feature-badges {
        gap: 6px;
    }

    .f2-json-badge {
        font-size: 11px;
    }

    .f2-json-upload-zone {
        min-height: 160px;
        padding: 18px;
    }

    .f2-json-stats-grid,
    .f2-json-input-stats {
        grid-template-columns: 1fr;
    }

    .f2-json-actions {
        align-items: stretch;
    }

    .f2-json-actions .f2-json-btn {
        width: 100%;
    }

    .f2-json-output-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .f2-json-output-actions {
        width: 100%;
    }

    .f2-json-output-actions .f2-json-btn {
        flex: 1 1 auto;
    }

    .f2-json-data-input {
        min-height: 220px;
    }

    .f2-json-output {
        min-height: 280px;
    }

    .f2-json-toast {
        left: 14px;
        right: 14px;
        bottom: 14px;
        max-width: none;
    }
}



.f2-json-output-toolbar .f2-json-btn-small {
    background: #ffffff;
    color: #202223;

    border: 1px solid #c9cccf;

    min-height: 38px;
    padding: 8px 14px;

    border-radius: 8px;

    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.f2-json-output-toolbar .f2-json-btn-small:hover {
    background: #f6f6f7;
    border-color: #aeb4b9;
}

.f2-json-output:focus {
    background: #ffffff;
    color: #202223;
    border-color: transparent;
    box-shadow: none;
    outline: none;
}


