/* ===================================
   Top Secret - 主样式文件
   ================================= */

/* 导入现代字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===================================
   自定义动画
   ================================= */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 0% 100%; }
    75% { background-position: 100% 0%; }
    100% { background-position: 0% 50%; }
}

/* ===================================
   动画类
   ================================= */

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in {
    animation: slideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   滚动条隐藏
   ================================= */

.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

/* ===================================
   文字处理
   ================================= */

/* 移动端密码换行 */
.word-break {
    word-break: break-all;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* ===================================
   背景效果
   ================================= */

/* 现代赛博朋克渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
    background-size: 400% 400%;
    animation: gradientShift 25s ease infinite;
    position: relative;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* ===================================
   玻璃效果
   ================================= */

/* 高级玻璃效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
}

/* 配方管理卡片专用背景 - 借鉴generation-method-card设计理念 */
.recipe-card-bg {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   表单元素
   ================================= */

/* 现代输入框 */
.modern-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 210, 211, 0.8);
    box-shadow: 0 0 0 4px rgba(0, 210, 211, 0.1), 0 0 20px rgba(0, 210, 211, 0.2);
    transform: translateY(-2px);
}

/* ===================================
   按钮样式
   ================================= */

/* 现代赛博朋克按钮 */
.modern-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff3838 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 107, 107, 0.3);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.modern-btn:hover::before {
    left: 100%;
}

.modern-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4), 0 0 30px rgba(255, 107, 107, 0.3);
    background: linear-gradient(135deg, #ff5252 0%, #d63031 50%, #e84393 100%);
    border-color: rgba(255, 107, 107, 0.5);
}

.modern-btn:disabled {
    opacity: 0.8;
    transform: none !important;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff3838 100%) !important;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2) !important;
}

/* 修复加载状态下的按钮样式 */
.modern-btn.loading-shimmer {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff3838 100%) !important;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2) !important;
}

/* ===================================
   开关组件
   ================================= */

/* 现代开关 */
.modern-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.modern-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

input:checked + .switch-slider {
    background: linear-gradient(135deg, #00d2d3 0%, #54a0ff 100%);
    border-color: rgba(0, 210, 211, 0.8);
    box-shadow: 0 0 15px rgba(0, 210, 211, 0.3);
}

input:checked + .switch-slider:before {
    transform: translateX(26px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* ===================================
   卡片组件
   ================================= */

/* 策略选择卡片 - 改进版 */
.strategy-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08) 0%, rgba(238, 90, 36, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.strategy-card:hover {
    border-color: rgba(255, 107, 107, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 0 12px rgba(255, 107, 107, 0.15);
    transform: translateY(-1px);
}

.strategy-card:hover::before {
    opacity: 1;
}

.strategy-card.selected {
    border-color: rgba(255, 107, 107, 0.6);
    background: rgba(255, 107, 107, 0.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 15px rgba(255, 107, 107, 0.2);
    transform: translateY(-1px);
}

.strategy-card.selected::before {
    opacity: 1;
}

/* 生成方式选择器特殊样式 */
.generation-method-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.generation-method-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.generation-method-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 0 12px rgba(6, 182, 212, 0.15);
    transform: translateY(-1px);
}

.generation-method-card:hover::before {
    opacity: 1;
}

.generation-method-card.selected {
    border-color: rgba(6, 182, 212, 0.6);
    background: rgba(6, 182, 212, 0.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 15px rgba(6, 182, 212, 0.25);
    transform: translateY(-1px);
}

.generation-method-card.selected::before {
    opacity: 1;
}

/* 便笺安全级别选择卡片 */
.security-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.security-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.security-card:hover {
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 0 12px rgba(34, 197, 94, 0.15);
    transform: translateY(-1px);
}

.security-card:hover::before {
    opacity: 1;
}

.security-card.selected {
    border-color: rgba(34, 197, 94, 0.6);
    background: rgba(34, 197, 94, 0.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 15px rgba(34, 197, 94, 0.2);
    transform: translateY(-1px);
}

.security-card.selected::before {
    opacity: 1;
}

/* 便笺操作按钮样式 */
.encrypt-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.encrypt-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.decrypt-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.decrypt-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* 隐藏便笺内容区域的滚动条 */
#noteContent {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#noteContent::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* ===================================
   模式切换
   ================================= */

/* 模式切换按钮样式 */
.mode-tab.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    color: white;
}

/* ===================================
   密码显示
   ================================= */

/* 密码显示区域 */
.password-display {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    letter-spacing: 2px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.password-display:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* ===================================
   自动补全组件
   ================================= */

/* 自动补全样式 */
.autocomplete-suggestions {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.autocomplete-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

.autocomplete-suggestion:hover {
    background: rgba(255, 107, 107, 0.2);
    color: white;
    transform: translateX(4px);
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

/* 自动补全下拉框 */
.autocomplete-dropdown {
    max-height: 200px;
    overflow-y: auto; /* 保持滚动功能但隐藏滚动条 */
    z-index: 1000;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 210, 211, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 210, 211, 0.1);
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.autocomplete-dropdown::-webkit-scrollbar {
    display: none;
}

.autocomplete-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    transform: translateX(0px); /* 移除左移效果避免空白 */
    border-bottom-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    margin: 0; /* 确保没有外边距 */
    padding-left: 16px; /* 保持一致的内边距 */
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* ===================================
   加载动画
   ================================= */

/* 加载动画 */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* ===================================
   响应式设计
   ================================= */

/* 移动端适配 */
@media (max-width: 768px) {
    .password-display {
        font-size: 12px !important;
        line-height: 1.8 !important;
        letter-spacing: 0.5px !important;
        padding: 12px !important;
    }

    /* 密码分析区域 */
    #password-analysis-display {
        font-size: 11px !important;
        line-height: 1.8 !important;
        letter-spacing: 0.3px !important;
        padding: 10px !important;
    }

    /* 确保密码不超出容器 */
    #passwordDisplay,
    #password-analysis-display div {
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: break-all;
    }
}

/* 响应式优化 */
@media (max-width: 640px) {
    .glass-effect {
        margin: 1rem;
        padding: 1.5rem;
    }
}
