.ttb-qrgen-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    font-family: 'Segoe UI', sans-serif;
}

.ttb-qrgen-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
}

.ttb-qrgen-tab {
    padding: 10px 16px;
    border: 2px solid #007bff;
    border-radius: 8px;
    background-color: #f1f9ff;
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.ttb-qrgen-tab.active {
    background-color: #007bff;
    color: #fff;
}

.ttb-qrgen-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.ttb-qrgen-form label {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.ttb-qrgen-form input,
.ttb-qrgen-form select {
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.ttb-qrgen-preview {
    margin: 20px 0;
    text-align: center;
}

.ttb-qrgen-preview canvas {
    max-width: 100%;
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 10px;
    background-color: #f8f8f8;
}

.ttb-qrgen-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

.ttb-qrgen-actions button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ttb-qrgen-actions button:hover {
    background-color: #0056b3;
}

.ttb-qrgen-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.ttb-qrgen-slider input[type="range"] {
    width: 200px;
}

.ttb-qrgen-thumbnail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.ttb-qrgen-thumbnail {
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: border 0.2s ease;
}

.ttb-qrgen-thumbnail img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.ttb-qrgen-thumbnail.active {
    border-color: #007bff;
}

/* ==== Logo Upload & Color Pickers ==== */
.ttb-qrgen-logo-color-section {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ttb-qrgen-logo-color-section label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.ttb-qrgen-logo-color-section input[type="file"] {
    padding: 10px;
    border: 2px dashed #bbb;
    background-color: #fafafa;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.ttb-qrgen-logo-color-section input[type="file"]:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.ttb-qrgen-color-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.ttb-qrgen-color-row label {
    min-width: 150px;
    margin-bottom: 0;
}

/* Ensure native color input styling doesn't interfere with Pickr */
.ttb-qrgen-color-row input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

.ttb-qrgen-color-row input[type="color"]:hover {
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Pickr specific styles to ensure it aligns well */
.pcr-app {
    margin-left: auto;
}


#ttb-size-value {
    display: inline-block;
    width: 100px;
    text-align: center;
    font-weight: bold;
    color: #333;
}

/* ==== New Toggle Styles ==== */
.ttb-toggle-group {
    margin-bottom: 10px;
}

.ttb-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    user-select: none;
}

.ttb-toggle-header:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.ttb-toggle-header.active {
    background-color: #e6f2ff;
    border-color: #007bff;
    color: #007bff;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.ttb-toggle-header span {
    flex-grow: 1;
}

.ttb-toggle-arrow {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.ttb-toggle-header.active .ttb-toggle-arrow {
    transform: rotate(180deg);
}

.ttb-hidden-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ttb-toggle-content {
    border: 1px solid #ddd;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.03);
    /* NEW: Make this a flex container for vertical spacing */
    display: flex;
    flex-direction: column;
    gap: 10px; /* Spacing between its direct children */
}

/* Removed the problematic margin-top from general labels within toggle content */
.ttb-toggle-content label {
    /* Removed margin-top: 10px; and label:first-child rules */
    font-weight: 600; /* Retain original font weight */
    margin-bottom: 0; /* Ensure no extra margin */
    color: #333; /* Retain original color */
}

/* Adjustments for text position checkboxes within the toggle content */
.ttb-toggle-content div[style="margin-bottom: 5px;"] {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.ttb-toggle-content div[style="margin-bottom: 5px;"] label {
    margin-bottom: 0;
    font-weight: normal;
    display: flex;
    align-items: center;
}
.ttb-toggle-content div[style="margin-bottom: 5px;"] input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
    vertical-align: middle;
}
