/* resources/css/components/qr-print-popup.css */

/* QR Print Popup Styles */
.qr-print-popup {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.qr-print-popup-container {
    animation: popupSlideIn 0.3s ease-out;
    transform-origin: center;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Paper Template Options */
.paper-option {
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.paper-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease-in-out;
}

.paper-option:hover::before {
    left: 100%;
}

.paper-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.paper-option.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.paper-option .template-icon {
    transition: transform 0.2s ease-in-out;
}

.paper-option:hover .template-icon {
    transform: scale(1.1);
}

/* Radio Button Styling */
.paper-option input[type="radio"] {
    position: relative;
    -moz-appearance: none;
         appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.paper-option input[type="radio"]:checked {
    border-color: #3b82f6;
    background: #3b82f6;
}

.paper-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.paper-option input[type="radio"]:hover {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button Styling */
.qr-popup-btn {
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.qr-popup-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: width 0.3s ease-out, height 0.3s ease-out;
    transform: translate(-50%, -50%);
}

.qr-popup-btn:hover::before {
    width: 300px;
    height: 300px;
}

.qr-popup-btn:active {
    transform: scale(0.98);
}

/* Custom Scrollbar for Content */
.qr-popup-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.qr-popup-content::-webkit-scrollbar {
    width: 6px;
}

.qr-popup-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.qr-popup-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.qr-popup-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Paper Template Icons */
.template-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Responsive Design */
@media (max-width: 640px) {
    .qr-print-popup-container {
        margin: 1rem;
        max-width: none;
        width: calc(100vw - 2rem);
    }
    
    .paper-option {
        flex-direction: column;
        text-align: center;
    }
    
    .paper-option .template-icon {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
}

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

@keyframes qrSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print Preview Styles */
@media print {
    .qr-print-layout {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
    }
    
    .qr-label {
        -moz-column-break-inside: avoid;
             break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .no-print {
        display: none !important;
    }
}

/* QR Code Container */
.qr-code-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    background: white;
    border-radius: 4px;
}

.qr-code-image {
    max-width: 100%;
    max-height: 100%;
    -o-object-fit: contain;
       object-fit: contain;
}

/* Success/Error States */
.qr-success {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.05);
}

.qr-error {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

/* Tooltip */
.qr-tooltip {
    position: relative;
}

.qr-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 1000;
}

.qr-tooltip:hover::after {
    opacity: 1;
}

/* Paper Size Indicators */
.paper-size-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

/* Enhanced Focus States */
.paper-option:focus-within {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Button Group */
.qr-button-group {
    display: flex;
    gap: 12px;
}

.qr-button-group .qr-popup-btn {
    flex: 1;
    justify-content: center;
}

/* Template Grid */
.template-grid {
    display: grid;
    gap: 12px;
}

/* Animation for selected state */
.paper-option.selected .template-icon {
    animation: selectedPulse 1.5s ease-in-out infinite;
}

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