/**
 * QR Code Generator Styles
 * 
 * This file contains the CSS styles for the QR code generator component.
 * It includes styles for the QR code buttons and modal.
 */

/* QR Code Button */
.qr-code-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--accent-color, #ff8c00);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 5;
    opacity: 0.8;
}

.qr-code-button:hover {
    background-color: var(--accent-color-dark, #e67e00);
    opacity: 1;
    transform: scale(1.1);
}

.qr-code-button:focus {
    outline: 2px solid var(--accent-color-dark, #e67e00);
    outline-offset: 2px;
    opacity: 1;
}

.qr-code-button svg {
    width: 16px;
    height: 16px;
}

/* QR Code Modal */
.qr-code-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
}

.qr-code-modal.active {
    display: block;
}

.qr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.qr-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.qr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: var(--accent-color, #ff8c00);
    color: white;
}

.qr-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.qr-modal-close {
    background: transparent;
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.qr-modal-close:hover {
    transform: scale(1.2);
}

.qr-modal-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.qr-modal-close svg {
    width: 20px;
    height: 20px;
}

.qr-modal-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-code-container {
    margin-bottom: 16px;
    padding: 16px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-code-container canvas {
    display: block;
    margin: 0 auto;
}

.qr-code-description {
    text-align: center;
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

.qr-code-error {
    color: #e53e3e;
    text-align: center;
    margin: 8px 0 0;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .qr-modal-container {
        width: 95%;
        max-width: 350px;
    }
    
    .qr-code-container {
        padding: 12px;
    }
    
    .qr-code-container canvas {
        max-width: 100%;
        height: auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .qr-modal-container {
        background-color: #2d3748;
    }
    
    .qr-modal-header {
        background-color: var(--accent-color, #ff8c00);
    }
    
    .qr-code-container {
        background-color: white; /* Keep QR code background white for better scanning */
    }
    
    .qr-code-description {
        color: #cbd5e0;
    }
}

/* Support for site's dark mode toggle */
.dark-mode .qr-modal-container {
    background-color: #2d3748;
}

.dark-mode .qr-code-description {
    color: #cbd5e0;
}

/* Make sure service items have position relative for absolute positioning of QR button */
.service-item {
    position: relative;
}
