/* =========================================================
   143TOOL - QR Code Generator Styles
   Version: 1.0.0
   ========================================================= */

.qr-card {
    padding: 24px;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    align-items: start;
}

/* ---------- LEFT: CONTROLS ---------- */
.qr-controls {
    min-width: 0;
}

/* Type tabs */
.qr-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.qr-type {
    padding: 10px 6px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .18s ease;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-type:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.qr-type.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 4px 12px rgba(233, 30, 99, .22);
}

/* Panels */
.qr-panels {
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.qr-panel {
    display: none;
}

.qr-panel.active {
    display: block;
    animation: qrFade .2s ease;
}

@keyframes qrFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.qr-panel label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text);
}

.qr-panel input[type="text"],
.qr-panel input[type="url"],
.qr-panel input[type="email"],
.qr-panel input[type="tel"],
.qr-panel input[type="number"],
.qr-panel textarea,
.qr-panel select {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--body-bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.qr-panel input:focus,
.qr-panel textarea:focus,
.qr-panel select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.qr-panel textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}

.qr-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.qr-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Appearance section */
.qr-appearance {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    margin-bottom: 14px;
    overflow: hidden;
}

.qr-appearance-head {
    border-bottom: 1px solid var(--border);
}

.qr-collapse-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease;
}

.qr-collapse-btn:hover {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.qr-chevron {
    color: var(--text-muted);
    font-size: 10px;
    transition: transform .2s ease;
}

.qr-collapse-btn[aria-expanded="false"] .qr-chevron {
    transform: rotate(-90deg);
}

.qr-appearance-body {
    padding: 16px;
}

.qr-appearance-body label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text);
}

.qr-appearance-body label strong {
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.qr-appearance-body select {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--body-bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

/* Range slider */
.qr-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 999px;
    outline: none;
    margin-top: 6px;
}

.qr-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    cursor: pointer;
    border: 3px solid var(--surface);
    box-shadow: 0 2px 6px rgba(233, 30, 99, .3);
}

.qr-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    cursor: pointer;
    border: 3px solid var(--surface);
}

/* Color inputs */
.qr-color-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qr-color-row input[type="color"] {
    width: 44px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--body-bg);
    cursor: pointer;
}

.qr-hex-input {
    flex: 1;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--body-bg);
    color: var(--text);
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-transform: uppercase;
}

/* Checkbox inline */
.qr-checkbox-inline {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

.qr-checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.qr-checkbox-inline input:disabled + span {
    opacity: .5;
}

/* Warning */
.qr-warn {
    padding: 12px 14px;
    background: color-mix(in srgb, var(--warning, #f59e0b) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 30%, var(--border));
    border-radius: var(--radius-sm);
    color: #b45309;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}

/* Actions */
.qr-actions {
    display: flex;
    gap: 10px;
}

.qr-generate-btn {
    width: 100%;
    min-height: 50px;
    font-size: 15px;
    font-weight: 800;
}

/* ---------- RIGHT: PREVIEW ---------- */
.qr-preview {
    position: sticky;
    top: 20px;
    padding: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.qr-preview-inner {
    width: 100%;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 16px;
    box-sizing: border-box;
    border: 2px dashed var(--border);
    overflow: hidden;
}

.qr-preview-inner img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.qr-preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.qr-preview-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
    opacity: .5;
}

.qr-preview-placeholder p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

/* Download buttons */
.qr-downloads {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.qr-dl-btn {
    padding: 10px 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}

.qr-dl-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.qr-dl-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* Meta info */
.qr-meta {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.qr-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
}

.qr-meta-label {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    font-size: 11px;
    flex-shrink: 0;
}

.qr-meta-value {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600;
    word-break: break-all;
    text-align: right;
    font-size: 11px;
    max-width: 65%;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .qr-card {
        grid-template-columns: 1fr;
    }
    .qr-preview {
        position: static;
        order: -1;
    }
    .qr-preview-inner {
        min-height: 200px;
    }
}

@media (max-width: 620px) {
    .qr-card {
        padding: 16px;
    }
    .qr-types {
        grid-template-columns: repeat(2, 1fr);
    }
    .qr-row-2 {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .qr-downloads {
        grid-template-columns: 1fr;
    }
    .qr-preview-inner {
        min-height: 180px;
        padding: 12px;
    }
}
/* =========================================================
   SEO ARTICLE / ADSENSE CONTENT
   ========================================================= */

.tool-article {
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 30px 0;
    border-top: 1px solid var(--border);
}

.tool-article h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 36px 0 14px;
    line-height: 1.3;
    letter-spacing: -.4px;
}

.tool-article h2:first-child {
    margin-top: 0;
}

.tool-article h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 10px;
    line-height: 1.4;
}

.tool-article p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.tool-article ul,
.tool-article ol {
    padding-left: 22px;
    margin: 0 0 18px;
}

.tool-article li {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.tool-article strong {
    color: var(--text);
    font-weight: 700;
}

.tool-article a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color .15s ease;
}

.tool-article a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 620px) {
    .tool-article {
        padding: 20px 0;
        margin: 40px auto 20px;
    }
    .tool-article h2 {
        font-size: 20px;
        margin: 28px 0 12px;
    }
    .tool-article h3 {
        font-size: 16px;
        margin: 20px 0 8px;
    }
    .tool-article p,
    .tool-article li {
        font-size: 15px;
        line-height: 1.7;
    }
}