/* =========================================================
   LIBRARY BARCODE SYSTEM
   Common stylesheet for:
   - Barcode Generator
   - Individual Barcode Label Generator
   ========================================================= */


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --bc-primary: #0d6efd;
    --bc-purple: #6f42c1;
    --bc-green: #198754;

    --bc-dark: #111827;
    --bc-text: #212529;
    --bc-muted: #343a40;

    --bc-border: #e5e7eb;
    --bc-input-border: #ced4da;
    --bc-light: #f8f9fa;

    --bc-blue-light: #eef5ff;
    --bc-purple-light: #f3edff;
    --bc-green-light: #eaf8f0;

    --bc-radius: 12px;
    --bc-shadow: 0 8px 30px rgba(0, 0, 0, .07);
}


/* =========================================================
   COMMON CONTAINERS
   ========================================================= */

.barcode-generator,
.barcode-label-generator {
    width: 100%;
    max-width: 900px;
    margin: 30px auto;
    padding: 0 15px;
    box-sizing: border-box;
}


/* =========================================================
   HEADERS
   ========================================================= */

.barcode-header,
.barcode-label-header {
    text-align: center;
    margin-bottom: 28px;
}

.barcode-header h2,
.barcode-label-header h2 {
    margin: 0 0 10px;
    color: var(--bc-dark);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
}

.barcode-header p,
.barcode-label-header p {
    max-width: 760px;
    margin: 0 auto;
    color: var(--bc-text);
    font-size: 16px;
    line-height: 1.7;
}


/* =========================================================
   HEADER ICONS
   ========================================================= */

.barcode-header .barcode-icon,
.barcode-label-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    color: #fff;
    font-size: 28px;

    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

.barcode-header .barcode-icon {
    background: linear-gradient(135deg, #0d6efd, #4f8dfd);
}

.barcode-label-icon {
    background: linear-gradient(135deg, #6f42c1, #8e62d4);
}


/* =========================================================
   INFORMATION BADGE
   ========================================================= */

.barcode-note {
    display: inline-block;

    margin-top: 12px;
    padding: 8px 16px;

    border-radius: 30px;

    background: var(--bc-blue-light);
    color: var(--bc-primary);

    font-size: 14px;
    font-weight: 600;
}


/* =========================================================
   NEW GENERATOR LINK
   ========================================================= */

.barcode-new-link {
    margin-bottom: 25px;
    padding: 14px;

    border: 1px solid var(--bc-border);
    border-radius: 10px;

    background: var(--bc-light);

    text-align: center;

    color: var(--bc-text);
    font-size: 15px;
    line-height: 1.5;
}

.barcode-new-link a {
    color: var(--bc-primary);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.barcode-new-link a:hover {
    text-decoration: underline;
}


/* =========================================================
   COMMON CARD
   ========================================================= */

.barcode-card,
.barcode-label-card {
    background: #fff;

    border: 1px solid var(--bc-border);
    border-radius: 16px;

    box-shadow: var(--bc-shadow);

    overflow: hidden;
}


/* =========================================================
   BASIC BARCODE GENERATOR
   ========================================================= */

.barcode-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.barcode-card {
    position: relative;
    padding: 25px 28px;

    transition: transform .2s ease,
                box-shadow .2s ease;
}

.barcode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .09);
}


/* Card colour indicator */

.barcode-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 4px;

    background: var(--bc-primary);
}

.barcode-card.individual::before {
    background: var(--bc-purple);
}

.barcode-card.detailed::before {
    background: var(--bc-green);
}


/* =========================================================
   BASIC CARD HEADER
   ========================================================= */

.barcode-card-header {
    display: flex;
    align-items: center;
    gap: 15px;

    margin-bottom: 20px;
}

.barcode-card-icon {
    width: 50px;
    min-width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--bc-blue-light);
    color: var(--bc-primary);

    font-size: 21px;
}

.individual .barcode-card-icon {
    background: var(--bc-purple-light);
    color: var(--bc-purple);
}

.detailed .barcode-card-icon {
    background: var(--bc-green-light);
    color: var(--bc-green);
}

.barcode-card-header h3 {
    margin: 0 0 4px;

    color: var(--bc-dark);

    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

.barcode-card-header p {
    margin: 0;

    color: var(--bc-text);

    font-size: 15px;
    line-height: 1.5;
}


/* =========================================================
   BADGE
   ========================================================= */

.barcode-badge {
    display: inline-block;

    margin-bottom: 18px;
    padding: 6px 11px;

    border-radius: 20px;

    background: #f1f3f5;
    color: var(--bc-text);

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .4px;
}


/* =========================================================
   FORM GROUPS
   ========================================================= */

.barcode-form-group,
.barcode-field {
    margin-bottom: 18px;
}

.barcode-form-group:last-child,
.barcode-field:last-child {
    margin-bottom: 0;
}


/* =========================================================
   LABELS
   ========================================================= */

.barcode-form-group label,
.barcode-field label {
    display: block;

    margin-bottom: 7px;

    color: var(--bc-dark);

    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}


/* =========================================================
   INPUTS
   ========================================================= */

.barcode-card input[type="text"],
.barcode-card input[type="number"],
.barcode-card select,
.barcode-card textarea,

.barcode-field input[type="text"],
.barcode-field input[type="number"],
.barcode-field select,
.barcode-field textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 11px 13px;

    border: 1px solid var(--bc-input-border);
    border-radius: 9px;

    background: #fff;
    color: var(--bc-dark);

    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}


/* Textareas */

.barcode-card textarea {
    min-height: 150px;
}

.barcode-field textarea {
    min-height: 140px;
}

.barcode-card textarea,
.barcode-field textarea {
    resize: vertical;
}


/* Focus */

.barcode-card input:focus,
.barcode-card select:focus,
.barcode-card textarea:focus,

.barcode-field input:focus,
.barcode-field select:focus,
.barcode-field textarea:focus {
    outline: none;

    border-color: #9b7bd3;

    box-shadow:
        0 0 0 4px rgba(111, 66, 193, .10);
}


/* Placeholder */

.barcode-card input::placeholder,
.barcode-card textarea::placeholder,
.barcode-field input::placeholder,
.barcode-field textarea::placeholder {
    color: #6b7280;
    opacity: 1;
}


/* =========================================================
   HELP TEXT
   ========================================================= */

.help-text,
.barcode-help {
    display: block;

    margin-top: 5px;

    color: var(--bc-muted);

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   SERIAL NUMBER INPUTS
   ========================================================= */

.serial-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 18px;
}


/* =========================================================
   BASIC BARCODE BUTTONS
   ========================================================= */

.barcode-btn {
    width: 100%;

    padding: 13px 18px;

    border: 0;
    border-radius: 9px;

    color: #fff;

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform .2s ease,
        filter .2s ease;
}

.barcode-btn:hover {
    transform: translateY(-1px);
    filter: brightness(.95);
}

.barcode-btn.primary {
    background: var(--bc-primary);
}

.barcode-btn.purple {
    background: var(--bc-purple);
}

.barcode-btn.green {
    background: var(--bc-green);
}


/* =========================================================
   BASIC BARCODE FOOTER
   ========================================================= */

.barcode-footer {
    margin-top: 25px;
    padding: 17px 20px;

    border: 1px solid var(--bc-border);
    border-radius: 12px;

    background: var(--bc-light);

    text-align: center;

    color: var(--bc-text);

    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   INDIVIDUAL LABEL GENERATOR
   ========================================================= */

.barcode-label-card {
    border-radius: 18px;
}


/* =========================================================
   LABEL SECTIONS
   ========================================================= */

.barcode-section {
    padding: 25px 30px;

    border-bottom: 1px solid #edf0f2;
}

.barcode-section:last-child {
    border-bottom: 0;
}


/* =========================================================
   SECTION HEADINGS
   ========================================================= */

.barcode-section-title {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 20px;
}

.barcode-section-number {
    width: 34px;
    min-width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f0eaff;
    color: var(--bc-purple);

    font-size: 14px;
    font-weight: 700;
}

.barcode-section-title h3 {
    margin: 0;

    color: var(--bc-dark);

    font-size: 19px;
    font-weight: 700;
}

.barcode-section-title p {
    margin: 3px 0 0;

    color: var(--bc-text);

    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   INPUT FORMAT OPTIONS
   ========================================================= */

.input-format-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-bottom: 10px;
    padding: 15px;

    border: 1px solid var(--bc-border);
    border-radius: 10px;

    cursor: pointer;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.input-format-option:hover {
    border-color: #b9a1e5;
    background: #faf8ff;
}

.input-format-option input {
    margin-top: 4px;

    accent-color: var(--bc-purple);
}

.input-format-option strong {
    display: block;

    margin-bottom: 4px;

    color: var(--bc-dark);

    font-size: 15px;
}

.input-format-option small {
    color: var(--bc-text);

    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   FONT SETTINGS
   ========================================================= */

.font-settings {
    display: grid;

    grid-template-columns: 1.5fr 1fr 1fr;

    gap: 15px;

    padding: 16px;

    border: 1px solid #e9ecef;
    border-radius: 10px;

    background: var(--bc-light);
}

.font-settings .barcode-field {
    margin-bottom: 0;
}


/* =========================================================
   LABEL DIMENSIONS
   ========================================================= */

.dimension-box {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 18px;
}


/* =========================================================
   PDF SUBMIT AREA
   ========================================================= */

.barcode-submit-area {
    padding: 25px 30px;

    background: #fafbfc;

    text-align: center;
}


/* Generate PDF button */

.barcode-submit-btn {
    width: 100%;

    padding: 14px 20px;

    border: 0;
    border-radius: 10px;

    background: linear-gradient(
        135deg,
        #6f42c1,
        #805ad5
    );

    color: #fff;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 6px 16px rgba(111, 66, 193, .20);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.barcode-submit-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 9px 20px rgba(111, 66, 193, .28);
}

.barcode-submit-btn i {
    margin-right: 7px;
}


/* =========================================================
   PDF INFORMATION
   ========================================================= */

.pdf-info {
    margin-top: 20px;
    padding: 15px 18px;

    border: 1px solid #d5eaff;
    border-radius: 10px;

    background: #eef7ff;

    color: var(--bc-text);

    font-size: 14px;
    line-height: 1.6;
}

.pdf-info i {
    margin-right: 6px;
    color: var(--bc-primary);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 650px) {

    .barcode-generator,
    .barcode-label-generator {
        margin: 20px auto;
        padding: 0 10px;
    }


    .barcode-header h2,
    .barcode-label-header h2 {
        font-size: 25px;
    }


    .barcode-header p,
    .barcode-label-header p {
        font-size: 15px;
    }


    .barcode-card {
        padding: 20px;
    }


    .barcode-section {
        padding: 20px;
    }


    .barcode-submit-area {
        padding: 20px;
    }


    .serial-row,
    .font-settings,
    .dimension-box {
        grid-template-columns: 1fr;
    }


    .font-settings .barcode-field {
        margin-bottom: 15px;
    }


    .font-settings .barcode-field:last-child {
        margin-bottom: 0;
    }


    .barcode-card-header,
    .barcode-section-title {
        align-items: flex-start;
    }
}
/* =========================================================
   FULL WIDTH GENERATED CODE
   ========================================================= */

.mq-result-fullwidth {
    width: 100%;
    box-sizing: border-box;

    margin: 30px 0 0;
    padding: 25px;

    border: 1px solid #cfe2ff;
    border-radius: 12px;

    background: #f8fbff;
}


/* Header */

.mq-result-fullwidth .mq-result-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-bottom: 15px;

    color: #111827;
}

.mq-result-fullwidth .mq-result-header > i {
    color: #198754;
    font-size: 22px;
    margin-top: 2px;
}

.mq-result-fullwidth .mq-result-header strong {
    display: block;

    margin-bottom: 3px;

    color: #111827;
    font-size: 17px;
}

.mq-result-fullwidth .mq-result-header span {
    display: block;

    color: #212529;

    font-size: 14px;
    line-height: 1.6;
}


/* Code textarea */

.mq-result-fullwidth .mq-code-output {
    width: 100%;
    min-height: 400px;

    box-sizing: border-box;

    padding: 15px;

    border: 1px solid #ced4da;
    border-radius: 9px;

    background: #fff;

    color: #111827;

    font-family: "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;

    resize: vertical;
}

.mq-result-fullwidth .mq-code-output:focus {
    outline: none;

    border-color: #86b7fe;

    box-shadow:
        0 0 0 4px rgba(13, 110, 253, .10);
}


/* Help */

.mq-result-fullwidth .mq-copy-help {
    margin-top: 10px;

    color: #212529;

    font-size: 14px;
}

.mq-result-fullwidth .mq-copy-help i {
    margin-right: 5px;

    color: #fd7e14;
}


/* Mobile */

@media (max-width: 650px) {

    .mq-result-fullwidth {
        padding: 18px;
    }

    .mq-result-fullwidth .mq-code-output {
        min-height: 300px;
        font-size: 12px;
    }

}

.recent-post-generator {
    max-width: 900px;
}


/* ---------------------------------------------------------
   ICON
---------------------------------------------------------- */

.recent-post-generator .barcode-icon {
    background: linear-gradient(
        135deg,
        #0d6efd,
        #4f8dfd
    );
}


/* ---------------------------------------------------------
   COLOUR INPUT
---------------------------------------------------------- */

.recent-color-row {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 12px 14px;

    border: 1px solid var(--bc-border);
    border-radius: 10px;

    background: var(--bc-light);
}

.recent-color-row input[type="color"] {

    width: 60px;
    height: 42px;

    padding: 3px;

    border: 1px solid var(--bc-input-border);
    border-radius: 8px;

    background: #fff;

    cursor: pointer;
}

.recent-color-row span {

    color: var(--bc-text);

    font-size: 14px;
    line-height: 1.5;
}


/* ---------------------------------------------------------
   RADIO OPTIONS
---------------------------------------------------------- */

.recent-post-generator .input-format-option {

    margin-bottom: 10px;
}

.recent-post-generator .input-format-option:last-child {
    margin-bottom: 0;
}


/* ---------------------------------------------------------
   RESULT ANIMATION
---------------------------------------------------------- */

.recent-post-generator .mq-result-fullwidth {

    animation: recentResultIn .35s ease;
}

@keyframes recentResultIn {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


/* ---------------------------------------------------------
   SUCCESS ICON
---------------------------------------------------------- */

.recent-post-generator
.mq-result-fullwidth
.mq-result-header > i {

    font-size: 23px;
}


/* ---------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */

@media (max-width: 650px) {

    .recent-color-row {

        align-items: flex-start;
        flex-direction: column;

    }

    .recent-color-row input[type="color"] {

        width: 100%;
        height: 45px;

    }

}