/* * ========================================================================
 * Styles for ADVANCED QR Code (Layout v3.2)
 * File: mt-advance-qr-style.css
 * (This styles ONLY [mt_advance_qr_generator] and
 * is integrated with global mt-style.css variables)
 * ========================================================================
 */

/* Header styles for the card */
.mt-adv-qr-card-header {
    padding: 18px; /* Match global padding */
    border-bottom: 1px solid var(--mt-border-color);
}
.mt-adv-qr-card-header h3 {
    margin-top: 0;
    margin-bottom: 8px;
}
.mt-adv-qr-card-header p.muted {
    margin-bottom: 0;
    font-size: 14px;
}

/* Add padding to the grid inside the card */
.mt-adv-qr-card .mt-grid {
    padding: 18px;
    align-items: start; /* Align columns to the top */
}

/* --- Advanced Options Styling --- */

.mt-adv-qr-options-group {
    background: var(--mt-bg-secondary);
    border: 1px solid var(--mt-border-color);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}
.mt-adv-qr-options-group h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--mt-text-primary);
    font-size: 15px;
}

/* UPDATED: Grid for 3 options */
.mt-adv-qr-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--mt-gap);
    margin-bottom: 15px;
}

/* Wrapper for color picker + text value */
.mt-adv-color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--mt-bg-primary);
    border: 1px solid var(--mt-input-border-color);
    border-radius: 10px;
    padding: 4px 8px;
    height: 40px; /* Match global input height */
}
.mt-adv-color-input-wrapper input[type="color"] {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    /* Remove default styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.mt-adv-color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 8px;
}
.mt-adv-color-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--mt-border-color);
    border-radius: 8px;
}
.mt-adv-color-input-wrapper input[type="color"]::-moz-color-swatch {
    border: 1px solid var(--mt-border-color);
    border-radius: 8px;
}
.mt-adv-color-input-wrapper span {
    font-family: monospace;
    font-size: 13px;
    color: var(--mt-text-secondary);
}

/* Wrapper for logo upload button + remove button */
.mt-adv-qr-logo-upload-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

/* Label styled as a button (using global class) */
.mt-adv-btn-file-label {
    width: 100%;
    /* .mt-btn styles are applied automatically */
}

/* Remove Logo Button (new class) */
.mt-adv-btn-remove-logo {
    /* Base styles from .mt-btn */
    width: auto;
    background: var(--mt-btn-default-bg);
    color: var(--mt-btn-default-text);
    border: 1px solid var(--mt-border-color);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: background-color .2s, border-color .2s, color .2s;
    text-align: center;
    display: inline-block;
    
    /* Specific styles */
    background: var(--mt-btn-stop-bg);
    color: var(--mt-text-inverted);
    border-color: var(--mt-btn-stop-bg);
}
.mt-adv-btn-remove-logo:hover {
    background: var(--mt-btn-stop-hover-bg);
    border-color: var(--mt-btn-stop-hover-bg);
}
.mt-adv-btn-remove-logo:disabled {
    background: var(--mt-bg-tertiary);
    border-color: var(--mt-border-color);
    color: var(--mt-text-muted);
    opacity: 0.6;
    cursor: not-allowed;
}

.mt-adv-qr-logo-filename {
    display: block;
    font-size: 12px;
    color: var(--mt-text-muted);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- QR Code Output Column --- */

.mt-adv-qr-output-column {
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: flex-start; 
    gap: var(--mt-gap);
    /* Align with the top of the input area */
    margin-top: 29px; /* (label + margin) */
}

.mt-adv-qr-output {
    padding: 12px;
    background: var(--mt-bg-primary);
    border: 1px solid var(--mt-border-color);
    border-radius: 10px;
    line-height: 0; /* Fix extra space under canvas */
    box-shadow: 0 2px 4px var(--mt-shadow-color);
    
    /* Fixed size for 256px + padding */
    width: 282px; 
    height: 282px;
    max-width: 100%; /* Responsive */
    
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box; 
}

/* Make canvas/img responsive inside the box */
.mt-adv-qr-output canvas,
.mt-adv-qr-output img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    border-radius: 5px; /* Match inner radius */
}

.mt-adv-qr-placeholder {
    color: var(--mt-text-muted);
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
    padding: 20px;
}

/* --- Responsive Adjustments --- */

@media(max-width: 768px) {
    /* Stack options grid on tablet */
    .mt-adv-qr-options-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 480px) {
    /* Stack output column on mobile */
    .mt-adv-qr-output-column {
        margin-top: 0; /* Remove top margin */
        /* Reverse order so QR code appears before download button */
        flex-direction: column-reverse;
    }

    /* Make QR output box full-width but keep 1:1 ratio */
    .mt-adv-qr-output {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1; 
    }
}

