/**
 * 闻法证样式
 */

.lms-certificate-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.lms-certificate-preview {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: none;
    text-align: center;
}

.lms-certificate-preview-image-wrapper {
    display: inline-block;
    max-width: 100%;
}

.lms-certificate-preview-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.lms-certificate-preview-placeholder,
.certificate-preview-placeholder {
    padding: 40px;
    color: #666;
    text-align: center;
}

.certificate-preview-loading {
    padding: 40px;
    text-align: center;
    color: #666;
}

.certificate-preview-loading .spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.certificate-preview-image-wrapper {
    display: inline-block;
    max-width: 100%;
}

.certificate-preview-image {
    max-width: 40%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.certificate-preview-error {
    padding: 40px;
    text-align: center;
    color: #d63638;
    background: #fcf0f1;
    border-radius: 4px;
}

.lms-certificate-preview-inner {
    text-align: center;
    position: relative;
}

.lms-certificate-logo {
    margin-bottom: 20px;
}

.lms-certificate-logo img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.lms-certificate-title {
    font-weight: bold;
    margin-bottom: 20px;
    color: #000;
}

.lms-certificate-name {
    font-weight: 500;
    margin-bottom: 15px;
    color: #000;
}

.lms-certificate-student-number {
    margin-bottom: 20px;
    color: #666;
}

.lms-certificate-qr-code {
    margin-top: 20px;
    display: inline-block;
}

.lms-certificate-qr-code img {
    max-width: 100%;
    height: auto;
}

.lms-certificate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
    flex-shrink: 0;
}

.lms-btn-download-pdf,
.lms-btn-download-image {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    margin: 0;
    width: 100%;
    min-width: 150px;
    background: linear-gradient(135deg, #627dff 0%, #c084fc 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(98, 125, 255, 0.3);
}

.lms-btn-download-pdf:hover,
.lms-btn-download-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(98, 125, 255, 0.4);
}

.lms-btn-download-pdf .dashicons,
.lms-btn-download-image .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.lms-certificate-notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    background: #f0f0f1;
    color: #646970;
}

.lms-certificate-notice.lms-certificate-error {
    background: #fcf0f1;
    color: #d63638;
}

/* 移动设备响应式设计 */
@media screen and (max-width: 768px) {
    .lms-certificate-container {
        flex-direction: column;
        align-items: center;
        padding: 15px;
    }
    
    .lms-certificate-preview {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .certificate-preview-image {
        max-width: 80%;
    }
    
    .lms-certificate-actions {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }
    
    .lms-btn-download-pdf,
    .lms-btn-download-image {
        flex: 1;
        min-width: 0;
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .certificate-preview-image {
        max-width: 90%;
    }
    
    .lms-certificate-actions {
        flex-direction: column;
    }
    
    .lms-btn-download-pdf,
    .lms-btn-download-image {
        width: 100%;
    }
}

