/* QR Code Popup Styles */
.popup-qr-code {
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    z-index: 12000 !important;
}

/* Verhindere Body-Scrolling wenn Popup offen ist */
body.popup-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Backdrop is handled globally for popups; do not hide it here */

.popup-qr-code .popup-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.popup-qr-code .popup-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #c8a165;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 
                0 0 0 1px rgba(200, 161, 101, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 400px;
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: popupSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes popupSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-qr-code .popup-header {
    background: linear-gradient(135deg, #c8a165 0%, #d4b876 100%);
    padding: 25px 30px;
    text-align: center;
    position: relative;
    border-bottom: 2px solid #b8944f;
}

.popup-qr-code .popup-header h2 {
    color: #000000;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.popup-qr-code .popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #c8a165;
    font-size: 1.8em;
    text-decoration: none;
    z-index: 1000;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(200, 161, 101, 0.1);
    border: 2px solid #c8a165;
}

.popup-qr-code .popup-close:hover {
    color: #ffffff;
    background: #c8a165;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(200, 161, 101, 0.3);
}

.popup-qr-code .popup-body {
    padding: 40px 30px;
    text-align: center;
    background: #1a1a1a;
}

.qr-code-container {
    margin-bottom: 30px;
}

.qr-code-display {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border-radius: 15px;
    padding: 25px;
    margin: 0 auto 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 4px solid #c8a165;
    max-width: 280px;
    width: 100%;
    height: 280px;
    position: relative;
    overflow: hidden;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.qr-code-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(200, 161, 101, 0.1) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

/* QR Code scharf darstellen */
.qr-code-display canvas,
.qr-code-display img,
.qr-code-display svg {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.qr-code-description {
    color: #cccccc;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.qr-code-actions {
    margin-top: 30px;
}

.qr-code-actions .btn {
    background: linear-gradient(135deg, #c8a165 0%, #d4b876 100%);
    color: #000000;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(200, 161, 101, 0.3);
    position: relative;
    overflow: hidden;
}

.qr-code-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.qr-code-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 161, 101, 0.4);
}

.qr-code-actions .btn:hover::before {
    left: 100%;
}

.qr-code-actions .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(200, 161, 101, 0.3);
}

/* Popup Opening Animation */
.popup-qr-code.popup-opening {
    animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Responsive Design für QR Code Popup */
@media (max-width: 768px) {
    .popup-qr-code .popup-inner {
        padding: 15px;
    }
    
    .popup-qr-code .popup-content {
        max-width: 350px;
        border-radius: 15px;
    }
    
    .popup-qr-code .popup-header {
        padding: 20px 25px;
    }
    
    .popup-qr-code .popup-header h2 {
        font-size: 1.5em;
    }
    
    .popup-qr-code .popup-body {
        padding: 30px 25px;
    }
    
    .qr-code-display {
        max-width: 220px;
        height: 220px;
        padding: 20px;
    }
    
    .qr-code-description {
        font-size: 1em;
    }
    
    .qr-code-actions .btn {
        padding: 12px 25px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .popup-qr-code .popup-content {
        max-width: 320px;
        margin: 0 auto;
    }
    
    .popup-qr-code .popup-header {
        padding: 18px 20px;
    }
    
    .popup-qr-code .popup-body {
        padding: 25px 20px;
    }
    
    .qr-code-display {
        max-width: 200px;
        height: 200px;
        padding: 15px;
    }
}

/* Zusätzliche Verbesserungen für bessere UX */
.popup-qr-code .popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(200, 161, 101, 0.05) 50%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.popup-qr-code .popup-header,
.popup-qr-code .popup-body {
    position: relative;
    z-index: 2;
}

/* Verbesserte Fokus-States für Accessibility */
.qr-code-actions .btn:focus {
    outline: 2px solid #c8a165;
    outline-offset: 2px;
}

.popup-qr-code .popup-close:focus {
    outline: 2px solid #c8a165;
    outline-offset: 2px;
}

/* Loading State für QR Code */
.qr-code-display.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Error State für QR Code */
.qr-code-display.error {
    background: #ffebee;
    border-color: #f44336;
    color: #d32f2f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    text-align: center;
    padding: 20px;
}

.qr-code-display.error::before {
    display: none;
}
