/**
 * iOS 26 Liquid Glass Style - Note Editor
 * Version: 2.3.0
 * 
 * 备注编辑器液态玻璃设计风格
 */

:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-blur: 20px;
    
    --gradient-primary: linear-gradient(135deg, #3B63E4 0%, #2a4fc9 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8a8aa0;
    
    --radius-sm: 12px;
    --radius-md: 16px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 备注编辑弹出框 */
.note-editor-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 255, 0.95) 100%);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-md);
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    padding: 24px;
    min-width: 320px;
    max-width: 400px;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast) var(--spring);
}

.note-editor-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹出框遮罩 */
.note-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.note-editor-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 弹出框标题 */
.note-editor-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.note-editor-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* 输入框 */
.note-editor-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.06);
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
    resize: vertical;
    min-height: 80px;
}

.note-editor-input:focus {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.08);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.note-editor-input::placeholder {
    color: var(--text-muted);
}

/* 按钮组 */
.note-editor-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.note-editor-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.note-editor-btn-cancel {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.note-editor-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

.note-editor-btn-save {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.note-editor-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
}

.note-editor-btn-save:active {
    transform: translateY(0);
}

.note-editor-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 加载状态 */
.note-editor-btn-loading {
    position: relative;
    color: transparent !important;
}

.note-editor-btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: noteSpinner 0.8s linear infinite;
}

@keyframes noteSpinner {
    to { transform: rotate(360deg); }
}

/* 成功提示 */
.note-save-success {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--gradient-success);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(17, 153, 142, 0.4);
    z-index: 100001;
    opacity: 0;
    transition: all 0.4s var(--spring);
}

.note-save-success.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 内联编辑模式 */
.note-inline-editor {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(102, 126, 234, 0.06);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.note-inline-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    outline: none;
    transition: all var(--transition-fast);
}

.note-inline-input:focus {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.note-inline-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.note-inline-btn-save {
    background: var(--gradient-primary);
    color: white;
}

.note-inline-btn-save:hover {
    transform: scale(1.05);
}

.note-inline-btn-cancel {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

.note-inline-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .note-editor-popup {
        min-width: auto;
        max-width: calc(100% - 40px);
        padding: 20px;
    }
    
    .note-editor-actions {
        flex-direction: column;
    }
    
    .note-editor-btn {
        padding: 14px 20px;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .note-editor-popup,
    .note-editor-overlay,
    .note-save-success {
        transition-duration: 0.01ms !important;
    }
    
    .note-editor-btn-loading::after {
        animation: none;
    }
}
