/* High QR Code Generator Styles - Cleaned & Optimized */
:root {
    --hqrc-primary: #007bff;
    --hqrc-primary-hover: #0056b3;
    --hqrc-bg: #ffffff;
    --hqrc-text: #333333;
    --hqrc-border: #e2e8f0;
    --hqrc-input-bg: #f8fafc;
    --hqrc-sidebar-bg: #f1f5f9;
    --hqrc-radius: 8px;
    --hqrc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Wrapper to isolate styles */
.hqrc-wrapper {
    display: flex;
    flex-wrap: wrap;
    background: var(--hqrc-bg);
    border: 1px solid var(--hqrc-border);
    border-radius: var(--hqrc-radius);
    box-shadow: var(--hqrc-shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--hqrc-text);
    max-width: 1200px;
    margin: 20px auto;
    overflow: hidden;
    line-height: 1.5;
    box-sizing: border-box;
}

.hqrc-wrapper *, .hqrc-wrapper *::before, .hqrc-wrapper *::after {
    box-sizing: border-box;
}

/* Sidebar (Tabs) */
.hqrc-sidebar {
    width: 250px;
    background: var(--hqrc-sidebar-bg);
    border-right: 1px solid var(--hqrc-border);
    flex-shrink: 0;
}

.hqrc-tab-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
}

.hqrc-tab-btn:hover {
    background: rgba(255,255,255,0.5);
    color: var(--hqrc-primary);
}

.hqrc-tab-btn.active {
    background: var(--hqrc-bg);
    color: var(--hqrc-primary);
    border-left: 3px solid var(--hqrc-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.hqrc-tab-icon {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

/* Main Content Area */
.hqrc-main {
    flex: 1;
    padding: 30px;
    min-width: 300px;
}

.hqrc-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e293b;
    border-bottom: 1px solid var(--hqrc-border);
    padding-bottom: 10px;
}

.hqrc-form-group {
    margin-bottom: 20px !important;
    display: block !important;
    width: 100% !important;
    clear: both !important;
}

.hqrc-label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    color: #475569 !important;
    float: none !important;
    width: 100% !important;
}

/* Styled Select - Ultra High Specificity to Override Theme */
html body .hqrc-wrapper select.hqrc-select {
    display: block !important;
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 10px !important; /* Top/Bottom 0 explicitly set */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-right: 30px !important; /* Keep space for arrow */
    margin: 0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-family: inherit !important;
    color: #334155 !important;
    background-color: var(--hqrc-input-bg) !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2364748b%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 14px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important; /* Reset to normal line-height */
    cursor: pointer !important;
    text-align: left !important;
}

/* Ensure Focus State works with high specificity */
html body .hqrc-wrapper select.hqrc-select:focus {
    border-color: var(--hqrc-primary) !important;
    outline: none !important;
    background-color: #fff !important;
}

/* Force override any theme targeting specific data attributes on body */
body[data-fancy-form-rcs="1"] .hqrc-wrapper select.hqrc-select {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 36px !important;
}

/* Logo File Input Styling - High Specificity */
html body .hqrc-wrapper input[type="file"].hqrc-input {
    padding: 0 5px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    line-height: 34px !important;
    background: #fff !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
}

/* General Inputs */
html body .hqrc-wrapper input.hqrc-input, 
html body .hqrc-wrapper textarea.hqrc-textarea {
    padding: 0 10px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    background: var(--hqrc-input-bg) !important;
    box-shadow: none !important;
    text-align: left !important;
}

/* Force override theme padding */
html body .hqrc-wrapper select.hqrc-select,
html body .hqrc-wrapper input.hqrc-input {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.hqrc-wrapper textarea.hqrc-textarea {
    height: auto !important;
    min-height: 80px !important;
    padding: 10px !important;
    line-height: 1.4 !important;
}

/* Color Picker Inputs */
.hqrc-color-picker-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hqrc-wrapper input[type="color"].hqrc-color-input {
    width: 50px !important;
    height: 36px !important;
    padding: 0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    background: none !important;
    min-height: 36px !important;
}

/* Layout Grids */
.hqrc-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.hqrc-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

.hqrc-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    color: #555;
    padding: 0;
}

.hqrc-icon-btn:hover {
    border-color: var(--hqrc-primary);
    background: #eff6ff;
    color: var(--hqrc-primary);
}

/* Accordion */
.hqrc-accordion {
    margin-top: 30px;
    border-top: 1px solid var(--hqrc-border);
}

.hqrc-accordion-item {
    border-bottom: 1px solid var(--hqrc-border);
}

.hqrc-accordion-header {
    width: 100%;
    padding: 15px 0;
    background: none;
    border: none;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    color: var(--hqrc-text);
}

.hqrc-accordion-content {
    display: none;
    padding-bottom: 15px;
}

.hqrc-accordion-content.open {
    display: block;
}

/* Preview Sidebar */
.hqrc-preview-sidebar {
    width: 320px;
    background: #f8fafc;
    border-left: 1px solid var(--hqrc-border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.hqrc-canvas-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    width: 100%;
    overflow: hidden;
    text-align: center;
}

/* QR Code Image Constraint */
.hqrc-canvas-container canvas,
.hqrc-canvas-container svg {
    width: 100% !important;
    height: auto !important;
    max-width: 250px !important;
    max-height: 250px !important;
    object-fit: contain;
    aspect-ratio: 1/1;
    display: block;
    margin: 0 auto;
}

.hqrc-download-options {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.hqrc-btn {
    padding: 8px 4px;
    border: 1px solid var(--hqrc-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--hqrc-text);
    font-size: 13px;
    height: auto;
}

.hqrc-btn:hover {
    background: var(--hqrc-primary);
    color: #fff;
    border-color: var(--hqrc-primary);
}

.hqrc-btn i {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .hqrc-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--hqrc-border);
        overflow-x: auto;
        display: flex;
    }
    .hqrc-tab-btn {
        width: auto;
        white-space: nowrap;
        border-bottom: 3px solid transparent;
        border-left: none;
    }
    .hqrc-tab-btn.active {
        border-bottom-color: var(--hqrc-primary);
        border-left: none;
    }
    .hqrc-preview-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--hqrc-border);
    }
}

@media (max-width: 600px) {
    .hqrc-style-grid {
        grid-template-columns: 1fr;
    }
    .hqrc-color-picker-wrapper {
        flex-wrap: wrap;
    }
}
