/**
 * 登录弹窗组件样式 - 现代简约风格
 * 文件: login-modal.css
 * 说明: 类似 3d66 的弹窗登录设计
 */

/* 弹窗遮罩层 - 毛玻璃效果 */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器 - 居中显示 */
.login-modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.login-modal-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹窗头部 - 简洁设计 */
.login-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    background: #fff;
}

.login-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-modal-title-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.login-modal-close {
    width: 26px;
    height: 26px;
    border: none;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s ease;
}

.login-modal-close:hover {
    background: #e8e8e8;
    color: #333;
    transform: rotate(90deg);
}

/* 弹窗内容区 */
.login-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* iframe 容器 */
.login-modal-iframe {
    width: 100%;
    height: 455px;
    border: none;
    display: block;
}

/* 加载状态 */
.login-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.login-modal-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-modal-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: loginModalSpin 0.8s linear infinite;
}

@keyframes loginModalSpin {
    to {
        transform: rotate(360deg);
    }
}

.login-modal-loading-text {
    font-size: 14px;
    color: #999;
    font-weight: 500;
}

/* 弹窗底部 - 用户协议 */
.login-modal-footer {
    padding: 12px 24px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

.login-modal-footer .text-blue-400 {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-modal-footer .text-blue-400:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* 模态框中的iframe容器调整 */
.login-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.login-modal-iframe { 
}

/* 响应式适配 */
@media (max-width: 640px) {
    .login-modal-container {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .login-modal-container.active {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .login-modal-iframe {
        height: calc(100vh - 180px); /* 调整高度以容纳底部协议 */
    }
    
    .login-modal-footer {
        padding: 10px 20px;
        font-size: 11px;
    }
    
    .login-modal-header {
        padding: 20px 24px 12px;
    }
    
    .login-modal-title {
        font-size: 20px;
    }
}

/* 动画效果 */
@keyframes loginModalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes loginModalSlideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -55%) scale(0.95);
    }
}

/* 弹窗出现动画 */
.login-modal-container.animating-in {
    animation: loginModalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.login-modal-container.animating-out {
    animation: loginModalSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* 遮罩动画 */
.login-modal-overlay.animating-in {
    animation: fadeIn 0.4s ease forwards;
}

.login-modal-overlay.animating-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 关闭按钮动画 */
.login-modal-close:active {
    transform: scale(0.95);
}

/* 防止背景滚动 */
body.login-modal-open {
    overflow: hidden;
}
