/* ============================================================
   Blog Password Protect — Frosted Glass Modal Styles
   (New Feature — does not modify any existing styles)
   ============================================================ */

/* Full-page overlay container */
.blog-protect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    overflow: hidden;
}

/* Frosted glass blur layer — sits behind the modal */
.blog-protect-blur-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 毛玻璃（高斯模糊）效果 */
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.45);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .blog-protect-blur-layer {
        background-color: rgba(245, 247, 250, 0.92);
    }
}

/* Vertically + horizontally center the modal */
.blog-protect-modal-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: blog-protect-fade-in 0.35s ease-out;
}

@keyframes blog-protect-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* The modal card itself */
.blog-protect-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    backdrop-filter: blur(20px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 40px 32px 32px;
    box-shadow:
        0 20px 60px rgba(30, 40, 60, 0.15),
        0 4px 12px rgba(30, 40, 60, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: blog-protect-pop-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .blog-protect-modal {
        background: #ffffff;
        border: 1px solid #e9ecef;
    }
}

@keyframes blog-protect-pop-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Lock icon at top */
.blog-protect-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.blog-protect-icon i {
    color: #fff;
    font-size: 26px;
}

.blog-protect-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.blog-protect-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 28px;
}

/* Password input
 * —— <input> 已使用 Bootstrap 系统自带的 .form-control，
 *    此处仅叠加图标左右 padding 与自定义 focus 光晕，其余样式（
 *    字体/字号/行高/圆角/边框/高度/transition 等）全部复用系统既有格式。
 */
.blog-protect-input-group {
    position: relative;
    margin-bottom: 16px;
}

.blog-protect-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 14px;
    pointer-events: none;
    z-index: 4; /* 位于 form-control 之上 */
}

.blog-protect-input.form-control {
    /* 为左右图标/按钮留出空间；其余 box-model 属性由 Bootstrap form-control 提供 */
    padding-left: 38px;
    padding-right: 44px;
    background: rgba(255, 255, 255, 0.85);
}

.blog-protect-input.form-control:focus {
    /* 保留系统 form-control 的 focus 边框颜色，只叠加一层柔和光晕 */
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.2);
    border-color: #80bdff;
    background: #fff;
}

.blog-protect-toggle-pw {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    z-index: 4;
    transition: color 0.2s ease, background 0.2s ease;
}

.blog-protect-toggle-pw:hover {
    color: #495057;
    background: rgba(108, 117, 125, 0.1);
}

/* Error message */
.blog-protect-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #dc2626;
    font-size: 0.85rem;
    margin: 0 0 18px;
    padding: 10px 14px;
    background: rgba(254, 226, 226, 0.7);
    border: 1px solid rgba(252, 165, 165, 0.6);
    border-radius: 10px;
    animation: blog-protect-shake 0.4s ease;
}

@keyframes blog-protect-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

/* Buttons */
.blog-protect-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.blog-protect-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.blog-protect-btn-back {
    background: rgba(255, 255, 255, 0.8);
    color: #4b5563;
    border: 1.5px solid rgba(200, 208, 220, 0.8);
}

.blog-protect-btn-back:hover {
    background: #fff;
    border-color: #9ca3af;
    color: #1f2937;
    transform: translateY(-1px);
}

.blog-protect-btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.blog-protect-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(85, 93, 131, 0.4);
    filter: brightness(1.05);
}

.blog-protect-btn:active {
    transform: translateY(0);
}

/* Bottom hint */
.blog-protect-hint {
    text-align: center;
    font-size: 0.78rem;
    color: #9ca3af;
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(200, 208, 220, 0.4);
}

.blog-protect-hint i {
    margin-right: 4px;
}

/* Scroll lock on body when modal active */
body.blog-protect-locked {
    overflow: hidden !important;
}

/*
 * 注意：不要对 main / .container-lg 施加 filter: blur()
 * ——父容器的 filter 会创建新层叠上下文，导致 fixed 定位的
 *   毛玻璃遮罩和 modal 也被一并模糊，最终连密码框都看不清。
 * 正确做法：仅依靠 overlay 内部 .blog-protect-blur-layer 的
 *   backdrop-filter（它只模糊遮罩背后的内容，不影响遮罩上方的 modal）。
 */

/* Responsive */
@media (max-width: 480px) {
    .blog-protect-modal {
        padding: 32px 24px 24px;
        border-radius: 16px;
    }
    .blog-protect-title {
        font-size: 1.3rem;
    }
    .blog-protect-icon {
        width: 56px;
        height: 56px;
    }
    .blog-protect-icon i {
        font-size: 22px;
    }
    .blog-protect-buttons {
        flex-direction: column-reverse;
    }
}
