/* ===== QR Monkey Generator - Full Stylesheet ===== */

/* --- Reset & Container --- */
.qrm-container * {
    box-sizing: border-box;
}

.qrm-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Panels --- */
.qrm-panel-left {
    min-width: 0;
}

.qrm-panel-right {
    position: sticky;
    top: 40px;
    align-self: start;
}

/* ===== ACCORDION ===== */
.qrm-accordion {
    border: 1px solid #dce0e3;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 16px;
}

.qrm-accordion-item {
    border-bottom: 1px solid #dce0e3;
}

.qrm-accordion-item:last-child {
    border-bottom: none;
}

/* Header */
.qrm-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    background: #f7f8f9;
    color: #555;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.qrm-accordion-header:hover {
    background: #eff1f3;
}

.qrm-accordion-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qrm-accordion-icon {
    font-size: 18px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.qrm-toggle-icon {
    font-size: 18px;
    font-weight: 300;
    color: #aaa;
    width: 20px;
    text-align: center;
}

/* Active header: teal/green like QRCode Monkey */
.qrm-accordion-item.qrm-active>.qrm-accordion-header {
    background: #0BB5E0;
    color: #fff;
}

.qrm-accordion-item.qrm-active .qrm-toggle-icon {
    color: #fff;
}

.qrm-accordion-item.qrm-active .qrm-accordion-icon {
    color: #fff;
}

/* Body */
.qrm-accordion-body {
    padding: 18px 20px;
    background: #edf1f4;
}

/* ===== FORM FIELDS ===== */
.qrm-field {
    margin-bottom: 12px;
}

.qrm-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

.qrm-field input[type="text"],
.qrm-field input[type="url"],
.qrm-field input[type="number"],
.qrm-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d4d8;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
}

.qrm-field input:focus,
.qrm-field select:focus {
    outline: none;
    border-color: #0BB5E0;
    box-shadow: 0 0 0 2px rgba(11, 181, 224, 0.15);
}

.qrm-field small {
    display: block;
    color: #999;
    margin-top: 4px;
    font-size: 12px;
}

/* Color row */
.qrm-color-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.qrm-color-field {
    flex: 1;
    min-width: 100px;
}

.qrm-color-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.qrm-color-field input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #d0d4d8;
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
    background: #fff;
}

.qrm-color-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #d0d4d8;
    border-radius: 4px;
    font-size: 13px;
}

/* Options row (quality + size) */
.qrm-options-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 0;
}

.qrm-options-row>div {
    flex: 1;
}

.qrm-options-row label {
    font-size: 12px;
    font-weight: 500;
    color: #777;
    margin-bottom: 4px;
    display: block;
}

.qrm-options-row select,
.qrm-options-row input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d0d4d8;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

/* ===== SHAPE GRID ===== */
.qrm-shape-section {
    margin-bottom: 18px;
}

.qrm-shape-section:last-child {
    margin-bottom: 0;
}

.qrm-shape-section strong {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.qrm-shape-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qrm-shape-option {
    display: inline-block;
    cursor: pointer;
    position: relative;
}

.qrm-shape-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.qrm-shape-option img {
    width: 52px;
    height: 52px;
    display: block;
    border: 2px solid #d0d4d8;
    border-radius: 3px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.qrm-shape-option:hover img {
    border-color: #8ec7e8;
}

.qrm-shape-option.selected img,
.qrm-shape-option input[type="radio"]:checked~img {
    border-color: #00a4fb;
    box-shadow: 0 0 0 2px #00a4fb;
}

/* ===== PREVIEW PANEL ===== */
.qrm-preview-container {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #dce0e3;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

#qrm-preview-img {
    max-width: 90%;
    max-height: 90%;
    display: block;
}

#qrm-preview-placeholder {
    color: #bbb;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

#qrm-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    color: #0BB5E0;
    font-size: 15px;
    z-index: 5;
}

/* ===== ACTION BUTTONS ===== */
.qrm-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.qrm-btn-green {
    flex: 1;
    padding: 12px 16px;
    background: #77b52c;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.qrm-btn-green:hover {
    background: #6aa325;
    color: #fff;
}

.qrm-btn-blue {
    flex: 1;
    padding: 12px 16px;
    background: #5dbce8;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.qrm-btn-blue:hover {
    background: #4aade0;
    color: #fff;
}

/* ===== ERROR MESSAGE ===== */
.qrm-error-message {
    color: #d63638;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    background: #fcf0f1;
    border-left: 3px solid #d63638;
    border-radius: 3px;
}

/* ===== LOGO UPLOAD TABS ===== */
.qrm-logo-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #d0d4d8;
}

.qrm-logo-tab {
    flex: 1;
    padding: 9px 12px;
    background: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.qrm-logo-tab:not(:last-child) {
    border-right: 1px solid #d0d4d8;
}

.qrm-logo-tab.active {
    background: #0BB5E0;
    color: #fff;
}

.qrm-logo-tab:hover:not(.active) {
    background: #f1f3f5;
}

/* Logo preview */
.qrm-logo-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #d0d4d8;
    border-radius: 4px;
}

.qrm-logo-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    object-fit: contain;
    border: 1px solid #eee;
}

.qrm-logo-remove {
    background: #d63638;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.qrm-logo-remove:hover {
    background: #b32d2e;
}

/* Logo uploading indicator */
.qrm-logo-uploading {
    padding: 10px;
    text-align: center;
    color: #0BB5E0;
    font-weight: 600;
    font-size: 13px;
}

/* File input styling */
#qrm-logo-file {
    width: 100%;
    padding: 8px;
    border: 1px dashed #b0b5ba;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

#qrm-logo-file:hover {
    border-color: #0BB5E0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .qrm-container {
        grid-template-columns: 1fr;
    }

    .qrm-panel-right {
        position: static;
    }
}