/**
 * Public styles
 * public/css/public.css
 */

/* QR Code Container */
.cqr-qr-code-container {
    display: inline-block;
    text-align: center;
    margin: 10px 0;
}

.cqr-qr-code {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    padding: 10px;
}

.cqr-qr-code:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* QR Code Sizes */
.cqr-qr-code.cqr-small {
    max-width: 100px;
}

.cqr-qr-code.cqr-medium {
    max-width: 200px;
}

.cqr-qr-code.cqr-large {
    max-width: 300px;
}

.cqr-qr-code.cqr-xlarge {
    max-width: 400px;
}

/* QR Code Caption */
.cqr-qr-caption {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* QR Code with Call to Action */
.cqr-qr-with-cta {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    text-align: center;
    margin: 20px 0;
}

.cqr-qr-with-cta .cqr-cta-text {
    margin-bottom: 15px;
    font-weight: 600;
    color: #495057;
    font-size: 16px;
}

.cqr-qr-with-cta .cqr-qr-code {
    margin: 0 auto;
    display: block;
}

.cqr-qr-with-cta .cqr-cta-subtitle {
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
}

/* QR Code Gallery */
.cqr-qr-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cqr-qr-gallery-item {
    text-align: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cqr-qr-gallery-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.cqr-qr-gallery-item .cqr-qr-code {
    margin-bottom: 10px;
    padding: 5px;
}

.cqr-qr-gallery-item .cqr-qr-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.cqr-qr-gallery-item .cqr-qr-description {
    font-size: 12px;
    color: #666;
}

/* QR Code Modal */
.cqr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cqr-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cqr-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.cqr-modal-overlay.active .cqr-modal-content {
    transform: scale(1);
}

.cqr-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    padding: 5px;
    line-height: 1;
}

.cqr-modal-close:hover {
    color: #000;
}

.cqr-modal-qr {
    max-width: 300px;
    margin: 0 auto 20px;
}

.cqr-modal-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.cqr-modal-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Loading Animation */
.cqr-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: cqr-spin 1s linear infinite;
}

@keyframes cqr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* QR Code Error State */
.cqr-qr-error {
    display: inline-block;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    text-align: center;
    font-size: 14px;
}

.cqr-qr-error::before {
    content: "⚠️";
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

/* Print Styles */
@media print {
    .cqr-qr-code-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .cqr-qr-code:hover {
        transform: none;
        box-shadow: none;
    }
    
    .cqr-qr-with-cta {
        border: 2px solid #000;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cqr-qr-gallery {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .cqr-qr-with-cta {
        padding: 15px;
        margin: 15px 0;
    }
    
    .cqr-qr-with-cta .cqr-cta-text {
        font-size: 14px;
    }
    
    .cqr-modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .cqr-modal-qr {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .cqr-qr-gallery {
        grid-template-columns: 1fr 1fr;
    }
    
    .cqr-qr-code {
        padding: 5px;
    }
}

/* Accessibility */
.cqr-qr-code:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.cqr-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .cqr-qr-code {
        border: 2px solid;
    }
    
    .cqr-qr-with-cta {
        border: 3px solid;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .cqr-qr-code,
    .cqr-qr-gallery-item,
    .cqr-modal-overlay,
    .cqr-modal-content {
        transition: none;
    }
    
    .cqr-qr-code:hover {
        transform: none;
    }
    
    .cqr-loading {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cqr-qr-code {
        background: #1a1a1a;
        border-color: #444;
    }
    
    .cqr-qr-with-cta {
        background: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .cqr-qr-with-cta .cqr-cta-text {
        color: #e0e0e0;
    }
    
    .cqr-qr-gallery-item {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .cqr-qr-gallery-item .cqr-qr-title {
        color: #e0e0e0;
    }
    
    .cqr-modal-content {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .cqr-modal-title {
        color: #e0e0e0;
    }
}