/* ===== GLOBAL & WORKSPACE ===== */
.qr-container {
    max-width: 1200px;
    margin: auto;
    padding: 20px 15px; /* Smaller padding for mobile */
}

.qr-workspace {
    display: flex;
    flex-direction: column; /* Stacked by default for mobile */
    gap: 25px;
}

/* ===== CONFIG CARD ===== */
.config-section {
    background: var(--tile-bg);
    border: 1px solid var(--tile-border);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ===== TABS (Scrollable & Responsive) ===== */
.qr-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 25px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.qr-tabs::-webkit-scrollbar { display: none; }

.qr-tab {
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--tile-border);
    background: var(--bg);
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.qr-tab.active {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: white;
    border: none;
}

/* ===== INPUTS & LABELS (Spacing Fixed) ===== */
.input-group {
    margin-bottom: 25px;
    width: 100%;
}

.input-group label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 14px; /* Increased space between name and field */
    color: var(--text);
}

.qr-input {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--tile-border);
    background: var(--bg);
    color: var(--text);
    font-size: 16px; /* Prevents auto-zoom on iOS */
    outline: none;
    box-sizing: border-box; /* Crucial for mobile width */
}

/* ===== PREVIEW (Responsive) ===== */
.preview-sidebar {
    width: 100%;
    order: 2; /* Form first, then preview */
}

.qr-preview-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.qr-preview-card img {
    max-width: 240px;
    width: 100%;
    height: auto;
}

/* ===== PC VIEW (Upgrades to Grid) ===== */
@media (min-width: 900px) {
    .qr-container { padding: 50px 20px; }
    .qr-workspace {
        display: grid;
        grid-template-columns: 1fr 380px;
        flex-direction: row;
        gap: 40px;
    }
    .preview-sidebar {
        position: sticky;
        top: 100px;
        order: 2;
    }
    .config-section { padding: 35px; }
}

/* ===== DARK MODE FIXES ===== */
body.dark .qr-input, 
body.dark .qr-tab {
    background: #111827;
    border-color: #1f2937;
    color: #f3f4f6;
}
