/**
 * 二维码模态框样式
 * 
 * @package PixelShare
 * @author 猫大大
 * @version 1.0.0
 */

/* 模态框遮罩 */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.qr-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 模态框内容 */
.qr-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
    position: relative;
}

.qr-modal-overlay.show .qr-modal-content {
    transform: scale(1) translateY(0);
}

/* 模态框头部 */
.qr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.qr-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.qr-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.qr-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 模态框主体 */
.qr-modal-body {
    padding: 32px 24px;
    text-align: center;
}

.qr-code-large {
    margin-bottom: 20px;
}

.qr-code-large img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    border: 3px solid #f3f4f6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.qr-modal-tip {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* 模态框底部 */
.qr-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.qr-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.qr-modal-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.qr-modal-btn.secondary:hover {
    background: #e5e7eb;
}

.qr-modal-btn.primary {
    background: #6366f1;
    color: white;
}

.qr-modal-btn.primary:hover {
    background: #5855eb;
    transform: translateY(-1px);
}

/* 二维码加载状态 */
.qr-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.qr-loading i {
    font-size: 24px;
    color: #6366f1;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .qr-modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }
    
    .qr-modal-header {
        padding: 20px 20px 12px 20px;
    }
    
    .qr-modal-header h3 {
        font-size: 16px;
    }
    
    .qr-modal-body {
        padding: 24px 20px;
    }
    
    .qr-code-large img {
        width: 160px;
        height: 160px;
    }
    
    .qr-modal-footer {
        padding: 12px 20px 20px 20px;
        flex-direction: column;
    }
    
    .qr-modal-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .qr-modal-content {
        margin: 16px;
        max-width: calc(100vw - 32px);
    }
    
    .qr-modal-header {
        padding: 16px 16px 12px 16px;
    }
    
    .qr-modal-body {
        padding: 20px 16px;
    }
    
    .qr-code-large img {
        width: 140px;
        height: 140px;
    }
    
    .qr-modal-footer {
        padding: 12px 16px 16px 16px;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .qr-modal-content {
        background: #1f2937;
        border: 1px solid #374151;
    }
    
    .qr-modal-header {
        background: #111827;
        border-bottom-color: #374151;
    }
    
    .qr-modal-header h3 {
        color: #f9fafb;
    }
    
    .qr-modal-close {
        color: #9ca3af;
    }
    
    .qr-modal-close:hover {
        background: #374151;
        color: #d1d5db;
    }
    
    .qr-modal-body {
        background: #1f2937;
    }
    
    .qr-modal-footer {
        background: #111827;
        border-top-color: #374151;
    }
    
    .qr-modal-btn.secondary {
        background: #374151;
        color: #d1d5db;
    }
    
    .qr-modal-btn.secondary:hover {
        background: #4b5563;
    }
    
    .qr-modal-tip {
        color: #9ca3af;
    }
}

/* 动画增强 */
.qr-modal-overlay {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.qr-modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 二维码悬停效果 */
.qr-code-image.hover {
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

/* 加载动画 */
.qr-code-image.loading {
    opacity: 0.6;
}

/* 错误状态 */
.qr-code-image.error {
    opacity: 0.5;
    filter: grayscale(1);
} 