/* QR Code Pairing Modal Styles */

.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.qr-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.qr-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qr-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qr-modal-header i {
    color: #007bff;
    font-size: 24px;
}

.qr-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.qr-modal-close:hover {
    color: #333;
}

.qr-modal-body {
    padding: 30px;
    text-align: center;
}

#qrcode-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    min-height: 280px;
    position: relative;
}

#qr-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrcode-container canvas,
#qrcode-container img,
#qr-wrapper canvas,
#qr-wrapper img {
    display: block !important;
    margin: 0 auto;
    max-width: 256px !important;
    max-height: 256px !important;
    width: 256px !important;
    height: 256px !important;
}

/* Hide any duplicate QR codes that might appear */
#qrcode-container > *:not(:first-child):not(#qr-wrapper),
#qr-wrapper > *:not(:first-child) {
    display: none !important;
}

.qr-instructions {
    text-align: left;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.qr-instructions h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
}

.qr-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.qr-instructions li {
    margin-bottom: 5px;
    line-height: 1.5;
    font-size: 14px;
}

.qr-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.qr-warning i {
    color: #ffc107;
    font-size: 16px;
    flex-shrink: 0;
}

.qr-warning span {
    line-height: 1.4;
}

.qr-warning strong {
    color: #856404;
}

.qr-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

/* QR Scanner specific styles */
#qr-scanner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#qr-video {
    border: 3px solid #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.qr-scanner-status {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 15px 0;
}

.qr-scanner-status p {
    margin: 0;
    font-weight: 500;
}

/* Device Pairing Section in Settings */
.device-pairing-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.device-pairing-section h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.device-pairing-section p {
    margin: 0 0 20px 0;
    opacity: 0.95;
}

.pairing-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pairing-buttons .btn {
    flex: 1;
    min-width: 180px;
}

.btn-qr-generate {
    background: white;
    color: #667eea;
    border: 2px solid white;
}

.btn-qr-generate:hover {
    background: rgba(255, 255, 255, 0.9);
}

.btn-qr-scan {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-qr-scan:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .qr-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .qr-modal-body {
        padding: 20px;
    }
    
    #qrcode-container {
        padding: 15px;
    }
    
    .pairing-buttons {
        flex-direction: column;
    }
    
    .pairing-buttons .btn {
        width: 100%;
    }
}

/* Alert styles */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}
/* Prevent tooltips from appearing on QR code */
#qrcode-container *[title],
#qr-wrapper *[title] {
    pointer-events: none !important;
}