/* BCKLG tool — aligns with site typography and colors */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #fff;
    color: #1a1a1a;
    min-height: 100vh;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

main.bcklg-tool-main {
    max-width: none !important;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    width: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Layout */
.panels-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Panel Base */
.panel {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.panel-title {
    font-size: 1.15rem;
    color: #1a1a1a;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Mode Toggle Buttons */
.mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mode-btn {
    background: #fff;
    color: #1a1a1a;
    border: 2px solid #e5e5e5;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
  font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.mode-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
    color: #1a1a1a;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Hidden Elements */
.hidden {
  display: none !important;
}

/* Data Fields */
.data-field {
    margin-bottom: 16px;
}

.data-field.hidden {
    display: none;
}

/* Character Counter */
.counter {
    font-size: 11px;
    font-weight: 400;
    color: #000;
    margin-left: 8px;
    text-transform: none;
    letter-spacing: normal;
}

/* Styling Options */
.styling-options {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #f8f8f8;
}

.styling-options.hidden {
    display: none;
}

.color-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 38px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
}

.color-input-group input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
}

/* Color Inputs */
.color-inputs-container {
  display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.color-input {
    flex: 1;
    min-width: 140px;
}

.color-input .sub-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: normal;
}

.color-input-row {
  display: flex;
  align-items: center;
    gap: 8px;
}

.color-input-row input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: #fff;
}

.color-input-row input[type="color"]:hover {
    border-color: #2563eb;
}

.color-input-row input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Monaco', 'Courier New', monospace;
    text-transform: uppercase;
    width: auto;
}

.color-input-row.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Background Toggle */
.bg-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bg-toggle-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
  cursor: pointer;
    accent-color: #2563eb;
}

/* Logo Container */
.logo-container {
    margin-top: 16px;
}

.logo-input-group {
  display: flex;
    gap: 12px;
  align-items: center;
    flex-wrap: wrap;
}

.logo-input-group input[type="file"] {
    flex: 1;
    min-width: 200px;
}

.clear-btn {
    background: #fc8181;
  color: white;
  border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
  font-weight: 600;
  cursor: pointer;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: #f56565;
}

/* Logo Controls */
#logoControls,
#batchLogoControls,
#serialLogoControls {
    margin-top: 16px;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.logo-size-container {
    margin-bottom: 12px;
}

.logo-size-container label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: normal;
}

.logo-size-container input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e5e5;
    outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.logo-size-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
    width: 16px;
    height: 16px;
  border-radius: 50%;
    background: #2563eb;
  cursor: pointer;
}

.logo-size-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
  border-radius: 50%;
    background: #2563eb;
  cursor: pointer;
  border: none;
}

.logo-style-option {
  display: flex;
  align-items: center;
    gap: 8px;
}

.logo-style-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
  cursor: pointer;
    accent-color: #2563eb;
}

.logo-style-option label {
    font-size: 13px;
    color: #666;
  cursor: pointer;
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: normal;
}

/* Primary Button */
.primary-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
    width: 100%;
    margin-top: 16px;
}

.primary-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Secondary Button */
.btn-secondary {
  background: #fff;
    color: #1a1a1a;
    border: 2px solid #e5e5e5;
    padding: 12px 16px;
  border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: #2563eb;
    color: #2563eb;
}

/* Preview Panel */
.panel-preview {
    min-height: 400px;
}

.no-preview,
.batch-instructions-preview,
.serial-instructions-preview {
  display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.preview-placeholder {
    text-align: center;
    color: #a0aec0;
    padding: 40px 20px;
}

.preview-placeholder svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.preview-placeholder p {
    font-size: 14px;
    margin-bottom: 16px;
    color: #666;
}

.instruction-list {
    text-align: left;
    margin: 0 auto 16px;
    padding-left: 24px;
    max-width: 400px;
    color: #666;
    font-size: 13px;
    line-height: 1.8;
}

.instruction-list li {
    margin-bottom: 4px;
}

.instruction-tip {
    font-size: 12px;
    color: #2563eb;
  font-weight: 500;
}

/* QR Preview Container */
.qr-preview-container {
    text-align: center;
}

#qrcode {
  display: flex;
  align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    min-height: 300px;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e5e5e5;
}

#qrcode.transparent {
    background: repeating-conic-gradient(#e5e5e5 0% 25%, white 0% 50%) 50% / 16px 16px;
}

#qrcode svg,
#qrcode canvas,
#qrcode img {
  max-width: 100%;
  height: auto;
}

/* Preview Data Section */
.preview-data {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.preview-data h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.preview-text {
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #666;
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
}

/* Download Options */
.download-options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.download-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    text-align: center;
}

.download-buttons {
  display: flex;
    gap: 12px;
  justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
    flex: 1;
    min-width: 140px;
}

.download-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.download-btn-svg {
    background: #fff;
    color: #2563eb;
    border: 2px solid #2563eb;
    box-shadow: none;
}

.download-btn-svg:hover {
    background: #f8f8f8;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

/* Batch Mode Section */
.batch-mode-section,
.serial-mode-section {
    display: none;
}

.batch-mode-section.active,
.serial-mode-section.active {
    display: block;
}

.single-mode-section {
    display: none;
}

.single-mode-section.active {
    display: block;
}

.batch-instructions,
.serial-instructions {
    background: #f8f8f8;
  border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
}

.batch-instructions h3,
.serial-instructions h3 {
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-weight: 700;
}

.batch-instructions p,
.serial-instructions p {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.template-link {
    color: #2563eb;
    font-weight: 600;
  text-decoration: none;
}

.template-link:hover {
  text-decoration: underline;
}

/* CSV Columns Info */
.csv-columns-info {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
}

.csv-columns-info h4 {
  font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 700;
}

.columns-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.columns-list li {
  font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    padding-left: 12px;
  position: relative;
}

.columns-list li::before {
    content: "•";
  position: absolute;
  left: 0;
    color: #2563eb;
}

.columns-list li strong {
    color: #1a1a1a;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    background: #fff;
    padding: 1px 4px;
    border-radius: 3px;
}

.columns-note {
    font-size: 12px;
    color: #2563eb;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 0;
    padding-top: 8px;
    border-top: 1px solid #e5e5e5;
}

/* Color Section in Batch/Serial Modes */
.color-section {
  margin-bottom: 20px;
}

.color-section .color-input-row {
    margin-bottom: 12px;
}

.color-section .color-input-row:last-child {
    margin-bottom: 0;
}

.color-section label {
    min-width: 120px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
    gap: 8px;
    min-width: 120px;
}

.toggle-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
  cursor: pointer;
    accent-color: #2563eb;
}

.color-text {
    width: 80px !important;
    flex: 0 0 auto !important;
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
    height: 8px;
    background: #e5e5e5;
    border-radius: 4px;
  overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
    background: #2563eb;
  border-radius: 4px;
  transition: width 0.3s ease;
}

#progressStatus,
#serialProgressStatus {
    font-size: 13px;
    color: #666;
  text-align: center;
    font-weight: 500;
}

/* Batch Preview */
.batch-preview {
    margin-top: 20px;
}

.batch-preview h4 {
    font-size: 14px;
  font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.preview-container,
#serialPreviewContainer {
  display: flex;
  flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.qr-preview-item {
    text-align: center;
}

.qr-preview-item img,
.qr-preview-item svg {
    width: 100px;
    height: 100px;
    border: 1px solid #e5e5e5;
  border-radius: 8px;
    background: #fff;
}

.qr-preview-label {
    font-size: 11px;
    color: #666;
  margin-top: 8px;
    max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Preview panel visibility control */
#singlePreviewPanel,
#batchPreviewPanel,
#serialPreviewPanel {
  display: none;
}

#singlePreviewPanel.visible,
#batchPreviewPanel.visible,
#serialPreviewPanel.visible {
    display: block;
}

/* QR Code Outline Preview */
.qr-outline-preview {
  display: flex;
    justify-content: center;
  align-items: center;
    min-height: 400px;
    background: #f8f8f8;
  border-radius: 8px;
    padding: 40px;
}

.qr-outline {
    position: relative;
    border: 3px dashed #e5e5e5;
    background: #fff;
  display: flex;
    justify-content: center;
  align-items: center;
    transition: all 0.3s ease;
}

.qr-outline-model2 {
    /* Square shape for Model 2 */
}

.qr-outline-microqr {
    /* Small square for MicroQR */
}

.qr-outline-rmqr {
    /* Rectangular shape for rMQR */
}

.qr-outline-finder {
    position: absolute;
    width: 30%;
    height: 30%;
    border: 2px solid #2563eb;
    background: rgba(37, 99, 235, 0.12);
}

.qr-outline-finder.top-left {
    top: 5%;
    left: 5%;
}

.qr-outline-finder.top-right {
    top: 5%;
    right: 5%;
}

.qr-outline-finder.bottom-left {
    bottom: 5%;
    left: 5%;
}

.qr-outline-info {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.qr-outline-version {
  font-weight: 600;
    color: #2563eb;
    font-size: 16px;
    margin-bottom: 4px;
}

.qr-outline-dimensions {
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .panels-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    main.bcklg-tool-main {
        padding: 1.25rem 1rem 2rem;
    }

    .panel {
        padding: 16px;
    }
    
    .mode-toggle {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .color-inputs-container {
        flex-direction: column;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-btn {
        width: 100%;
    }
}