/* WaveQR Frontend Styles - Moderne QR-Code-Generator UI */

/* === ROOT VARIABLES === */
:root {
    /* Theme Colors from Serializer Plugin */
    --waveqr-primary: #419073;
    --waveqr-primary-hover: #357a60; /* Darker shade of primary */
    --waveqr-secondary: #6c757d;
    --waveqr-success: #155724;
    --waveqr-warning: #856404;
    --waveqr-error: #721c24;
    
    /* Light Theme Background */
    --waveqr-bg-primary: #ffffff;
    --waveqr-bg-secondary: #f8f9fa;
    --waveqr-bg-tertiary: #e9ecef;
    
    /* Light Theme Text */
    --waveqr-text-primary: #2c3e50;
    --waveqr-text-secondary: #6c757d;
    --waveqr-text-muted: #838383;
    
    /* Borders & Shadows */
    --waveqr-border: #dee2e6;
    --waveqr-border-hover: #adb5bd;
    --waveqr-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --waveqr-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --waveqr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --waveqr-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --waveqr-space-xs: 0.25rem;
    --waveqr-space-sm: 0.5rem;
    --waveqr-space-md: 1rem;
    --waveqr-space-lg: 1.5rem;
    --waveqr-space-xl: 2rem;
    --waveqr-space-2xl: 3rem;
    
    /* Border Radius */
    --waveqr-radius-sm: 0.375rem;
    --waveqr-radius-md: 0.5rem;
    --waveqr-radius-lg: 0.75rem;
    --waveqr-radius-xl: 1rem;
    
    /* Transitions */
    --waveqr-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --waveqr-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === GRID LAYOUT === */
/* Grid Layout - Desktop first */
.waveqr-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* Sticky Preview auf Desktop */
.waveqr-preview {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* Mobile Layout - Spalten umkehren */
@media (max-width: 768px) {
    .waveqr-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Vorschau oben auf Mobile */
    .waveqr-preview {
        order: -1;
        position: static;
    }
    
    .waveqr-config {
        order: 1;
    }
}

/* === PANELS === */
.waveqr-panel {
    background: var(--waveqr-bg-primary);
    border: 1px solid var(--waveqr-border);
    border-radius: var(--waveqr-radius-lg);
    padding: var(--waveqr-space-xl);
}


.waveqr-panel h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--waveqr-text-primary);
    margin: 0 0 var(--waveqr-space-lg) 0;
    padding-bottom: var(--waveqr-space-md);
    border-bottom: 2px solid var(--waveqr-primary);
    position: relative;
}

.waveqr-panel h4::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--waveqr-primary);
    border-radius: 1px;
}

/* === FORM FIELDS === */
.waveqr-field {
    margin-bottom: var(--waveqr-space-lg);
}

.waveqr-field label:not(.waveqr-checkbox-label) {
    display: block;
    font-weight: 600;
    color: var(--waveqr-text-primary);
    margin-bottom: var(--waveqr-space-sm);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}



.waveqr-textarea,
.waveqr-select,
.waveqr-input {
    width: 100%;
    padding: var(--waveqr-space-md);
    border: 2px solid var(--waveqr-border);
    border-radius: var(--waveqr-radius-md);
    background: var(--waveqr-bg-secondary);
    color: var(--waveqr-text-primary);
    font-size: 1rem;
    transition: var(--waveqr-transition);
    box-sizing: border-box;
    margin: 0; /* Add margin 0 to remove default margins */
}

.waveqr-textarea:focus,
.waveqr-select:focus,
.waveqr-input:focus {
    outline: none;
    border-color: var(--waveqr-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    background: var(--waveqr-bg-primary);
}

.waveqr-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.waveqr-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.waveqr-hint {
    display: block;
    margin-top: var(--waveqr-space-xs);
    font-size: 0.8rem;
    color: var(--waveqr-text-muted);
    font-style: italic;
}

.waveqr-grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--waveqr-space-md);
}

/* === CHECKBOX === */
.waveqr-checkbox-label {
    display: flex!important;
    align-items: flex-start;
    gap: var(--waveqr-space-md);
    cursor: pointer;
    padding: var(--waveqr-space-md);
    border: 2px solid var(--waveqr-border);
    border-radius: var(--waveqr-radius-md);
    background: var(--waveqr-bg-secondary);
    transition: var(--waveqr-transition);
    width: 100%;
}

.waveqr-checkbox {
    display: none;
}

.waveqr-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--waveqr-border);
    border-radius: 4px;
    background: var(--waveqr-bg-primary);
    transition: var(--waveqr-transition);
    flex-shrink: 0;
    position: relative;
    margin-top: 2px;
}

.waveqr-checkbox:checked + .waveqr-checkbox-custom {
    background: var(--waveqr-primary);
    border-color: var(--waveqr-primary);
}

.waveqr-checkbox:checked + .waveqr-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 11px;
}

.waveqr-checkbox-content {
    flex: 1;
}

.waveqr-checkbox-content strong {
    display: block;
    font-weight: 600;
    color: var(--waveqr-text-primary);
    margin-bottom: 0.25rem;
}

.waveqr-checkbox-content small {
    color: var(--waveqr-text-muted);
    line-height: 1.4;
}

.waveqr-checkbox-label:hover {
    border-color: var(--waveqr-primary);
    background: var(--waveqr-bg-primary);
}

/* === DYNAMIC QR OPTIONS === */
.waveqr-dynamic-options {
    margin-top: var(--waveqr-space-md);
    margin-bottom: var(--waveqr-space-md);
    padding: var(--waveqr-space-md);
    border: 2px solid var(--waveqr-border);
    border-radius: var(--waveqr-radius-md);
    background: var(--waveqr-bg-secondary);
}

.waveqr-pricing-notice {
    text-align: center;
    margin: var(--waveqr-space-sm) 0;
}

.waveqr-pricing-notice small {
    color: var(--waveqr-text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.waveqr-info-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--waveqr-space-sm);
    padding: var(--waveqr-space-md);
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: var(--waveqr-radius-sm);
    color: #0066cc;
}

.waveqr-info-icon {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.waveqr-info-content {
    flex: 1;
}

.waveqr-info-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* === SWATCHES === */
.waveqr-swatch-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--waveqr-space-sm);
}

.waveqr-swatch {
    cursor: pointer;
}

.waveqr-swatch input[type="radio"] {
    display: none;
}

.waveqr-swatch-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* Ensure consistent height */
    padding: var(--waveqr-space-sm) var(--waveqr-space-md);
    border: 2px solid var(--waveqr-border);
    border-radius: var(--waveqr-radius-md);
    background: var(--waveqr-bg-secondary);
    color: var(--waveqr-text-secondary);
    transition: var(--waveqr-transition);
    font-weight: 500;
}

.waveqr-swatch-icon {
    height: 24px;
    width: 24px;
    transition: filter 0.2s;
}

/* QR-Code Beispielbilder in Design-Swatches etwas größer */
.waveqr-swatch-icon[src*="qr-examples"] {
    height: 25px;
    width: 25px;
    border-radius: 4px;
}

.waveqr-swatch input[type="radio"]:checked + .waveqr-swatch-content {
    background: var(--waveqr-primary);
    color: white;
    border-color: var(--waveqr-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ALLE Icons werden weiß wenn ausgewählt (sowohl SVG als auch PNG) */
.waveqr-swatch input[type="radio"]:checked + .waveqr-swatch-content .waveqr-swatch-icon {
    filter: brightness(0) invert(1);
}

.waveqr-swatch:hover .waveqr-swatch-content {
    border-color: var(--waveqr-border-hover);
    background: var(--waveqr-bg-tertiary);
}

.waveqr-swatch input[type="radio"]:checked:hover + .waveqr-swatch-content {
    background: var(--waveqr-primary-hover);
    border-color: var(--waveqr-primary-hover);
}


/* === COLOR PICKER GRID === */
.waveqr-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--waveqr-space-md);
}

.waveqr-color-item {
    display: flex;
    flex-direction: column;
    gap: var(--waveqr-space-xs);
}

.waveqr-color-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--waveqr-text-secondary);
    margin: 0;
}

.waveqr-background-controls {
    display: flex;
    gap: var(--waveqr-space-xs);
    align-items: stretch;
}

.waveqr-background-controls .waveqr-color-picker {
    flex: 1;
}

.waveqr-transparent-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px solid var(--waveqr-border);
    border-radius: var(--waveqr-radius-md);
    background: var(--waveqr-bg-secondary);
    color: var(--waveqr-text-secondary);
    cursor: pointer;
    transition: var(--waveqr-transition);
    font-size: 1.2rem;
    font-weight: bold;
}

.waveqr-transparent-btn:hover {
    border-color: var(--waveqr-primary);
    background: var(--waveqr-bg-primary);
    color: var(--waveqr-primary);
    transform: scale(1.02);
}

.waveqr-transparent-btn.active {
    background: var(--waveqr-primary);
    border-color: var(--waveqr-primary);
    color: white;
}

.waveqr-background-picker[data-transparent="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.waveqr-transparent-icon {
    display: inline-block;
    transform: rotate(45deg);
}

.waveqr-color-picker {
    width: 100%;
    height: 50px;
    border: 2px solid var(--waveqr-border);
    border-radius: var(--waveqr-radius-md);
    cursor: pointer;
    transition: var(--waveqr-transition);
    background: none;
    padding: 0;
}

.waveqr-color-picker:hover {
    border-color: var(--waveqr-primary);
    transform: scale(1.02);
    box-shadow: var(--waveqr-shadow-md);
}

/* === LOGO UPLOAD === */
.waveqr-upload-area {
    position: relative;
}

.waveqr-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--waveqr-space-sm);
    width: 100%;
    padding: var(--waveqr-space-lg);
    border: 2px dashed var(--waveqr-border);
    border-radius: var(--waveqr-radius-md);
    background: var(--waveqr-bg-secondary);
    color: var(--waveqr-text-secondary);
    cursor: pointer;
    transition: var(--waveqr-transition);
    font-weight: 500;
}

.waveqr-upload-btn:hover {
    border-color: var(--waveqr-primary);
    background: var(--waveqr-bg-primary);
    color: var(--waveqr-primary);
}

.waveqr-upload-icon {
    font-size: 1.5rem;
}

.waveqr-logo-preview {
    position: relative;
    margin-top: var(--waveqr-space-md);
    display: flex;
    align-items: center;
    gap: var(--waveqr-space-md);
    padding: var(--waveqr-space-md);
    background: var(--waveqr-bg-secondary);
    border-radius: var(--waveqr-radius-md);
    border: 1px solid var(--waveqr-border);
}

.waveqr-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--waveqr-radius-sm);
    background: var(--waveqr-bg-primary);
    border: 1px solid var(--waveqr-border);
}

.waveqr-remove-logo {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--waveqr-error);
    color: white;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--waveqr-transition);
}

.waveqr-remove-logo:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* === PRO BADGE === */
.waveqr-pro-badge {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    margin-left: var(--waveqr-space-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* === BUTTONS === */
/* Action Buttons */
.waveqr-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.waveqr-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.waveqr-btn-primary {
    background: var(--waveqr-primary);
    color: white;
}

.waveqr-btn-primary:hover {
    background: var(--waveqr-primary-hover);
    transform: translateY(-1px);
}

.waveqr-btn-icon {
    padding: 0.5rem;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
}

.waveqr-btn-icon img {
    width: 20px;
    height: 20px;
}

.waveqr-btn-secondary {
    background: var(--waveqr-bg-secondary);
    color: var(--waveqr-text-primary);
    border: 2px solid var(--waveqr-border);
}

.waveqr-btn-secondary:hover {
    background: var(--waveqr-bg-secondary);
    border-color: var(--waveqr-primary);
}

.waveqr-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* === PREVIEW AREA === */
.waveqr-preview-area {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--waveqr-border);
    border-radius: var(--waveqr-radius-lg);
    background: var(--waveqr-bg-secondary);
    position: relative;
    transition: var(--waveqr-transition);
}

.waveqr-preview-area.has-qr {
    border-color: var(--waveqr-success);
    background: var(--waveqr-bg-primary);
}

.waveqr-placeholder {
    text-align: center;
    color: var(--waveqr-text-muted);
}

.waveqr-placeholder-icon {
    font-size: 4rem;
    margin-bottom: var(--waveqr-space-md);
    opacity: 0.5;
}

.waveqr-placeholder p {
    font-size: 1.1rem;
    margin: 0 0 var(--waveqr-space-sm) 0;
    font-weight: 500;
}

.waveqr-placeholder small {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* === LOADING SPINNER === */
.waveqr-loading {
    text-align: center;
    color: var(--waveqr-primary);
}

.waveqr-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--waveqr-border);
    border-top: 4px solid var(--waveqr-primary);
    border-radius: 50%;
    animation: waveqr-spin 1s linear infinite;
    margin: 0 auto var(--waveqr-space-md) auto;
}

.waveqr-loading p {
    font-weight: 500;
    margin: 0;
}

/* === RESULT === */
.waveqr-result {
    text-align: center;
}

.waveqr-result-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--waveqr-radius-md);
    box-shadow: var(--waveqr-shadow-lg);
    transition: var(--waveqr-transition);
    cursor: pointer;
}

.waveqr-result-img:hover {
    transform: scale(1.05);
    box-shadow: var(--waveqr-shadow-xl);
}

.waveqr-result-info {
    margin-top: var(--waveqr-space-md);
    display: flex;
    justify-content: center;
    gap: var(--waveqr-space-md);
    font-size: 0.9rem;
    color: var(--waveqr-text-secondary);
}

.waveqr-result-info span {
    padding: var(--waveqr-space-xs) var(--waveqr-space-sm);
    background: var(--waveqr-bg-secondary);
    border-radius: var(--waveqr-radius-sm);
    border: 1px solid var(--waveqr-border);
}

/* === ANIMATIONS === */
@keyframes waveqr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes waveqr-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes waveqr-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .waveqr-grid {
        grid-template-columns: 1fr;
        gap: var(--waveqr-space-lg);
    }
    
    .waveqr-title {
        font-size: 1.5rem;
    }
    
    .waveqr-subtitle {
        font-size: 1rem;
    }
    
    .waveqr-actions {
        flex-direction: column;
    }
    
    .waveqr-color-grid {
        grid-template-columns: 1fr;
    }
    
    .waveqr-features {
        flex-direction: column;
        align-items: center;
    }
    
    .waveqr-preview-area {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .waveqr-panel {
        padding: var(--waveqr-space-md);
    }
    
    .waveqr-btn {
        padding: var(--waveqr-space-sm) var(--waveqr-space-md);
        font-size: 0.9rem;
        min-width: auto;
    }
}

/* === MODAL-SPECIFIC STYLES === */
.waveqr-modal-generator {
    background: var(--waveqr-bg-primary);
    border-radius: var(--waveqr-radius-lg);
    overflow: hidden;
}

.waveqr-modal-generator .waveqr-grid {
    gap: var(--waveqr-space-lg);
}

.waveqr-modal-generator .waveqr-panel {
    box-shadow: none;
    border: 1px solid var(--waveqr-border);
}

/* Modal-spezifische Anpassungen für kompaktere Anzeige */
.waveqr-modal-generator .waveqr-field {
    margin-bottom: var(--waveqr-space-md);
}

.waveqr-modal-generator .waveqr-swatch-group {
    gap: var(--waveqr-space-sm);
}

.waveqr-modal-generator .waveqr-preview-area {
    min-height: 250px;
}

/* Modal Actions - entfernt, da Auto-Save implementiert */

/* Modal Editor spezifische Styles */
.waveqr-modal-editor {
    max-width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.waveqr-modal-editor h3 {
    margin: 0 0 var(--waveqr-space-lg) 0;
    padding: 0 var(--waveqr-space-lg) var(--waveqr-space-lg) var(--waveqr-space-lg);
    border-bottom: 1px solid var(--waveqr-border);
    color: var(--waveqr-text-primary);
}

/* Message & Hint Styles */
.waveqr-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.waveqr-message-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.waveqr-message-success::before {
    content: '✓';
    font-weight: bold;
    color: #28a745;
}

.waveqr-message-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.waveqr-message-error::before {
    content: '✗';
    font-weight: bold;
    color: #dc3545;
}

.waveqr-message-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.waveqr-message-warning::before {
    content: '⚠';
    font-weight: bold;
    color: #ffc107;
}

.waveqr-message-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.waveqr-message-info::before {
    content: 'ℹ';
    font-weight: bold;
    color: #17a2b8;
}

.waveqr-input-hint {
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.waveqr-hint-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.waveqr-hint-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.waveqr-field.waveqr-valid .waveqr-textarea,
.waveqr-field.waveqr-valid .waveqr-select {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.waveqr-field.waveqr-warning .waveqr-textarea,
.waveqr-field.waveqr-warning .waveqr-select {
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.waveqr-field.waveqr-error .waveqr-textarea,
.waveqr-field.waveqr-error .waveqr-select {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
} 