body {
    background: #f7faff;
    font-family: 'Inter', Arial, sans-serif;
    margin: 2rem;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Two-column layout */
.qr-main-content {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    align-items: flex-start;
}

.qr-options-column {
    flex: 1;
    min-width: 400px;
    max-width: 600px;
}

.qr-preview-column {
    flex: 0 0 350px;
    margin-left: auto;
    margin-right: auto;
    position: sticky;
    top: 2rem;
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

#preview-text {
    text-align: center;
    color: #888;
    font-size: 1rem;
    margin-top: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.logo-upload-container {
    position: relative;
}

.remove-logo {
    position: absolute;
    top: 25%;
    right: 5px;
    background: #ff4d4d;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
}

.hidden {
    display: none;
}



.qr-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    justify-content: center;
}

.qr-color-picker {
    width: 50px;
    height: 32px;
    border: 1.5px solid #e3e8f0;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, transform 0.1s;
}

.qr-color-picker:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
}

.qr-color-picker:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qr-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 6px;
}

.qr-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.qr-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.checkbox-container {
    display: flex;
    align-items: center;
}

.qr-container {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0, 32, 128, 0.08);
    padding: 2rem;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a2340;
    margin-bottom: 24px;
    text-align: center;
}

.qr-input {
    display: flex;
    width: 100%;
    font-size: 1.1rem;
    padding: 8px 12px;
    box-sizing: border-box;
    border: 1.5px solid #e3e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.2s;
}

.qr-input:focus {
    border-color: #3b82f6;
}



.qr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 16px;
}

.qr-checkbox {
    accent-color: #0584d9;
    width: 22px;
    height: 22px;
}

.qr-label {
    display: flex;
    align-items: center;
    font-size: 1rem;
    color: #1a2340;
    font-weight: 500;
    margin-right: 8px;
}

.qr-select {
    font-size: 1rem;
    padding: 8px 12px;
    border: 1.5px solid #e3e8f0;
    border-radius: 10px;
    background: #f7faff;
    color: #1a2340;
    outline: none;
    transition: border-color 0.2s;
}

.qr-select option {
    font-size: 1rem;
    color: #1a2340;
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.qr-select option:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.qr-select option:checked {
    background: #2563eb;
    color: #fff;
}

.qr-select:focus {
    border-color: #3b82f6;
}

.qr-type-container,
.qr-input-container,
.customize-container,
.qr-preview-container {
    border: solid 1.5px #e3e8f0;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 18px;
}



.qr-type-selection {
    display: flex;
    width: 100%;
    gap: 18px;
}

.qr-type-selection button {
    font-size: 1rem;
}

.qr-type-option {
    font-size: 1.1rem;
    box-sizing: border-box;
    color: #1a2340;
    border: none;
    background-color: #dfdfe4;
    border-radius: 12px;
    padding: 5px 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.qr-type-label,
.qr-input-label,
.preview-download-header,
.qr-customize-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a2340;
    padding-bottom: 10px;
    border-bottom: 1px solid #dfdfe4;
    margin-bottom: 1rem;
    margin-top: 0;
}

.preview-download-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-download-header img {
    cursor: pointer;
    transition: transform 0.2s;
}

.preview-download-header img:hover {
    transform: scale(1.1);
}

.preview-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-data label {
    display: block;
    font-size: 1rem;
    color: #1a2340;
    font-weight: 500;
}

.customize-container label {
    font-size: 1rem;
    color: #1a2340;
    font-weight: 500;
    margin-right: 8px;
}


.qr-type-option.selected {
    background: #2563eb;
    color: #fff;
}





.qr-preview-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a2340;
    margin-bottom: 10px;
}

.qr-preview {
    width: 220px;
    height: 220px;
    border-radius: 16px;
    position: relative;
    margin: 1rem auto;
    margin-bottom: 2rem;
}

#qr-canvas {
    margin-top: 1rem;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qr-canvas canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

/* Advanced Customization Styles */
.customize-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.section-label {
    font-weight: 600;
    color: #1a2340;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: block;
}

.size-slider, .margin-slider {
    width: 80px;
}

.size-value, .margin-value {
    font-size: 0.75rem;
    color: #64748b;
    min-width: 30px;
}

/* Dot Style Grid */
.dot-style-grid,
.corner-dot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.corner-square-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.dot-option,
.corner-option,
.corner-dot-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dot-option.selected,
.dot-option:hover,
.corner-option.selected,
.corner-option:hover,
.corner-dot-option.selected,
.corner-dot-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.dot-option span,
.corner-option span,
.corner-dot-option span {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.dot-option.selected span,
.corner-option.selected span,
.corner-dot-option.selected span {
    color: #3b82f6;
}

/* Dot Previews */
.dot-preview {
    width: 24px;
    height: 24px;
    background: #1a2340;
    position: relative;
}

.square-dots {
    /* Default square appearance - no additional styling needed */
    border-radius: 0;
}

.rounded-dots {
    border-radius: 6px;
}

.circle-dots {
    border-radius: 50%;
}

.classy-dots {
    border-radius: 6px 6px 0 0;
}

.classy-rounded-dots {
    border-radius: 6px 6px 0 0;
    position: relative;
}

.classy-rounded-dots::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #1a2340;
    border-radius: 50%;
}

.extra-rounded-dots {
    border-radius: 8px;
}

.none-dots {
    background: none;
    border: 2px dashed #e2e8f0;
}



/* Image Controls */
.image-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.image-setting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.image-setting label {
    min-width: 80px;
    font-size: 0.875rem;
    color: #64748b;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.preview-tab {
    display: none;
    position: fixed;
    bottom: 20%;
    right: -15px;
    background: #2563eb;
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 1000;
    transform: rotate(-90deg);
}

.preview-tab:hover {
    background: #1d4ed8;
    transform: rotate(-90deg) scale(1.05);
}

.preview-tab.active {
    background: #1d4ed8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .qr-main-content {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .qr-options-column {
        min-width: unset;
        max-width: unset;
    }
    
    .qr-preview-column.active {
        position: fixed;
        right: -100%;
        top: 0;
        width: 90%;
        max-width: 400px;
        height: 100vh;
        background: #f8fafc;
        border-radius: 16px 0 0 16px;
        padding: 1.5rem;
        border: 1px solid #e2e8f0;
        border-right: none;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        z-index: 999;
        overflow-y: auto; 
        right: 0;
    }
    
    .qr-preview-column {
        flex: unset;
        width: 80%;
        max-width: 400px;

    }
    
    .preview-tab {
        display: block;
    }
    
    .preview-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out;
    }
    
    .preview-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .preview-close-btn {
        display: flex !important;
    }
    
    body {
        margin: 1rem;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .dot-style-grid,
    .corner-square-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .qr-container {
        padding: 1.5rem;
    }
    
    .qr-main-content {
        gap: 1rem;
    }

    .qr-type-selection {
        display: grid;
        align-items: center;
        justify-items: center;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .qr-type-selection button {
        display: flex;
        justify-content: space-around;
        min-width: 100px;
        max-width: 100px;
    }

    .color-picker-container {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .color-picker-container label {
        align-self: flex-start;
    }
    
    .color-picker-container > div {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem;
        width: 100%;
    }
}

/* New Color Section Styles */
.color-section {
    margin-top: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.color-type-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.color-type-radios {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #64748b;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-picker-container label {
    font-size: 0.875rem;
    color: #64748b;
    min-width: 80px;
}

.corner-square-options,
.corner-dot-options {
    margin-bottom: 0.5rem;
}