/* QR Code Generator — tool-specific styles */
/* Shared tokens and base UI come from ../common.css */

/* ── Mode Switcher ─────────────────────────────────────────────────────── */
.mode-switcher {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin: 0 1rem 1rem;
}

.mode-btn {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.mode-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.mode-btn:not(.active):hover {
    background: rgba(255,255,255,0.6);
    color: var(--text);
}

/* ── Input Panels ──────────────────────────────────────────────────────── */
.input-panel {
    margin: 0 1rem 1rem;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.qr-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.qr-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.12);
}

.text-input,
.select-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.text-input:focus,
.select-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.12);
}

.field-group {
    margin-bottom: 0.75rem;
}

.field-group:last-child {
    margin-bottom: 0;
}

/* ── Warning Banners ───────────────────────────────────────────────────── */
.warning-banner {
    margin: 0 1rem 0.75rem;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.875rem;
}

/* ── Main Workspace ────────────────────────────────────────────────────── */
.qr-workspace {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    padding: 0 1rem 1.5rem;
    align-items: start;
}

/* ── Preview Panel ─────────────────────────────────────────────────────── */
.preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.preview-container {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.preview-placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.placeholder-icon {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 0.75rem;
    opacity: 0.25;
}

.preview-placeholder p {
    font-size: 0.9rem;
    margin: 0;
}

#qr-preview {
    max-width: 100%;
    max-height: 100%;
    display: none;
    border-radius: 4px;
}

#qr-preview.visible {
    display: block;
}

.download-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 360px;
}

.download-row .btn {
    flex: 1;
    justify-content: center;
    min-width: 130px;
}

/* ── Controls Panel ────────────────────────────────────────────────────── */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}

.controls-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin: 0 0 0.75rem;
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 0.75rem;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

/* Color Pickers */
.color-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="color"] {
    width: 40px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    background: var(--surface);
    flex-shrink: 0;
}

.hex-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: monospace;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
}

.hex-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.12);
}

/* Slider */
.slider-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

#size-slider {
    flex: 1;
    accent-color: var(--primary);
    cursor: pointer;
}

.size-display {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 55px;
    text-align: right;
}

.reset-btn {
    width: 100%;
    justify-content: center;
}

/* ── How To Section ────────────────────────────────────────────────────── */
.how-to-section {
    padding: 1.5rem 1rem 2rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.how-to-section h2 {
    font-size: 1.25rem;
    color: var(--primary);
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.how-to-section h3 {
    font-size: 1rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--text);
}

.how-to-list {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.7;
}

.how-to-list li {
    margin-bottom: 0.5rem;
}

.how-to-list strong {
    color: var(--text);
}

.how-to-note {
    background: #f0f6ff;
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0 0 1rem;
}

.template-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.template-list li {
    font-size: 0.9rem;
    color: var(--text-light);
    padding-left: 1.25rem;
    position: relative;
}

.template-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.template-list strong {
    color: var(--text);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .qr-workspace {
        grid-template-columns: 1fr;
        padding: 0 0.75rem 1.5rem;
    }

    .preview-container {
        max-width: 280px;
    }

    .mode-switcher {
        margin: 0 0.75rem 1rem;
    }

    .input-panel {
        margin: 0 0.75rem 1rem;
    }

    .warning-banner {
        margin: 0 0.75rem 0.75rem;
    }

    .controls-panel {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .mode-btn {
        font-size: 0.78rem;
        padding: 7px 6px;
    }

    .download-row {
        flex-direction: column;
    }
}
